{"id":419,"date":"2017-12-02T10:49:27","date_gmt":"2017-12-02T02:49:27","guid":{"rendered":"http:\/\/www.whudj.cn\/?p=419"},"modified":"2017-12-19T12:36:48","modified_gmt":"2017-12-19T04:36:48","slug":"bezier%e6%9b%b2%e7%ba%bf%ef%bc%88%e4%b8%89%ef%bc%89bezier%e6%9b%b2%e7%ba%bf%e7%9a%84%e6%b1%82%e5%af%bc%e5%92%8c%e6%89%93%e6%96%ad","status":"publish","type":"post","link":"http:\/\/www.whudj.cn\/?p=419","title":{"rendered":"Bezier\u66f2\u7ebf\uff08\u4e09\uff09Bezier\u66f2\u7ebf\u7684\u6c42\u5bfc\u548c\u6253\u65ad"},"content":{"rendered":"<p>\u4e1a\u52a1\u4e2d\u4f7f\u7528\u66f2\u7ebf\u7684\u76ee\u7684\uff0c\u4e3b\u8981\u662f\u56e0\u4e3a\u66f2\u7ebf\u5177\u6709\u9ad8\u9636\u5bfc\u6570\u8fde\u7eed\u7684\u7279\u70b9\u3002\u6bd4\u5982\u8bbe\u8ba1\u516c\u8def\uff0c\u4e0d\u4ec5\u8981\u6c42\u65b9\u5411\u8fde\u7eed(\\(G^1\\))\uff0c\u800c\u4e14\u8fd8\u8981\u6c42\u66f2\u7387\u8fde\u7eed\u3002\u56e0\u6b64\uff0c\u6c42\u5bfc\u662fbezier\u66f2\u7ebf\u7684\u4e00\u9879\u57fa\u672c\u800c\u4e14\u91cd\u8981\u7684\u529f\u80fd\u3002<!--more--><\/p>\n<p><strong>1.\u5bfc\u6570\u516c\u5f0f\u7684\u63a8\u5bfc<\/strong><\/p>\n<p>bezier\u66f2\u7ebf\u7684\u77e9\u9635\u5f62\u5f0f\u5982\u4e0b\uff1a$$C(u) = \\begin{bmatrix}B_0&amp;B_1&amp; \\cdots &amp; B_n\\end{bmatrix}\\begin{bmatrix}P_0\\\\P_1\\\\ \\cdots \\\\ P_n\\end{bmatrix}$$\u56e0\u4e3a\u53c2\u6570\u53ea\u5b58\u5728\u4e8e\u77e9\u9635\u5de6\u8fb9\u90e8\u5206\uff0c\u56e0\u6b64\u5206\u522b\u5bf9\u57fa\u51fd\u6570\u6c42\u5bfc\u5373\u53ef\u3002\u6309\u7167\u57fa\u51fd\u6570\u7684\u5b9a\u4e49\u5f62\u5f0f\uff0c\u5bf9\u53c2\u6570u\u6c42\u5bfc\uff0c\u5e76\u4e14\u5c06\u7ed3\u679c\u91cd\u7ec4\uff0c\u53ef\u4ee5\u5f97\u5230\u5982\u4e0b\u5f62\u5f0f\uff1a$$B_{n,i}^\\prime(u) = n(B_{n-1,i-1}(u) &#8211; B_{n-1,i}(u))$$ \u5f53i=0\u65f6\uff0c\\(B_{n-1,i-1}(u)=0\\)\u00a0 \u4e3a\u4e86\u8868\u8fbe\u7b80\u4fbf\uff0c\u4ee4\\(b_i = B_{n-1,i}(u)\\) $$ C^\\prime(u) = n \\begin{bmatrix} b_0&amp; \\cdots\u00a0&amp; b_{n-1} \\end{bmatrix} \\begin{bmatrix} P_1 \\\\ \\cdots \\\\ P_{n}\u00a0 \\end{bmatrix} +\u00a0 n\\begin{bmatrix} b_0&amp; \\cdots\u00a0 &amp; b_{n-1} \\end{bmatrix} \\begin{bmatrix} -P_0 \\\\ \\cdots\u00a0 \\\\ -P_{n-1} \\end{bmatrix} =\\\\ n\\begin{bmatrix} b_0&amp; \\cdots &amp; b_{n-2} &amp; b_{n-1} \\end{bmatrix} \\begin{bmatrix} P_1-P_0 \\\\ \\cdots \\\\ P_n-P_{n-1}\u00a0 \\end{bmatrix} =\u00a0 n \\sum_{i=0}^nB_{n-1,i}(u)(P_{i+1}-P_i)$$\u5171n-1\u9879\u3002\u53ef\u89c1\uff0cn\u9636bezier\u66f2\u7ebf\u7684\u5bfc\u6570\u662f\u7531n-1\u9636bezier\u66f2\u7ebf\u5f97\u5230\u7684\u3002\u5bf9\u5e94n\u9636\u66f2\u7ebf\u4e0au\u7684\u5207\u77e2\u91cf\u4e3an-1\u9636\u66f2\u7ebf\u4e0a\u7684u\u70b9\u7684\u503c\u3002\u800c\u8fd9\u4e2a\u5bfc\u6570\u6784\u6210\u7684\u66f2\u7ebf\u7684\u63a7\u5236\u70b9\u5e8f\u5217\u4e3a$$Q_i = n(P_{i+1}-P_i) ; i \\in [0,n-1]$$<\/p>\n<p><strong>2.\u5bfc\u6570\u7684\u8ba1\u7b97<\/strong><\/p>\n<p>\u5df2\u77e5n\u9636bezier\u66f2\u7ebf\u7684\u5bfc\u6570\u662fn-1\u9636bezier\u66f2\u7ebf \\(C^{\\prime}(u) =sum_{i=0}^nB_{n-1,i}(u)Q_i \\)\uff0c\u56e0\u6b64bezier\u66f2\u7ebf\u7684\u6c42\u5bfc\u53ef\u4ee5\u8f6c\u6362\u4e3a\u5bf9\u4f4e\u9636\u66f2\u7ebf\u7684\u6c42\u503c\u64cd\u4f5c\uff0c\u53ef\u7528<a href=\"http:\/\/www.whudj.cn\/?p=407\">\u5fb7\u5361\u65af\u7279\u91cc\u5965(De Casteljau\u2019s)\u7b97\u6cd5<\/a>\u8ba1\u7b97\u3002<\/p>\n<p><strong>3.bezier\u9996\u5c3e\u70b9\u7684\u5bfc\u6570<\/strong><\/p>\n<p>\u5728bezier\u66f2\u7ebf\u7684\u5b9a\u4e49\u4e2d\u6211\u4eec\u63a8\u5bfc\u8fc7\uff0cbezier\u66f2\u7ebf\u7684\u9996\u5c3e\u70b9\u4e0e\u5176\u9996\u4e2a\uff0c\u672b\u5c3e\u63a7\u5236\u70b9\u91cd\u5408\u3002\u56e0\u4e3abezier\u66f2\u7ebf\u7684\u5bfc\u6570\u4e5f\u5f62\u6210bezier\u66f2\u7ebf\uff0c\u56e0\u6b64\u5728u=0\u65f6\u7684\u5bfc\u6570\u4e3a\\(n(P_1-P_0)\\)\uff0c\u5728u=1\u65f6\u7684\u5bfc\u6570\u4e3a\\(n(P_{n}-P_{n-1})\\)\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u66f2\u7ebf\u5728\u9996\u5c3e\u5904\u7684\u5207\u7ebf\u4e0e\u5176\u9996\u4e2a\u3001\u672b\u5c3e\u5904\u7684\u63a7\u5236\u70b9\u7684\u65b9\u5411\u662f\u4e00\u81f4\u7684\uff01\u8fd9\u662f\u4e00\u4e2a\u975e\u5e38\u68d2\u7684\u6027\u8d28\uff0c\u4f7f\u5f97bezier\u66f2\u7ebf\u7684\u4fee\u578b\u66f4\u7b80\u5355\u4e86\uff0c\u65e0\u602a\u4e4e\u5f97\u5230\u4e86\u8bbe\u8ba1\u4eba\u5458\u7684\u9752\u7750\u3002\u4e0b\u56fe\u53ef\u4ee5\u770b\u5230\u8fd9\u79cd\u73b0\u8c61\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-433\" src=\"http:\/\/www.whudj.cn\/wp-content\/uploads\/2017\/12\/b-curve-1.jpg\" alt=\"\" width=\"234\" height=\"171\" \/><\/p>\n<p><strong>4.\u8fde\u63a5\u4e24\u6839bezier\u66f2\u7ebf\u5e76\u4fdd\u8bc1\u65b9\u5411\u4e00\u81f4<\/strong><\/p>\n<p>\u5f53\u56fe\u50cf\u7531\u591a\u4e2abezier\u66f2\u7ebf\u6784\u6210\uff0c\u5e76\u4e14\u8981\u6c42\u66f2\u7ebf\u63a5\u5934\u7684\u65f6\u5019\u65b9\u5411\u8fde\u7eed\uff08\\(C^1\\)\uff09\u3002\u6bd4\u5982\uff0c\u8981\u6c42m\u9636bezier\u66f2\u7ebf(\\(P_0,\\cdots,P_m\\))\u4e0en\u9636bezier\u66f2\u7ebf(\\(Q_0,&#8230;,Q_n\\))\u5728\\(P_m\\)\u4e0e\\(Q_0\\)\u8fde\u7eed\uff0c\u9996\u5148\u8981\u6c42\\(Q_0=P_m\\),\u7136\u540e \u5bfc\u6570\u76f8\u7b49 \\(m(P_m-P_{m-1}) = n(Q_1-Q_0)\\)\u3002\u8fd9\u8bf4\u660e\u4e09\u70b9\u5171\u7ebf\uff0c\u5e76\u4e14\u6ee1\u8db3\u4e00\u5b9a\u7684\u6a21\u957f\u5173\u7cfb\u8fbe\u5230\\(C^1\\)\u3002\u5982\u4e0b\u56fe\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-434\" src=\"http:\/\/www.whudj.cn\/wp-content\/uploads\/2017\/12\/join-rel.jpg\" alt=\"\" width=\"275\" height=\"54\" \/><\/p>\n<p>\u5f53\u4e09\u8005\u4ec5\u5171\u7ebf\u65f6\uff0c\u66f2\u7ebf\u6ee1\u8db3\\(G^1\\)\u3002\\(C^1\\)\u4e0e\\(G^1\\)\u7684\u533a\u522b\u53ef\u4ee5\u6253\u4e2a\u6bd4\u65b9\uff0c\u5047\u5982\u66f2\u7ebf\u4e3a\u4e24\u6bb5\u516c\u8def\uff0c\\(C^1\\)\u66f2\u7ebf\u53ef\u4ee5\u4fdd\u8bc1\u65b9\u5411\u548c\u901f\u5ea6\u8fde\u7eed\u53d8\u5316\uff0c\u4f46\u662f\\(G^1\\)\u66f2\u7ebf\u53ea\u80fd\u4fdd\u8bc1\u65b9\u5411\u8fde\u7eed\u3002<\/p>\n<p>\u5f53m=n\u65f6\uff0c\u5f53\u4e14\u4ec5\u5f53\\(P_{m-1}P_m\\)\u4e0e\\(P_mQ_1\\)\u7684\u957f\u5ea6\u4e00\u6837\u5e76\u4e14\u4e09\u8005\u5171\u7ebf\u65f6\uff0c\u66f2\u7ebf\u4fdd\u8bc1\\(C^1\\)\u8fde\u7eed\u3002\u6211\u7528coreldraw\u5b66\u4e60\u505a\u5730\u56fe\u65f6\uff0c\u611f\u89c9coreldraw\u7684bezier\u66f2\u7ebf\u7684\u5de5\u5177\u975e\u5e38\u597d\u7528\u3002\u5b83\u7528\u4e00\u4e2a\u7b49\u957f\u5ea6\u7684\u624b\u67c4\u4fdd\u8bc1bezier\u63a5\u5934\u5904\u65b9\u5411\u8fde\u7eed\u3002\u5982\u4e0b\u56fe\u4e2d\u7684\u865a\u7ebf\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-435\" src=\"http:\/\/www.whudj.cn\/wp-content\/uploads\/2017\/12\/coreldraw_bezier.png\" alt=\"\" width=\"245\" height=\"163\" \/><\/p>\n<p>\u624b\u67c4\u7684\u7aef\u70b9\u5373\u4e3a\u63a7\u5236\u70b9\u3002\u9ed8\u8ba4\u63a5\u8fb9\u65f6\uff0c\u8c03\u8282\u9f20\u6807\u6240\u5728\u7aef\u70b9\u65f6\uff0c\u5176\u5bf9\u79f0\u7684\u63a7\u5236\u70b9\u4e5f\u4f1a\u76f8\u5e94\u79fb\u52a8\u4fdd\u8bc1\u65b9\u5411\u8fde\u7eed\u3002\u5176\u4e2d\u7684\u6570\u5b66\u539f\u7406\u4f30\u8ba1\u5f88\u591a\u8bbe\u8ba1\u4eba\u5458\u662f\u4e0d\u4e86\u89e3\u7684\uff0c\u4f46\u662f\u4e1d\u6beb\u4e0d\u5f71\u54cdcoreldraw\u6210\u4e3a\u975e\u5e38\u6613\u7528\u7684\u5de5\u5177\uff0c\u8fd9\u5c31\u662f\u597d\u7684\u4ea7\u54c1\u7684\u7279\u70b9\u3002<\/p>\n<p><strong>5.\u9ad8\u9636\u5bfc\u6570<\/strong><\/p>\n<p>\u53c2\u6570\u66f2\u7ebf\u7684m\u9636\u5bfc\u6570\u7684\u9012\u63a8\u516c\u5f0f\u4e3am-1\u9636\u5bfc\u6570\u66f2\u7ebf\u7684\u4e00\u9636\u5bfc\u6570\u3002$$f^{(m)}(u)=\\frac{d}{du}f^{(m-1)(u)}$$\u4ee5bezier\u7684\u4e8c\u9636\u5bfc\u6570\u4e3a\u4f8b\uff0c$$C^{\\prime\\prime} = \\sum_{i=0}^{n-2}B_{n-2,i}(u)\\{(n-1)(Q_{i+1}-Q_i)\\} \\\\ =(n)(n-1)\\sum_{i=0}^{n-2}B_{n-2,i}(u)\\{P_{i+2}-2P_{i+1}-P_i\\}$$<\/p>\n<p>\u4ee5\u6b64\u7c7b\u63a8\u3002<\/p>\n<p><strong>6.bezier\u66f2\u7ebf\u7684\u6253\u65ad<\/strong><\/p>\n<p>\u6240\u8c13\u6253\u65adbezier\u66f2\u7ebf\uff0c\u662f\u6307\u5728\u7ed9\u5b9a\u53c2\u6570u\u5904\uff0c\u5c06\u539fbezier\u66f2\u7ebf\u5206\u6210\u4e24\u6bb5\uff0c\u5176\u5f62\u72b6\u4fdd\u6301\u4e0d\u53d8\uff0c\u9636\u6b21\u4fdd\u6301\u4e0d\u53d8\uff0c\u6253\u65ad\u540e\u7684\u4e24\u6bb5\u4ecd\u7136\u662fbezier\u66f2\u7ebf\u3002\u4f46\u662f\uff0c\u6bcf\u4e00\u6bb5\u66f2\u7ebf\u6709\u81ea\u5df1\u65b0\u7684\u63a7\u5236\u70b9\u5e8f\u5217\u4e0e\u53c2\u6570\u533a\u95f4\uff0c\u539f\u6765\u7684\\(u\\in[0,1]\\)\u5206\u88c2\u4e3a\u72ec\u7acb\u7684\\(t\\in[0,1];r\\in[0,1]\\)\u3002<\/p>\n<p><a href=\"http:\/\/www.whudj.cn\/?p=407\">\u5fb7\u5361\u65af\u7279\u91cc\u5965(De Casteljau\u2019s)\u7b97\u6cd5<\/a>\u00a0 \u53ef\u4ee5\u7528\u6765\u5b8c\u6210\u65b0\u63a7\u5236\u70b9\u7684\u8ba1\u7b97\uff0c\u56de\u60f3\u4e00\u4e0b\uff0cdeCasteljau\u65b9\u6cd5\u8fdb\u884c\u5bf9\u539f\u59cb\u63a7\u5236\u70b9\u8fdb\u884cn\u6b21\u201c\u5207\u89d2\u201d\u8fd0\u7b97\uff0c\u6700\u540e\u4e00\u6b21\u5207\u89d2\u7684\u7ed3\u679c\u5c31\u662f\u5bf9\u5e94u\u7684\u70b9\u3002\u5176\u5b9e\uff0c\u6bcf\u4e2a\u8fed\u4ee3\u5f62\u6210\u7684\u65b0\u7684\u70b9\u5217\u7684\u9996\u70b9\u4e0e\u5c3e\u70b9\uff0c\u5206\u522b\u6784\u6210\u4e86\u5728u\u5904\u6253\u65ad\u7684\u4e24\u6761beizier\u66f2\u7ebf\u7684\u65b0\u63a7\u5236\u70b9\u5e8f\u5217\u3002\u5982\u4e0b\u56fe\u793a\uff0c\u9ed1\u8272\u7ebf\u662f\u5de6\u4fa7bezier\u66f2\u7ebf\u7684\u65b0\u63a7\u5236\u70b9\uff0c\u7ea2\u8272\u7ebf\u662f\u53f3\u4fa7bezier\u7684\u65b0\u63a7\u5236\u70b9\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-440 size-full\" src=\"http:\/\/www.whudj.cn\/wp-content\/uploads\/2017\/12\/b-sub-left.jpg\" alt=\"\" width=\"555\" height=\"229\" \/><\/p>\n<p>\u6211\u7684\u7b97\u6cd5\u5b9e\u73b0\u5982\u4e0b\uff1a<\/p>\n<pre class=\"lang:c++ decode:true\">\/*!\r\n *\\brief Bezier\u66f2\u7ebf\u7684\u6253\u65ad\r\n*\\ param const std::vector&lt;Point&gt; &amp; control_vertex \u63a7\u5236\u70b9\u5e8f\u5217\r\n*\\ param double u \u6253\u65ad\u5904\u7684\u53c2\u6570 (0,1)\r\n*\\ param std::vector&lt;Point&gt; &amp; cv_left \u6253\u65ad\u540e\u524d\u534a\u90e8\u5206\u7684\u63a7\u5236\u70b9\r\n*\\ param std::vector&lt;Point&gt; &amp; cv_right \u6253\u65ad\u540e\u540e\u534a\u90e8\u5206\u7684\u63a7\u5236\u70b9\r\n*\\ Returns:   void\r\n*\/\r\nvoid Bezier::Subdividing(const std::vector&lt;Point&gt;&amp; control_vertex, double u,std::vector&lt;Point&gt;&amp; cv_left,std::vector&lt;Point&gt;&amp; cv_right)\r\n{\r\n\tcv_left.resize(control_vertex.size());\r\n\tcv_right.resize(control_vertex.size());\r\n\r\n\tint p = control_vertex.size()-1;\r\n\t\/\/\u5c06 cv \u62f7\u8d1d\u5230 cv_right,\u56e0\u4e3a\u6bcf\u6b21\u8fed\u4ee3\u8ba1\u7b97\u7684\u70b9\u6570\u4f9d\u6b21\u5c111\uff0c\r\n\t\/\/\u56e0\u6b64\u53ef\u4ee5\u76f4\u63a5\u7528cv_right\u8bb0\u5f55\uff0c\u5168\u90e8\u7b97\u5b8c\u540e\u5c31\u662f\u6240\u6709\u7684\u5c3e\u70b9\u96c6\u5408\r\n\tstd::copy(control_vertex.begin(), control_vertex.end(), cv_right.begin());\r\n\tcv_left[0] = cv_right[0];\r\n\r\n\t\/\/p\u6b21\u8fed\u4ee3\r\n\tfor (int i = 0;i&lt;p;++i)\r\n\t{\r\n\t\tfor (int j = 0;j&lt;p - i;++j)\r\n\t\t\tcv_right[j] = (1.0 - u)*cv_right[j] + u*cv_right[j + 1];\r\n\t\t\/\/\u5de6\u4fa7\u63a7\u5236\u70b9\u4e3a\u6bcf\u6b21\u8fed\u4ee3\u7684\u9996\u70b9\r\n\t\tcv_left[i + 1] = cv_right[0];\r\n\t}\r\n}<\/pre>\n<p>\u4e0b\u56fe\u662f\u4e0a\u8ff0\u7a0b\u5e8f\u5bf9bezier\u66f2\u7ebf\u5728\\(u=0.4\\)\u6253\u65ad\u540e\u7684\u6548\u679c \u5199\u5165dwg\u5728AutoCAD\u4e2d\u7684\u5c55\u73b0\u30021\u4e3a\u539f\u59cbbezier\u66f2\u7ebf\uff0c2,3\u4e3a\u6253\u65ad\u540ebezier\u66f2\u7ebf\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-602\" src=\"http:\/\/www.whudj.cn\/wp-content\/uploads\/2017\/12\/bezier_subdividing_autocad.png\" alt=\"\" width=\"600\" height=\"253\" \/><\/p>\n<hr \/>\n<p>\u672c\u8282\u53c2\u8003 <a href=\"http:\/\/pages.mtu.edu\/~shene\/COURSES\/cs3621\/NOTES\/\">Introduction to Computing with Geometry<\/a>\u00a0\u7b2c\u4e94\uff0c\u516d\u8282<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e1a\u52a1\u4e2d\u4f7f\u7528\u66f2\u7ebf\u7684\u76ee\u7684\uff0c\u4e3b\u8981\u662f\u56e0\u4e3a\u66f2\u7ebf\u5177\u6709\u9ad8\u9636\u5bfc\u6570\u8fde\u7eed\u7684\u7279\u70b9\u3002\u6bd4\u5982\u8bbe\u8ba1\u516c\u8def\uff0c\u4e0d\u4ec5\u8981 &hellip; <a href=\"http:\/\/www.whudj.cn\/?p=419\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"_links":{"self":[{"href":"http:\/\/www.whudj.cn\/index.php?rest_route=\/wp\/v2\/posts\/419"}],"collection":[{"href":"http:\/\/www.whudj.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.whudj.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.whudj.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.whudj.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=419"}],"version-history":[{"count":23,"href":"http:\/\/www.whudj.cn\/index.php?rest_route=\/wp\/v2\/posts\/419\/revisions"}],"predecessor-version":[{"id":603,"href":"http:\/\/www.whudj.cn\/index.php?rest_route=\/wp\/v2\/posts\/419\/revisions\/603"}],"wp:attachment":[{"href":"http:\/\/www.whudj.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.whudj.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=419"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.whudj.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}