{"id":189,"date":"2012-11-27T04:50:05","date_gmt":"2012-11-27T04:50:05","guid":{"rendered":"http:\/\/mitat.tuu.fi\/?p=189"},"modified":"2012-11-27T04:50:05","modified_gmt":"2012-11-27T04:50:05","slug":"openscad-2d-object-that-can-be-exported-to-dxf","status":"publish","type":"post","link":"http:\/\/mitat.tuu.fi\/?p=189","title":{"rendered":"OpenSCAD 2D object that can be exported to DXF"},"content":{"rendered":"<p>\/\/ basic example of OpenSCAD that makes a plate that has holes in it<br \/>\n\/\/ you can export this to DXF because it makes 2D projection<\/p>\n<p>module test()<br \/>\n{<br \/>\n\t\/\/ difference = first &#8220;object&#8221; is cut out with the rest of the objects<br \/>\n\tdifference()<br \/>\n\t{<br \/>\n\t\t\/\/ union = all shapes inside union becomes one<br \/>\n\t\t\/\/ in this case this is the first object<br \/>\n\t\tunion()<br \/>\n\t\t{<br \/>\n\t\t\tcylinder(r=30, h=3, center=true);<br \/>\n\t\t\tcube(size = [100,30,1], center = true);<br \/>\n\t\t}<\/p>\n<p>\t\t\/\/ ok, let&#8217;s then punctuate the cylinder+cube combo with holes<\/p>\n<p>\t\tfor ( i = [0:10] )<br \/>\n\t\t{<br \/>\n\t\t\trotate([0,0,36*i]) \/\/ rotate the &#8220;world&#8221;<\/p>\n<p>\t\t\ttranslate([25,0,0]) \/\/ move away from the center<br \/>\n\t\t\t{<br \/>\n\t\t\t\tcylinder(r=2, h=5,  center=true); \/\/ punch a hole<br \/>\n\t\t\t}<br \/>\n\t\t}<\/p>\n<p>\t}<br \/>\n}<\/p>\n<p>projection(cut=true) test();<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/\/ basic example of OpenSCAD that makes a plate that has holes in it \/\/ you can export this to DXF because it makes 2D projection module test() { \/\/ difference = first &#8220;object&#8221; is cut out with the rest of the objects difference() { \/\/ union = all shapes inside union becomes one \/\/ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-189","post","type-post","status-publish","format-standard","hentry","category-snippet"],"_links":{"self":[{"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=\/wp\/v2\/posts\/189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=189"}],"version-history":[{"count":1,"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=\/wp\/v2\/posts\/189\/revisions"}],"predecessor-version":[{"id":190,"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=\/wp\/v2\/posts\/189\/revisions\/190"}],"wp:attachment":[{"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=189"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}