{"id":60,"date":"2018-03-19T18:01:28","date_gmt":"2018-03-19T18:01:28","guid":{"rendered":"http:\/\/localhost\/blog_laurent\/?p=60"},"modified":"2018-03-19T18:01:28","modified_gmt":"2018-03-19T18:01:28","slug":"modelize-your-first-3d-shape","status":"publish","type":"post","link":"https:\/\/www.vandelle.com\/blog\/3dprinting\/2018\/03\/19\/modelize-your-first-3d-shape\/","title":{"rendered":"Modelize your first 3D shape with openSCAD #1"},"content":{"rendered":"<p>You decide to learn 3D modeling and start to print your first 3D shape this introduction course is made for you.<br \/>\nThis tutorial will allow you to create simple 3D shapes for 3D printing with using openSCAD a free open source software. I tried to do a tutorial the simple as possible with a lot of pictures to be understandable by everyone even beginners in computer science or 3D printing.<br \/>\nI personally like to use OpenSCAD because this language is very simple, cross platform and easy to share: it\u2019s not heavy it\u2019s only text. But most of all because it allows me to create simple shapes in a very low amount of time.<\/p>\n<p>First of all go check the link bellow to download openSCAD : <a href=\"http:\/\/www.openscad.org\/downloads.html\" target=\"_blank\" rel=\"noopener\">http:\/\/www.openscad.org\/downloads.html<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Summary<\/p>\n<ol>\n<li>Create your first shapes\n<ul>\n<li>Cube<\/li>\n<li>Cylinder<\/li>\n<li>Sphere<\/li>\n<li>Exercise 1<\/li>\n<\/ul>\n<\/li>\n<li>Moving and changing our objects\n<ul>\n<li>Translations<\/li>\n<li>Rotations<\/li>\n<li>Scale<\/li>\n<li>Exercise 2<\/li>\n<\/ul>\n<\/li>\n<li>Combining objects (Union, hull and difference)\n<ul>\n<li>Union<\/li>\n<li>Difference<\/li>\n<li>Hull<\/li>\n<li>Exercise 3<\/li>\n<\/ul>\n<\/li>\n<li>Good practice\n<ul>\n<li>Commentary<\/li>\n<li>Indentation<\/li>\n<li>Global variables<\/li>\n<li>colors<\/li>\n<\/ul>\n<\/li>\n<li>Modules<\/li>\n<li>Other functionalities\n<ul>\n<li>Text<\/li>\n<li>minkowski<\/li>\n<\/ul>\n<\/li>\n<li>Final Exercises<\/li>\n<li>Conclusion<\/li>\n<li>Correction<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h2>Interface<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-75\" src=\"http:\/\/www.vandelle.com\/blog\/3dprinting\/wp-content\/uploads\/sites\/6\/2018\/06\/interface_openSCAD-300x160.png\" alt=\"\" width=\"721\" height=\"385\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-94\" src=\"http:\/\/www.vandelle.com\/blog\/3dprinting\/wp-content\/uploads\/sites\/6\/2018\/03\/controle-panel-button-300x196.png\" alt=\"\" width=\"578\" height=\"378\" \/><\/p>\n<p>For more help and details on syntax and functionalities don\u2019t hesitate to check the <strong>CheatSheet<\/strong> that you can access directly in the <strong>Help menu in the control panel<\/strong> or at this link : <a href=\"http:\/\/www.openscad.org\/cheatsheet\/index.html?version=2015.03\" target=\"_blank\" rel=\"noopener\">http:\/\/www.openscad.org\/cheatsheet\/index.html?version=2015.03<\/a> .<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2>1. Create your first shapes<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-98\" src=\"http:\/\/www.vandelle.com\/blog\/3dprinting\/wp-content\/uploads\/sites\/6\/2018\/03\/Capture-300x220.png\" alt=\"\" width=\"344\" height=\"252\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-99\" src=\"http:\/\/www.vandelle.com\/blog\/3dprinting\/wp-content\/uploads\/sites\/6\/2018\/03\/Capture2.png\" alt=\"\" width=\"169\" height=\"164\" \/><\/p>\n<p>This is the view where your code will be transformed into a 3D shape. The most important thing for you to know is that we have 3 perpendicular axis (x,y,z) which will allow us to give the proper dimension to our shapes in every direction.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>a. Cube<\/h3>\n<p>Start to create a cube syntax is: <strong>cube<\/strong><strong>([width,depth,height]) <\/strong>or <strong>cube<\/strong><strong>([x,y,z])<\/strong><\/p>\n<pre>cube([10,10,10]);\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-105\" src=\"http:\/\/www.vandelle.com\/blog\/3dprinting\/wp-content\/uploads\/sites\/6\/2018\/03\/3-300x278.png\" alt=\"\" width=\"300\" height=\"278\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Automatically certain shape like the cube will appear in [0;0]. If you want it to be centered, you just need to add <strong>center = true<\/strong><strong>.<\/strong><\/p>\n<pre>cube([10,10,10], center = true);<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-106\" src=\"http:\/\/www.vandelle.com\/blog\/3dprinting\/wp-content\/uploads\/sites\/6\/2018\/03\/4-300x300.png\" alt=\"\" width=\"300\" height=\"300\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3>b. Cylinder<\/h3>\n<p>For a cylinder the syntax is <strong>cylinder<\/strong><strong>(h,r|d,center)<\/strong><\/p>\n<pre>cylinder(10,5,5);<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-107\" src=\"http:\/\/www.vandelle.com\/blog\/3dprinting\/wp-content\/uploads\/sites\/6\/2018\/03\/5.png\" alt=\"\" width=\"278\" height=\"294\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>As you can see our cylinder is not perfect his shape is a bit cubic it\u2019s why I encourage you to add <strong>$fn = number;<\/strong> at the beginning of your code. <strong>$fn<\/strong> or face number will make your shapes smoother but <span style=\"color: #ff0000\">be carful don\u2019t put a to high number overwise the render before exporting your shape is gone be <strong>very slow<\/strong><\/span>.<\/p>\n<p>&nbsp;<\/p>\n<pre>$fn = 100;\n\ncylinder(10,5,5);<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-108 alignnone\" src=\"http:\/\/www.vandelle.com\/blog\/3dprinting\/wp-content\/uploads\/sites\/6\/2018\/03\/6-297x300.png\" alt=\"\" width=\"297\" height=\"300\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>You can also do a cone with a cylinder<\/p>\n<pre>$fn = 100;\n\ncylinder(10,5,0);<\/pre>\n<p>&nbsp;<\/p>\n<p>with $fn\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 without $fn<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-109\" src=\"http:\/\/www.vandelle.com\/blog\/3dprinting\/wp-content\/uploads\/sites\/6\/2018\/03\/7-300x176.png\" alt=\"\" width=\"300\" height=\"176\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-110\" src=\"http:\/\/www.vandelle.com\/blog\/3dprinting\/wp-content\/uploads\/sites\/6\/2018\/03\/8-300x185.png\" alt=\"\" width=\"300\" height=\"185\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3>c. Sphere<\/h3>\n<p>For a sphere the syntax is <strong>sphere<\/strong><strong>(radius)<\/strong><\/p>\n<pre>$fn = 100;\n\nsphere(r=5);<\/pre>\n<p>&nbsp;<\/p>\n<p>with $fn\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 without $fn<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-111\" src=\"http:\/\/www.vandelle.com\/blog\/3dprinting\/wp-content\/uploads\/sites\/6\/2018\/03\/9-300x208.png\" alt=\"\" width=\"326\" height=\"226\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-112\" src=\"http:\/\/www.vandelle.com\/blog\/3dprinting\/wp-content\/uploads\/sites\/6\/2018\/03\/10-300x227.png\" alt=\"\" width=\"300\" height=\"227\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3>d. Exercise 1<\/h3>\n<p>Go on the <a href=\"http:\/\/www.openscad.org\/cheatsheet\/index.html?version=2015.03\" target=\"_blank\" rel=\"noopener\"><strong>CheatSheet<\/strong> <\/a>and try all the different shapes. Try to do a rectangle and change the different query of the cylinder to understand how it works.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You decide to learn 3D modeling and start to print your first 3D shape this introduction course is made for you. This tutorial will allow you to create simple 3D shapes for 3D printing with using openSCAD a free open source software. I tried to do a tutorial the simple as possible with a lot [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":88,"comment_status":"open","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-60","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/www.vandelle.com\/blog\/3dprinting\/wp-json\/wp\/v2\/posts\/60","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vandelle.com\/blog\/3dprinting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vandelle.com\/blog\/3dprinting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vandelle.com\/blog\/3dprinting\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vandelle.com\/blog\/3dprinting\/wp-json\/wp\/v2\/comments?post=60"}],"version-history":[{"count":0,"href":"https:\/\/www.vandelle.com\/blog\/3dprinting\/wp-json\/wp\/v2\/posts\/60\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vandelle.com\/blog\/3dprinting\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/www.vandelle.com\/blog\/3dprinting\/wp-json\/wp\/v2\/media?parent=60"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vandelle.com\/blog\/3dprinting\/wp-json\/wp\/v2\/categories?post=60"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vandelle.com\/blog\/3dprinting\/wp-json\/wp\/v2\/tags?post=60"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}