{"id":623,"date":"2017-12-21T22:44:01","date_gmt":"2017-12-21T14:44:01","guid":{"rendered":"http:\/\/www.whudj.cn\/?p=623"},"modified":"2017-12-21T22:44:41","modified_gmt":"2017-12-21T14:44:41","slug":"b-spline%e5%8d%81%e6%a0%b7%e6%9d%a1%e6%9b%b2%e7%ba%bf%e6%8b%9f%e5%90%88-%e6%8f%92%e5%80%bcinterpolation","status":"publish","type":"post","link":"http:\/\/www.whudj.cn\/?p=623","title":{"rendered":"B-Spline(\u5341):\u6837\u6761\u66f2\u7ebf\u62df\u5408-\u63d2\u503c(Interpolation)"},"content":{"rendered":"<p>\u63d2\u503c\u662f\u6307\uff1a\u5df2\u77e5\u5f62\u72b6\u70b9(Fit Point),\u6c42\u4e00\u6761\u6837\u6761\u66f2\u7ebf\u7a7f\u8fc7\u6240\u6709\u7684\u5f62\u72b6\u70b9\u3002\u63d2\u503c\u662fB\u6837\u6761\u4e43\u81f3CAGD\u5e94\u7528\u4e2d\u6700\u5e38\u89c1\u7684\u5e94\u7528\u4e4b\u4e00\u3002\u672c\u8282\uff0c\u6211\u5c06\u5206\u4eab\u4e00\u79cd\u6837\u6761\u66f2\u7ebf\u63d2\u503c\u7b97\u6cd5\u3002<!--more--><\/p>\n<p>\u6211\u4eec\u7684\u6761\u4ef6\u662f\uff0c\u5df2\u77e5\u70b9\u96c6\\(\\{F_0,F_1,&#8230;,F_x\\}\\)\u5171x+1\u4e2a\u70b9\uff0c\u6c42\u6837\u6761\u66f2\u7ebf\\(\\sum N_{i,p}P_i\\)\u901a\u8fc7\u4e0a\u8ff0\u6240\u6709\u70b9\\(F_i\\)\u3002\u56de\u987eB\u6837\u6761\u7684\u5b9a\u4e49\uff0c\u53ef\u4ee5\u5c06\u4e0a\u8ff0\u6761\u4ef6\u8f6c\u6362\u4e3a\u4e0b\u5f0f\uff1a$$\\begin{bmatrix}N_{0}(u_0)&amp;&#8230;&amp;N_{i}(u_0)&amp;&#8230;&amp;N_{p}(u_0)\\\\N_{0}(u_1)&amp;&#8230;&amp;N_{i}(u_1)&amp;&#8230;&amp;N_{p}(u_1)\\\\\\cdots\\\\N_{0}(u_x)&amp;&#8230;&amp;N_{i}(u_x)&amp;&#8230;&amp;N_{p}(u_)\\end{bmatrix}\\begin{bmatrix}P_0\\\\&#8230;\\\\P_i\\\\&#8230;\\\\P_n\\end{bmatrix}=\\begin{bmatrix}F_0\\\\F_1\\\\\\cdots\\\\F_x\\end{bmatrix}$$\u603b\u7ed3\u8d77\u6765\u5c31\u662f\u00a0\\(C(u_i)=F_i\\)\u3002\u90a3\u4e48\uff0c\u9996\u5148\u6211\u4eec\u8981\u505a\u5c31\u662f\u786e\u5b9a\u53c2\u6570\uff0c\u7ed9\\(F_i\\)\u786e\u5b9a\\(u_i\\)\u7684\u8fc7\u7a0b\uff0c\u79f0\u4e4b\u4e3a\u53c2\u6570\u5316(Parameterization)\u3002<\/p>\n<p><strong>1\uff09\u53c2\u6570\u5316<\/strong><\/p>\n<p>\u5e38\u89c1\u7684\u53c2\u6570\u5316\u65b9\u6cd5\u6709\u4e09\u79cd\uff1a\u5f26\u957f\u7d2f\u52a0\u6cd5(chord length),\u5411\u5fc3\u53c2\u6570\u6cd5(\u4e5f\u79f0\u5e73\u65b9\u6839\u6cd5)\uff0c\u7edf\u4e00\u8282\u70b9\u6cd5\u3002\u5176\u4e2d\u524d\u4e24\u79cd\u6700\u4e3a\u5e38\u7528\u3002<\/p>\n<ol>\n<li>\u5f26\u957f\u7d2f\u52a0\u6cd5\uff1a\u6307\u7684\u662f\uff0c\u5f53\u524d\u578b\u503c\u70b9\\(F_i\\)\u7684\u53c2\u6570\uff0c\u7b49\u4e8e\u4e4b\u524d\u6240\u6709\u578b\u503c\u70b9\u957f\u5ea6\u7684\u7d2f\u52a0\\(\\sum_{j=1}^{i}|F_{j-1}F_j|\\)\u3002\u8fd9\u79cd\u65b9\u6cd5\u662f\u201cArc-Length\u201d\u53c2\u6570\u6cd5\u7684\u4e00\u79cd\u8fd1\u4f3c\uff0c\u9009\u7528\u5f26\u957f\u4ee3\u66ff\u5f27\u957f\uff0c\u56e0\u6b64\u5177\u6709\u6bd4\u8f83\u597d\u7684\u6548\u679c\u3002<\/li>\n<li>\u5411\u5fc3\u53c2\u6570\u6cd5\uff1a\u8fd9\u4e2a\u65b9\u6cd5\u7531\u6ce2\u97f3\u516c\u53f8\u7684\u6280\u672f\u4eba\u5458\u63d0\u51fa\u3002\u6307\u7684\u662f\u5f53\u524d\u578b\u503c\u70b9\u7684\u53c2\u6570\u662f\u7531\u4e4b\u524d\u6240\u6709\u578b\u503c\u70b9\u957f\u5ea6\u7684\u5e73\u65b9\u6839\u7d2f\u52a0\u7684\u503c\\(\\sum_{j=1}^{i}\\sqrt{|F_{j-1}F_j|}\\)\uff0c\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u8fd9\u4e2a\u65b9\u6cd5\u7684\u6548\u679c\u8981\u597d\u4e8e\u5f26\u957f\u7d2f\u52a0\u6cd5\uff0c\u5c24\u5176\u662f\u5728\u8282\u70b9\u5206\u5e03\u4e0d\u5747\u5300\u7684\u60c5\u51b5\u4e0b\u3002<\/li>\n<li>\u7edf\u4e00\u8282\u70b9\u6cd5\uff1a\u987e\u540d\u601d\u4e49\uff0c\u6bcf\u4e2a\u8282\u70b9\u7684\u95f4\u9694\u90fd\u662f\u76f8\u7b49\u7684\u3002\u8fd9\u79cd\u65b9\u6cd5\u4e0d\u600e\u4e48\u5728\u5b9e\u8df5\u4e2d\u83b7\u5f97\u5e94\u7528\u3002<\/li>\n<\/ol>\n<p>\u5728AutoCAD\u4e2d\uff0c\u7ed8\u5236\u6837\u6761\u7ebf(\u8f93\u5165SPLINE\u547d\u4ee4)\uff0c\u53ef\u4ee5\u9009\u62e9\u7684\u8282\u70b9\u53c2\u6570\u5316\u7c7b\u578b\u4e3a\u4e0a\u8ff0\u4e09\u79cd\uff0c\u9ed8\u8ba4\u7684\u662f\u5f26\u957f\u7d2f\u52a0\u6cd5\u3002<\/p>\n<div id=\"attachment_640\" style=\"width: 396px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-640\" class=\"wp-image-640 size-full\" src=\"http:\/\/www.whudj.cn\/wp-content\/uploads\/2017\/12\/parameterization_autocad.png\" alt=\"\" width=\"386\" height=\"200\" \/><p id=\"caption-attachment-640\" class=\"wp-caption-text\">autocad \u8282\u70b9\u53c2\u6570\u5316<\/p><\/div>\n<p>\u672c\u8282\u4e2d\uff0c\u6211\u4f7f\u7528\u7684\u7b97\u6cd5\u662f\u7d2f\u52a0\u5f26\u957f\u6cd5\uff0c\u5f53\u7136\uff0c\u4f60\u4e5f\u53ef\u4ee5\u66ff\u6362\u6210\u5176\u4ed6\u4efb\u610f\u7684\u53c2\u6570\u5316\u65b9\u6cd5\u3002\u53c2\u6570\u7684\u95ee\u9898\u641e\u5b9a\u4e86\uff0c\u9700\u8981\u8003\u8651\u7684\u7b2c\u4e8c\u4e2a\u95ee\u9898\u5c31\u662f\uff0c\u6211\u4eec\u9009\u62e9\u63d2\u503c\u7684\u6837\u6761\u66f2\u7ebf\u7684\u9636\u6b21\u3002<\/p>\n<p><strong>2)\u9009\u62e9\u9636\u6b21<\/strong><\/p>\n<p>B-Spline\u7684\u4e09\u4e2a\u8981\u7d20\u662f \u8282\u70b9(\u5e8f\u5217)\u3001\u9636\u6b21\u3001\u63a7\u5236\u70b9\u3002\u9636\u6b21\u7531\u6211\u4eec\u786e\u5b9a\u3002<a href=\"http:\/\/www.whudj.cn\/?p=493\">\u6837\u6761\u66f2\u7ebf\u7684\u6027\u8d28<\/a>\u662fn\u9636B\u6837\u6761\u5728\u8282\u70b9\u5904\u6709n-1\u9636\u8fde\u7eed\u6027\uff0c\u4e00\u822c\u5de5\u4e1a\u4e0a\u5e38\u7528\u7684\u8fde\u7eed\u6027\u5230\\(C^2\\)\uff0c\u6240\u4ee5\u5e38\u7528\u7684\u66f2\u7ebf\u662f3\u9636(cubic)\u66f2\u7ebf\u3002AutoCAD\u9ed8\u8ba4\u7684\u6837\u6761\u66f2\u7ebf\u9636\u6b21\u4e5f\u662f\u4e09\u9636\u3002\u6211\u4e5f\u9009\u62e9p=3\u9636\u3002\u66f2\u7ebf\u7684\u9636\u6b21\u786e\u5b9a\u4e86\uff0c\u8282\u70b9\u786e\u5b9a\u4e86\uff0c\u5c31\u53ef\u4ee5\u63a8\u51fa\u66f2\u7ebf\u7684\u8282\u70b9\u5e8f\u5217(knot vector)\u662f(\u6211\u4eec\u8981\u63d2\u503c\u7684\u662f\u201cclamped b spline\u201d):$$\\{0,0,0,0,u_1,\\cdots,u_i,\\cdots,u_x,u_x,u_x,u_x\\}$$\u800c\u4e14\uff0c\u6211\u4eec\u53ef\u4ee5\u7ed9\u51fa\u6bcf\u4e2a\u8282\u70b9\u5bf9\u5e94\u7684\u57fa\u51fd\u6570\u7684\u503c\u3002\u56e0\u6b64\uff0c\u6700\u5f00\u59cb\u7684\u77e9\u9635\u7684\u5de6\u8fb9\u5c31\u89e3\u51b3\u4e86\u3002\u90a3\u4e48\uff0c\u5de6\u8fb9\u7684\u77e9\u9635N\u5df2\u77e5\uff0c\u53f3\u8fb9\u7684\u578b\u503c\u70b9F\u5df2\u77e5\uff0c\u662f\u4e0d\u662f\u53ef\u4ee5\u901a\u8fc7\u89e3\u65b9\u7a0b\u4e86\u6c42\u51fa\u6700\u7ec8\u7684\u672a\u77e5\u6570\u63a7\u5236\u70b9\u5411\u91cfP\u4e86\uff1f<\/p>\n<p>\u4e0d\u662f\u7684:(\u3002\u56e0\u4e3a\u4e0a\u9762\u7684\u65b9\u7a0b\u5176\u5b9e\u662f\u4e00\u4e2a\u6b20\u5b9a\u65b9\u7a0b(<a href=\"http:\/\/www.mathwords.com\/u\/underdetermined_system_of_eqns.htm\">underdetermined equation<\/a>)\u3002\u7b80\u5355\u7684\u8bf4\uff0c\u5c31\u662f\u65b9\u7a0b\u7684\u6570\u91cf\u5c0f\u4e8e\u672a\u77e5\u6570\u7684\u6570\u91cf\u3002\u56e0\u4e3a\uff1a\u5728\u6837\u6761\u66f2\u7ebf\u7684\u6027\u8d28\u4e2d\u8282\u70b9\u3001\u9636\u6b21\u3001\u63a7\u5236\u70b9\u7684\u4e2a\u6570\u5173\u7cfb\u662f\\(n=m-p-1\\)\uff0c\u73b0\u5728\u6211\u4eec\u7684\u8282\u70b9\u6570\u662f\uff1ax+1+6=x+7\u4e2a\uff0c\u90a3\u4e48\u53ef\u4ee5\u7b97\u51fa\u5bf9\u5e94\u7684\u63a7\u5236\u70b9\u4e2a\u6570\u662fm-4=x+3\u4e2a\uff0c\u6bd4\u6211\u4eec\u5df2\u77e5\u6761\u4ef6x+1\u4e2a\u578b\u503c\u70b9\u6070\u597d\u591a\u4e86\u4e24\u4e2a\u3002\u6240\u4ee5\u4e0a\u9762\u65b9\u7a0b\u662f\u6ca1\u6709\u552f\u4e00\u89e3\u7684\u3002\u600e\u4e48\u529e\uff1f\u53ef\u4ee5\u901a\u8fc7\u589e\u52a0\u201c\u8fb9\u754c\u6761\u4ef6\u201d\u589e\u52a0\u65b9\u7a0b\u7684\u4e2a\u6570\u3002\u8fd9\u91cc\uff0c\u6211\u4eec\u9700\u8981\u81f3\u5c11\u4e24\u4e2a\u8fb9\u754c\u6761\u4ef6\u3002<\/p>\n<p><strong>3\uff09\u8fb9\u754c\u6761\u4ef6(end conditions)<\/strong><\/p>\n<p>\u9996\u5148\uff0c\u8fb9\u754c\u6761\u4ef6\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u4efb\u610f\u6307\u5b9a\u3002\u5176\u6b21\uff0c\u8fb9\u754c\u6761\u4ef6\u4e0d\u4e00\u5b9a\u53ea\u8981\u4e24\u4e2a\uff0c\u800c\u662f\u81f3\u5c11\u4e24\u4e2a\u3002\u4f46\u662f\u591a\u4e0e\u4e24\u4e2a\u7684\u60c5\u51b5\u4e0b\uff0c\u4f60\u7684\u65b9\u7a0b\u5c06\u53d8\u4e3a\u201c\u8d85\u5b9a\u65b9\u7a0b\u201d\uff0c\u9700\u8981\u91c7\u7528\u7c7b\u4f3c\u6700\u5c0f\u4e8c\u4e58\u6cd5\u7b49\u65b9\u5f0f\u8fdb\u884c\u201c\u6298\u4e2d\u201d\u3002\u4e00\u822c\u6765\u8bf4\uff0c\u6700\u5e38\u7528\u6216\u8005\u8bf4\u6700\u5b9e\u7528\u7684\u8fb9\u754c\u6761\u4ef6\u901a\u5e38\u662f\u4e24\u6761\uff1a\u66f2\u7ebf\u5728\u9996\u5c3e\u70b9\u7684\u5207\u77e2\u91cf\u3002\u6bd4\u5982AutoCAD\u5c31\u662f\u8fd9\u4e48\u89c4\u5b9a\u7684\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-645\" src=\"http:\/\/www.whudj.cn\/wp-content\/uploads\/2017\/12\/boundary_condition_autocad.png\" alt=\"\" width=\"251\" height=\"277\" \/><\/p>\n<p>\u4e3a\u4ec0\u4e48\u5728Auto\u7ed8\u5236\u7684\u65f6\u5019\uff0c\u9ed8\u8ba4\u7684\u5207\u77e2\u91cf\u662f0\u5462(\u5982\u4e0a\u56fe)\uff1f\uff0c\u56e0\u4e3aAutoCAD\u53ef\u4ee5\u6839\u636e\u7528\u6237\u8f93\u5165\u7684\u578b\u503c\u70b9\u63a8\u5bfc\u51fa\u66f2\u7ebf\u7aef\u70b9\u7684\u5207\u77e2\u91cf\uff0c\u56e0\u6b64\uff0c\u5f53\u5207\u77e2\u91cf\u4e0d\u4f5c\u4e3a\u7528\u6237\u8f93\u5165\u65f6\uff0cAutoCAD\u4e0d\u663e\u793a\u5207\u77e2\u91cf\u7684\u503c\u3002\u5e38\u7528\u7684\u5207\u77e2\u91cf\u63a8\u5bfc\u7b97\u6cd5\u662f&#8221;<a href=\"http:\/\/www.whudj.cn\/?p=647\">Bessel Tangents<\/a>&#8220;\u3002\u518d\u7ed3\u5408<a href=\"http:\/\/www.whudj.cn\/?p=533\">B\u6837\u6761\u7684\u6c42\u5bfc<\/a>\uff0c\u53ef\u4ee5\u77e5\u9053\u9996\u5c3e\u5904\u7684\u5bfc\u6570\u4e3a$$ \\left\\{<br \/>\n\\begin{aligned}<br \/>\nC^\\prime(0) &amp; = \\frac{p}{u_{p+1}-u_1}(P_1-P_0); \\\\<br \/>\nC^\\prime(u_x) &amp; = \\frac{p}{u_{p+n}-u_n}(P_n-P_{n-1});(n=x+2)<br \/>\n\\end{aligned}<br \/>\n\\right.<br \/>\n$$\u6539\u6210\u77e9\u9635\u5f62\u5f0f\uff1a$$\\begin{bmatrix}<br \/>\n-1&amp;1&amp;0&amp;\\cdots&amp;0\\\\<br \/>\n0&amp;\\cdots&amp;0&amp;-1&amp;1<br \/>\n\\end{bmatrix}<br \/>\n\\begin{bmatrix}<br \/>\nP0\\\\P1\\\\\\cdots\\\\P_{n-1}\\\\P_n<br \/>\n\\end{bmatrix}=<br \/>\n\\begin{bmatrix}<br \/>\nC^\\prime(0)\\frac{u_{p+1}-u_1}{p} \\\\<br \/>\nC^\\prime(u_x)\\frac{u_{p+n}-u_n}{p}<br \/>\n\\end{bmatrix}<br \/>\n$$\u5c06\u8fd9\u4e24\u6761\u8ffd\u52a0\u5230\u6700\u5f00\u59cb\u7684\u65b9\u7a0b\u4e2d\uff0c\u65b9\u7a0b\u5c31\u53ef\u89e3\u4e86\u3002<\/p>\n<p><strong>4\uff09\u6211\u7684C++\u5b9e\u73b0<\/strong><\/p>\n<pre class=\"lang:c++ decode:true \">\/\/Eigen \r\n#include &lt;Dense&gt;\r\n\/*!\r\n *\\brief \u4e09\u6b21B\u6837\u6761\u63d2\u503c\r\n*\\ param const std::vector&lt;Point&gt; &amp; vecFitPoints\u5f85\u63d2\u503c\u70b9\u96c6\u5408\uff0c\u9700\u8981\u70b9\u6570\u4e0d\u5c0f\u4e8e3\r\n*\\ Returns:   BSpline \u63d2\u503c\u6837\u6761\u66f2\u7ebf\r\n*\/\r\nBSpline BSpline::CubicInterpolate(const std::vector&lt;Point&gt;&amp; vecFitPoints)\r\n{\t\r\n\tconst int p=3;\r\n\tBSpline bs;\r\n\tint x = vecFitPoints.size();\r\n\tif(x&lt;p)\r\n\t{\r\n\t\tcout&lt;&lt;\"too less point !\"&lt;&lt;endl;\r\n\t\treturn bs;\r\n\t}\r\n\r\n\t\/\/\u6c42\u89e3\u65b9\u7a0b N*P = F\r\n\tEigen::MatrixXd N= Eigen::MatrixXd::Zero(x+2,x+2);\r\n\tEigen::MatrixXd P= Eigen::MatrixXd::Zero(x+2,3);\r\n\tEigen::MatrixXd F= Eigen::MatrixXd::Zero(x+2,3);\r\n\t\r\n\tbs.m_nDegree = p;\r\n\tbs.m_vecKnots.resize(x); \/\/x+6\u4e2a\u8282\u70b9\r\n\t\/\/\u8ba1\u7b97\u8282\u70b9\r\n\tbs.m_vecKnots[0] =0.0;\r\n\tfor (int i=1;i&lt;x;++i)\r\n\t{\r\n\t\tbs.m_vecKnots[i] = bs.m_vecKnots[i-1] \r\n\t\t+ PointDistance(vecFitPoints[i],vecFitPoints[i-1]);\r\n\t}\r\n\t\/\/\u8282\u70b9\u9996\u5c3e\u6784\u6210p+1\u5ea6\u91cd\u590d\r\n\tbs.m_vecKnots.insert(bs.m_vecKnots.begin(),p,bs.m_vecKnots.front());\r\n\tbs.m_vecKnots.insert(bs.m_vecKnots.end(),p,bs.m_vecKnots.back());\r\n\r\n\t\/\/1.\u586b\u5199\u77e9\u9635N\r\n\tstd::vector&lt;double&gt; basis_func;\r\n\tN(0,0) = 1;\r\n\tN(x-1,x+1) = 1;\r\n\tfor (int i=p+1;i&lt;x+p-1;++i)\r\n\t{\r\n\t\t\/\/c(u)\u5728 N_{i-p},...,N_i\u7b49p+1\u4e2a\u57fa\u51fd\u6570\u4e0a\u975e\u96f6\r\n\t\tbs.BasisFunc(bs.m_vecKnots[i],i,basis_func);\r\n\t\tfor (int j=i-p,k=0;j&lt;=i;++j,++k)\r\n\t\t{\r\n\t\t\tN(i-p,j) = basis_func[k];\r\n\t\t}\r\n\t}\r\n\t\r\n\t\/\/\u5bfc\u6570\r\n\tN(x,0) = -1;\r\n\tN(x,1) = 1;\r\n\tN(x+1,x) = -1;\r\n\tN(x+1,x+1) = 1;\r\n\r\n\t\/\/2.\u586b\u5199\u77e9\u9635F\r\n\tfor (int i=0;i&lt;x;++i)\r\n\t{\r\n\t\tF(i,0) = vecFitPoints[i].x;\r\n\t\tF(i,1) = vecFitPoints[i].y;\r\n\t\tF(i,2) = vecFitPoints[i].z;\r\n\t}\r\n\t\r\n\t{\r\n\t\tVec3d v0,v1,v2;\r\n\t\tBesselTanget(vecFitPoints[0],vecFitPoints[1],vecFitPoints[2],v0,v1,v2);\r\n\t\tVec3d v= v0*(bs.m_vecKnots[p+1]-bs.m_vecKnots[1])\/(double)p;\r\n\t\tF(x,0) = v.x;\r\n\t\tF(x,1) = v.y;\r\n\t\tF(x,2) = v.z;\r\n\t}\r\n\t\r\n\t{\r\n\t\tVec3d v0,v1,v2;\r\n\t\tBesselTanget(vecFitPoints[x-3],vecFitPoints[x-2],vecFitPoints[x-1],v0,v1,v2);\r\n\t\tVec3d v= v2*(bs.m_vecKnots[x+1+p]-bs.m_vecKnots[x+1])\/(double)p;\r\n\t\tF(x+1,0) = v.x;\r\n\t\tF(x+1,1) = v.y;\r\n\t\tF(x+1,2) = v.z;\r\n\t}\r\n\r\n\t\/\/\u89e3\u65b9\u7a0b N*P = F\r\n\tP = \tN.lu().solve(F);\r\n\r\n#ifdef _DEBUG\r\n\tcout&lt;&lt;\"N--------------\"&lt;&lt;endl&lt;&lt;N&lt;&lt;endl;\r\n\tcout&lt;&lt;\"F--------------\"&lt;&lt;endl&lt;&lt;F&lt;&lt;endl;\r\n\tcout&lt;&lt;\"P--------------\"&lt;&lt;endl&lt;&lt;P&lt;&lt;endl;\r\n#endif\r\n\r\n\t\/\/\u5c06Eigen\u6240\u6c42\u7684\u7ed3\u679c\u8d4b\u7ed9bs\u7684control_vertex\r\n\tbs.m_vecCVs.resize(x+2);\r\n\tfor(int i=0;i&lt;x+2;++i)\r\n\t{\r\n\t\tPoint&amp; cv = bs.m_vecCVs[i];\r\n\t\tcv.x = P(i,0);\r\n\t\tcv.y = P(i,1);\r\n\t\tcv.z = P(i,2);\r\n\t}\r\n\t\r\n\treturn bs;\r\n}<\/pre>\n<p><strong>5)\u4e0eAutoCAD\u7684\u5bf9\u6bd4<\/strong><\/p>\n<p>\u4e0b\u56fe\u662f\u6211\u7684\u63d2\u503c\u7ed3\u679c(\u7ea2\u8272\u7ebf)\u4e0eAutoCAD &#8220;SPLINE&#8221;\u5de5\u5177\u63d2\u503c\u751f\u6210\u7684\u6837\u6761\u66f2\u7ebf(\u767d\u8272\u7ebf)\u7684\u5bf9\u6bd4\u3002\u53ef\u4ee5\u770b\u5230\uff0c\u6211\u7684\u63d2\u503c\u7ed3\u679c\u4e0eAutoCAD\u7ed3\u679c\u7684\u4e0d\u540c\u4e4b\u5904\u5728\u4e8e\u66f2\u7ebf\u7684\u9996\u672b\u7aef\u70b9\u7684\u5bfc\u6570\u4f30\u8ba1\u4e0a\u3002\u5176\u4ed6\u7684\u6bd4\u5982\u5ea6\u6570\uff0c\u63a7\u5236\u70b9\u4e2a\u6570\u3001\u53c2\u6570\u5316\u65b9\u6cd5\u5747\u76f8\u540c\u3002\u53ef\u89c1\uff0cAutoCAD\u5bf9\u4e8e\u7aef\u70b9\u5bfc\u6570\u7684\u4f30\u8ba1\u7b97\u6cd5\u5e94\u8be5\u4e0d\u662f\u201cBessel Tangent\u201d\u6cd5\u3002<\/p>\n<div id=\"attachment_665\" style=\"width: 497px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-665\" class=\"wp-image-665 size-full\" src=\"http:\/\/www.whudj.cn\/wp-content\/uploads\/2017\/12\/bspline_interpolate.png\" alt=\"\" width=\"487\" height=\"194\" \/><p id=\"caption-attachment-665\" class=\"wp-caption-text\">\u6211\u7684B\u6837\u6761\u63d2\u503c\u7ed3\u679c(\u7ea2\u8272)\u4e0eAutoCAD\u63d2\u503c\u7b97\u6cd5(\u767d\u8272)\u6bd4\u8f83\uff0c\u4e8c\u8005\u7684\u7aef\u70b9\u5bfc\u6570\u4f30\u8ba1\u7b97\u6cd5\u4e0d\u4e00\u6837<\/p><\/div>\n<hr \/>\n<p>\u53c2\u8003\u8d44\u6599<\/p>\n<p><a href=\"http:\/\/www.farinhansford.com\/books\/essentials-cagd\/\">The Essentials of CAGD : Chapter 11 Working with B Spline Curves\u00a0<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63d2\u503c\u662f\u6307\uff1a\u5df2\u77e5\u5f62\u72b6\u70b9(Fit Point),\u6c42\u4e00\u6761\u6837\u6761\u66f2\u7ebf\u7a7f\u8fc7\u6240\u6709\u7684\u5f62\u72b6\u70b9\u3002\u63d2\u503c &hellip; <a href=\"http:\/\/www.whudj.cn\/?p=623\">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":[27,25,26],"_links":{"self":[{"href":"http:\/\/www.whudj.cn\/index.php?rest_route=\/wp\/v2\/posts\/623"}],"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=623"}],"version-history":[{"count":26,"href":"http:\/\/www.whudj.cn\/index.php?rest_route=\/wp\/v2\/posts\/623\/revisions"}],"predecessor-version":[{"id":671,"href":"http:\/\/www.whudj.cn\/index.php?rest_route=\/wp\/v2\/posts\/623\/revisions\/671"}],"wp:attachment":[{"href":"http:\/\/www.whudj.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.whudj.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=623"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.whudj.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}