{"id":143,"date":"2021-01-17T07:13:25","date_gmt":"2021-01-16T23:13:25","guid":{"rendered":"http:\/\/liyanliang.net\/?p=143"},"modified":"2021-01-17T07:15:40","modified_gmt":"2021-01-16T23:15:40","slug":"oda%e7%9a%84%e5%9f%ba%e6%9c%ac%e6%93%8d%e4%bd%9c-%e5%b9%b3%e7%a7%bb%e3%80%81%e6%97%8b%e8%bd%ac%e3%80%81%e7%9f%a9%e9%98%b5%e5%8f%98%e6%8d%a2","status":"publish","type":"post","link":"http:\/\/liyanliang.net\/index.php\/2021\/01\/17\/oda%e7%9a%84%e5%9f%ba%e6%9c%ac%e6%93%8d%e4%bd%9c-%e5%b9%b3%e7%a7%bb%e3%80%81%e6%97%8b%e8%bd%ac%e3%80%81%e7%9f%a9%e9%98%b5%e5%8f%98%e6%8d%a2\/","title":{"rendered":"ODA\u7684\u57fa\u672c\u64cd\u4f5c-\u5e73\u79fb\u3001\u65cb\u8f6c\u3001\u77e9\u9635\u53d8\u6362"},"content":{"rendered":"\n<p>ODA(Open Design Alliance\uff09\u662f\u4e00\u5957\u4e0eARX\u7c7b\u4f3c\u7684\u56fe\u5f62\u5f00\u53d1\u5e93\uff0c\u719f\u7ec3\u4f7f\u7528ODA\u63a5\u53e3\uff0c\u53ef\u4ee5\u5927\u5927\u52a0\u5feb\u6211\u4eec\u7684\u51e0\u4f55\u56fe\u5f62\u5f00\u53d1\u6548\u7387\u3002<\/p>\n\n\n\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">Contents<\/p><ul class=\"toc_list\"><ul><li><a href=\"#i\"><span class=\"toc_number toc_depth_2\">0.1<\/span> \u4e00\u3001\u6dfb\u52a0\u5e38\u7528\u7684\u5934\u6587\u4ef6<\/a><\/li><\/ul><\/li><li><a href=\"#i-2\"><span class=\"toc_number toc_depth_1\">1<\/span> \u4e8c\u3001 \u77e9\u9635\u53d8\u6362\u548c\u56fe\u5f62\u653e\u5927<\/a><\/li><li><a href=\"#i-3\"><span class=\"toc_number toc_depth_1\">2<\/span> \u4e09\u3001 \u5e73\u79fb<\/a><\/li><li><a href=\"#i-4\"><span class=\"toc_number toc_depth_1\">3<\/span> \u56db\u3001\u65cb\u8f6c<\/a><\/li><\/ul><\/div>\n<h3 class=\"wp-block-heading\"><span id=\"i\">\u4e00\u3001\u6dfb\u52a0\u5e38\u7528\u7684\u5934\u6587\u4ef6<\/span><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">#include \"OdaCommon.h\"<br>#include \"GePoint2d.h\"<br>#include \"GeVector2d.h\"<br>#include \"GeMatrix2d.h\"<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span id=\"i-2\">\u4e8c\u3001 \u77e9\u9635\u53d8\u6362\u548c\u56fe\u5f62\u653e\u5927<\/span><\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">OdGePoint2d ptBase; <br> &nbsp; &nbsp;\/\/\u52a0\u5165\u6211\u4eec\u9700\u5728\u4e00\u5f20\u5efa\u7b51\u65bd\u5de5\u56fe\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u67f1\u8282\u70b9\u7684\u5927\u6837\u56fe\uff0c\u9700\u8981\u628a\u8fd9\u4e2a\u5927\u6837\u56fe\u653e\u592710\u500d\uff0c\u5219<br> &nbsp; &nbsp;double dScale = 10;<br> &nbsp; &nbsp;OdGeMatrix2d matScale;\/\/\u521b\u5efa\u6bd4\u4f8b\u8f6c\u6362\u77e9\u9635<br> &nbsp; &nbsp;matScale.setToScaling(dScale, OdGePoint2d::kOrigin); \/\/\u76f8\u5bf9\u4e8e\u6211\u4eec\u8bbe\u5b9a\u7684\u539f\u70b9\u653e\u592710\u500d<br> &nbsp; &nbsp;OdGeMatrix2d matTranslate;<br> &nbsp; &nbsp;matTranslate.setToTranslation(OdGeVector2d(ptBase.x, ptBase.y)); \/\/\u5c06\u6211\u4eec\u5728\u539f\u70b9\u753b\u7684\u56fe\u79fb\u5230ptBase<br> &nbsp; &nbsp;OdGeMatrix2d mat = matTranslate * matScale; \/\/\u5148\u5c06\u5927\u6837\u56fe\u5728\u539f\u70b9\u5904\u653e\u5927\uff0c\u518d\u79fb\u52a8\u5230ptBase<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/liyanliangpublic.oss-cn-hongkong.aliyuncs.com\/img\/20200905071412.png\" alt=\"\"\/><\/figure>\n\n\n\n<p><a href=\"https:\/\/liyanliangpublic.oss-cn-hongkong.aliyuncs.com\/img\/20200905071412.png\"><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span id=\"i-3\">\u4e09\u3001 \u5e73\u79fb<\/span><\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">OdGePoint2d pt2 = ptCenter + OdGeVector2d(0.0, dRedius); \/\/\u5706\u5fc3\u4f4d\u7f6e\u6cbf\u7740x\u65b9\u5411\u79fb\u52a80\uff0c\u6cbf\u7740y\u65b9\u5411\u79fb\u52a8\u4e00\u4e2a\u534a\u5f84\u7684\u8ddd\u79bb<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/liyanliangpublic.oss-cn-hongkong.aliyuncs.com\/img\/20200905071505.png\" alt=\"\"\/><\/figure>\n\n\n\n<p><a href=\"https:\/\/liyanliangpublic.oss-cn-hongkong.aliyuncs.com\/img\/20200905071505.png\"><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span id=\"i-4\">\u56db\u3001\u65cb\u8f6c<\/span><\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">double dAngle135 = M_PI\/4.0*3.0; <br> &nbsp; &nbsp;OdGePoint2d pt1 = pt2;<br> &nbsp; &nbsp;pt1.rotateBy(-dAngle135, ptCenter); \/\/pt2\u6cbf\u7740\u5706\u5fc3\u65cb\u8f6c-135\u5ea6\uff0c\u83b7\u5f97pt1<br>\u200b<br> &nbsp; &nbsp;OdGePoint2d pt0 = pt1 + OdGeVector2d(-1.0,-1.0).normalize()*dLength;\/\/pt1\u6cbf\u7740x\u7684\u8d1f\u65b9\u5411\u548cy\u7684\u8d1f\u65b9\u5411\u79fb\u52a8dLength\u7684\u957f\u5ea6\uff0c\u5f97\u5230pt0<br>\u200b<br> &nbsp; &nbsp;pt0.transformBy(mat);<br> &nbsp; &nbsp;pt1.transformBy(mat);<br> &nbsp; &nbsp;pt2.transformBy(mat); &nbsp;\/\/\u5c06\u6211\u4eec\u518dptBase\u521b\u5efa\u7684\u70b9\u79fb\u52a8\u5230\u6211\u4eec\u8bbe\u5b9a\u7684\u5750\u6807\u4f4d\u7f6e<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/liyanliangpublic.oss-cn-hongkong.aliyuncs.com\/img\/20200905071534.png\" alt=\"\"\/><\/figure>\n\n\n\n<p><a href=\"https:\/\/liyanliangpublic.oss-cn-hongkong.aliyuncs.com\/img\/20200905071534.png\"><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ODA(Open Design Alliance\uff09\u662f\u4e00\u5957\u4e0eARX\u7c7b\u4f3c\u7684\u56fe\u5f62\u5f00\u53d1\u5e93\uff0c\u719f\u7ec3\u4f7f\u7528ODA\u63a5\u53e3\uff0c\u53ef\u4ee5\u5927\u5927\u52a0\u5feb\u6211\u4eec\u7684\u51e0\u4f55\u56fe\u5f62\u5f00\u53d1\u6548\u7387\u3002 Contents0.1 \u4e00\u3001\u6dfb\u52a0\u5e38\u7528\u7684\u5934\u6587\u4ef61 \u4e8c\u3001 \u77e9\u9635\u53d8\u6362\u548c\u56fe\u5f62\u653e\u59272 \u4e09\u3001 \u5e73\u79fb3 \u56db\u3001\u65cb\u8f6c \u4e00\u3001\u6dfb\u52a0\u5e38\u7528\u7684\u5934\u6587\u4ef6 #include &#8220;OdaCommon.h&#8221;#include &#8220;GePoint2d.h&#8221;#include &#8220;GeVector2d.h&#8221;#include &#8220;GeMatrix2d.h&#8221; \u4e8c\u3001 \u77e9\u9635\u53d8\u6362\u548c\u56fe\u5f62\u653e\u5927 OdGePoint2d ptBase; &nbsp; &nbsp;\/\/\u52a0\u5165\u6211\u4eec\u9700\u5728\u4e00\u5f20\u5efa\u7b51\u65bd\u5de5\u56fe\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u67f1\u8282\u70b9\u7684\u5927\u6837\u56fe\uff0c\u9700\u8981\u628a\u8fd9\u4e2a\u5927\u6837\u56fe\u653e\u592710\u500d\uff0c\u5219 &nbsp; &nbsp;double dScale = 10; &nbsp; &nbsp;OdGeMatrix2d matScale;\/\/\u521b\u5efa\u6bd4\u4f8b\u8f6c\u6362\u77e9\u9635 &nbsp; &nbsp;matScale.setToScaling(dScale, OdGePoint2d::kOrigin); \/\/\u76f8\u5bf9\u4e8e\u6211\u4eec\u8bbe\u5b9a\u7684\u539f\u70b9\u653e\u592710\u500d &nbsp; &nbsp;OdGeMatrix2d&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"http:\/\/liyanliang.net\/index.php\/2021\/01\/17\/oda%e7%9a%84%e5%9f%ba%e6%9c%ac%e6%93%8d%e4%bd%9c-%e5%b9%b3%e7%a7%bb%e3%80%81%e6%97%8b%e8%bd%ac%e3%80%81%e7%9f%a9%e9%98%b5%e5%8f%98%e6%8d%a2\/\"> Read More<span class=\"screen-reader-text\">  Read More<\/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":[1],"tags":[16],"class_list":["post-143","post","type-post","status-publish","format-standard","hentry","category-c","tag-oda"],"_links":{"self":[{"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/posts\/143","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/comments?post=143"}],"version-history":[{"count":1,"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/posts\/143\/revisions"}],"predecessor-version":[{"id":144,"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/posts\/143\/revisions\/144"}],"wp:attachment":[{"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/media?parent=143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/categories?post=143"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/tags?post=143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}