{"id":445,"date":"2017-12-02T22:16:58","date_gmt":"2017-12-02T14:16:58","guid":{"rendered":"http:\/\/www.whudj.cn\/?p=445"},"modified":"2017-12-19T13:23:12","modified_gmt":"2017-12-19T05:23:12","slug":"bezier%e6%9b%b2%e7%ba%bf%ef%bc%88%e5%9b%9b%ef%bc%89-%e6%9b%b2%e7%ba%bf%e5%8d%87%e9%98%b6degree-elevation","status":"publish","type":"post","link":"http:\/\/www.whudj.cn\/?p=445","title":{"rendered":"Bezier\u66f2\u7ebf\uff08\u56db\uff09: \u66f2\u7ebf\u5347\u9636(degree elevation)"},"content":{"rendered":"<p>\u56e0\u4e3an\u9636bezier\u66f2\u7ebf\u7684\u63a7\u5236\u70b9\u4e2a\u6570\u4e3a\u56fa\u5b9a\u7684n+1\u4e2a\uff0c\u5982\u679c\u9700\u8981\u901a\u8fc7\u589e\u52a0\u63a7\u5236\u70b9\u4e2a\u6570\u8fbe\u5230\u66f4\u7075\u6d3b\u63a7\u5236bezier\u66f2\u7ebf\u7684\u76ee\u7684\uff0c\u90a3\u4e48\u9700\u8981\u5c06bezier\u66f2\u7ebf\u7684\u9636\u6570\u589e\u52a0\uff0c\u540c\u65f6\u4fdd\u6301\u66f2\u7ebf\u7684\u5f62\u72b6\u4e0d\u53d1\u751f\u53d8\u5316\u3002<!--more--><\/p>\n<p>\u5047\u8bben\u9636bezier\u66f2\u7ebf\u7684\u63a7\u5236\u70b9\u5e8f\u5217\u5206\u522b\u4e3a\\(P_0,P_1,&#8230;,P_n\\)\u5171n+1\u4e2a\uff0c\u5982\u679c\u8981\u5c06\u66f2\u7ebf\u5347\u9636\u5230n+1\u9636\uff0c\u5219\u8981\u4ea7\u751fn+2\u4e2a\u63a7\u5236\u70b9\u3002\u56e0\u4e3a\u66f2\u7ebf\u7684\u5f62\u72b6\u4e0d\u53d8\uff0cn+2\u4e2a\u70b9\u7684\u9996\u70b9\uff0c\u5c3e\u70b9\u4ecd\u7136\u662f\\(P_0,P_n\\)\u3002\u5047\u8bbe\u65b0\u7684\u63a7\u5236\u70b9\u5e8f\u5217\u4e3a\\(Q_0,Q_1,&#8230;,Q_n,Q_{n+1}\\)\uff0c\u90a3\u4e48\\(Q_0=P_0;Q_{n+1}=P_n\\)\u4f59\u4e0bn\u4e2a\u70b9\u7684\u8ba1\u7b97\u516c\u5f0f\u662f\uff1a$$Q_i=\\frac{i}{n+1}P_{i-1}+(1-\\frac{i}{n+1})P_i; i \\in [1,n]$$<\/p>\n<p>\u89c2\u5bdf\u8fd9\u4e2a\u516c\u5f0f\uff0c\u53ef\u4ee5\u770b\u51fa \\(Q_i\\)\u662f\u7ebf\u6bb5\\(P_{i-1}P_i\\)\u4e0a\u7684\u4e00\u70b9\uff0c\u5e76\u4e14\u5c06\u7ebf\u6bb5\u5206\u4e3a\\(\\frac{i}{n+1}:(1-\\frac{i}{n+1})\\)\u4e24\u90e8\u5206\u3002\u8fd9\u4e2a\u65b9\u6cd5\u4e0e\u5fb7\u5361\u65af\u7279\u91cc\u5965(De Casteljau\u2019s)\u7b97\u6cd5\u975e\u5e38\u76f8\u8fd1\uff0c\u90fd\u662f\u5bf9\u539f\u59cb\u63a7\u5236\u70b9\u8fdb\u884c\u201c\u5207\u89d2\u201d\u3002\u4e0d\u8fc7\uff0c\u5fb7\u6c0f\u7b97\u6cd5\u6bcf\u6b21\u5207\u89d2\u90fd\u6309\u7167\u56fa\u5b9a\u7684\u6bd4\u4f8bu\u5207\u5272\uff0c\u5347\u9636\u7b97\u6cd5\u7684\u6bd4\u4f8b\u5374\u662f\u4e0ei\u76f8\u5173\u7684\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-446 aligncenter\" src=\"http:\/\/www.whudj.cn\/wp-content\/uploads\/2017\/12\/bezier-cut-corner.jpg\" alt=\"\" width=\"221\" height=\"162\" \/><\/p>\n<p>\u5982\u4e0a\u56fe\uff0c\u4e3a\u56db\u9636bezier\u66f2\u7ebf\u5347\u9636\u52305\u9636\u540e\u7684\u6548\u679c\u3002\u7ea2\u8272\u70b9\u4e3a\u539f\u59cb\u70b9\uff0c\u84dd\u8272\u70b9\u4e3a\u5347\u9636\u540e\u7684\u65b0\u63a7\u5236\u70b9\uff0c\u53ef\u89c1\u65b0\u63a7\u5236\u70b9\u4e3a\u5bf9\u539f\u59cb\u63a7\u5236\u70b9\u8fdb\u884c\u5b9a\u6bd4\u5206\u70b9\u540e\u751f\u6210\u7684\u3002\u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c\u901a\u8fc7\u201c\u5207\u89d2\u201d\u8fd0\u7b97\uff0c\u65b0\u7684\u63a7\u5236\u70b9\u603b\u662f\u79bbbezier\u66f2\u7ebf\u66f4\u8fd1\u3002<\/p>\n<p>\u4e0b\u9762\u7ed9\u51fa\u8ba1\u7b97\u5347\u9636\u540e\u7684\u65b0\u63a7\u5236\u70b9\u7684\u7a0b\u5e8f<\/p>\n<pre class=\"lang:c++ decode:true\">\/*!\r\n*\\brief bezier\u66f2\u7ebf\u5347\u9636\r\n*\\ param const std::vector&lt;Point&gt; &amp; control_vertex \u539f\u59cb\u63a7\u5236\u70b9\r\n*\\ param std::vector&lt;Point&gt; &amp; new_control_vertex \u5347\u9636\u540e\u7684\u63a7\u5236\u70b9\r\n*\\ Returns:   void\r\n*\/\r\nvoid Bezier::DegreeElevation(const std::vector&lt;Point&gt;&amp; control_vertex,std::vector&lt;Point&gt;&amp; new_control_vertex)\r\n{\r\n\tint n = control_vertex.size();\r\n\tnew_control_vertex.resize(n+1);\r\n\r\n\tnew_control_vertex.front() = control_vertex.front();\r\n\tnew_control_vertex.back() = control_vertex.back();\r\n\r\n\tfor (int i=1;i&lt;n;++i)\r\n\t{\r\n\t\tdouble ratio = ((double)i)\/n;\r\n\t\tnew_control_vertex[i] = ratio*control_vertex[i-1] + (1.0-ratio)*control_vertex[i];\r\n\t}\r\n}<\/pre>\n<p>\u4e0b\u56fe\u662f3\u9636Bezier\u66f2\u7ebf\u5347\u9636\u52304\u9636\u540e\u5728AutoCAD\u4e2d\u7684\u5c55\u73b0\u3002\u53ef\u4ee5\u770b\u89c1\uff0c\u9664\u4e86\u9996\u5c3e\u63a7\u5236\u70b9\u5916\uff0c\u65b0\u66f2\u7ebf\u7684\u63a7\u5236\u70b9\u5747\u5728\u539f\u59cb\u66f2\u7ebf\u7684\u63a7\u5236\u591a\u8fb9\u5f62\u4e0a\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-604\" src=\"http:\/\/www.whudj.cn\/wp-content\/uploads\/2017\/12\/bezier_degree_elevation_autocad.png\" alt=\"\" width=\"600\" height=\"246\" \/><\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p>\u672c\u6587\u53c2\u8003<a href=\"http:\/\/pages.mtu.edu\/~shene\/COURSES\/cs3621\/NOTES\/\">Introduction to Computing with Geometry<\/a> \u7b2c\u4e94\u7ae0\u7b2c\u4e03\u8282\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u56e0\u4e3an\u9636bezier\u66f2\u7ebf\u7684\u63a7\u5236\u70b9\u4e2a\u6570\u4e3a\u56fa\u5b9a\u7684n+1\u4e2a\uff0c\u5982\u679c\u9700\u8981\u901a\u8fc7\u589e\u52a0\u63a7\u5236\u70b9\u4e2a\u6570 &hellip; <a href=\"http:\/\/www.whudj.cn\/?p=445\">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\/445"}],"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=445"}],"version-history":[{"count":6,"href":"http:\/\/www.whudj.cn\/index.php?rest_route=\/wp\/v2\/posts\/445\/revisions"}],"predecessor-version":[{"id":605,"href":"http:\/\/www.whudj.cn\/index.php?rest_route=\/wp\/v2\/posts\/445\/revisions\/605"}],"wp:attachment":[{"href":"http:\/\/www.whudj.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.whudj.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=445"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.whudj.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}