{"id":15,"date":"2016-02-10T14:47:09","date_gmt":"2016-02-10T13:47:09","guid":{"rendered":"http:\/\/sergepayen.fr\/en\/?p=15"},"modified":"2019-11-29T16:38:34","modified_gmt":"2019-11-29T15:38:34","slug":"how-to-use-a-parametric-file","status":"publish","type":"post","link":"https:\/\/sergepayen.fr\/en\/how-to-use-a-parametric-file\/","title":{"rendered":"How to use a parametric file"},"content":{"rendered":"<p>Tutorial: how to use a parametric 3D model with the software <em>OpenSCAD<\/em>, in order to obtain a custom-made object.<br \/>\n<!--more--><\/p>\n<h6><a href=\"http:\/\/www.openscad.org\/downloads.html\" target=\"_blank\" rel=\"noopener noreferrer\">Download OpenSCAD<\/a><\/h6>\n<h3><strong>Introduction<\/strong><\/h3>\n<p>A parametric file is a &#8220;flexible&#8221; 3D model. SCAD format is based on <a href=\"https:\/\/en.wikipedia.org\/wiki\/Constructive_solid_geometry\" target=\"_blank\" rel=\"noopener noreferrer\">CSG modeling<\/a>. It provides the user with <em>parameters<\/em>, which can take the <em>values<\/em> of his choice.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-166 imgBorder\" src=\"http:\/\/sergepayen.fr\/wp-content\/uploads\/HCW-SpokeStyles1.jpg\" alt=\"HCW-SpokeStyles1\" width=\"825\" height=\"409\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-167 imgBorder\" src=\"http:\/\/sergepayen.fr\/wp-content\/uploads\/HCW-SpokeStyles2.jpg\" alt=\"HCW-SpokeStyles2\" width=\"825\" height=\"413\" \/><\/p>\n<p><em>Highly Configurable Wheel<\/em><br \/>\nFile created by Alex Franke &#8211; CodeCreations<br \/>\nYou can download it here : <a href=\"http:\/\/www.thingiverse.com\/thing:21486\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.thingiverse.com\/thing:21486<\/a><\/p>\n<h3><strong>The interface<\/strong><\/h3>\n<p>This is how a file looks like in OpenSCAD :<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-170 imgBorder\" src=\"http:\/\/sergepayen.fr\/wp-content\/uploads\/customizableKnob-openScad.jpg\" alt=\"customizableKnob-openScad\" width=\"825\" height=\"484\" \/><\/p>\n<p><em>Customizable Knob!<\/em><br \/>\nFile created by Charliearmorycom<br \/>\nYou can download it here : <a href=\"http:\/\/www.thingiverse.com\/thing:54024\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.thingiverse.com\/thing:54024<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>The interface is divided into 2 zones:<\/p>\n<p>&#8211; The editor (left)<br \/>\n&#8211; The visualization window (right)<\/p>\n<ul>\n<li>left click = 3D view<\/li>\n<li>right click = Pan<\/li>\n<li>scroll wheel = Zoom<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-172\" src=\"http:\/\/sergepayen.fr\/wp-content\/uploads\/openScad-viewsIcons.jpg\" alt=\"openScad-viewsIcons\" width=\"282\" height=\"36\" \/><\/p>\n<p>Standard viewpoints (top, bottom, side&#8230;).<\/p>\n<p>&nbsp;<\/p>\n<p>The settings, in black, and their values, in red:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-173 imgBorder\" src=\"http:\/\/sergepayen.fr\/wp-content\/uploads\/sergePayen-OStuto-editor.jpg\" alt=\"sergePayen-OStuto-editor\" width=\"825\" height=\"860\" \/><\/p>\n<h3><strong>Settings, values and comments<\/strong><\/h3>\n<p>A parameter and its value will be written :<br \/>\n<em>parameter = value ;<\/em><\/p>\n<p>Comments are small texts to help the user. They are preceded by &#8220;\/\/&#8221;, or placed between &#8220;\/*&#8221; and &#8220;*\/&#8221;.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sergepayen.fr\/en\/wp-content\/uploads\/sergePayen-OStuto-parameters.jpg\" alt=\"sergePayen-OStuto-parameters\" width=\"825\" height=\"242\" class=\"aligncenter size-full wp-image-69\" srcset=\"https:\/\/sergepayen.fr\/en\/wp-content\/uploads\/sergePayen-OStuto-parameters.jpg 825w, https:\/\/sergepayen.fr\/en\/wp-content\/uploads\/sergePayen-OStuto-parameters-300x88.jpg 300w\" sizes=\"auto, (max-width: 825px) 100vw, 825px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>This is the effect of a change in values for the parameters <em>&#8220;Knob Height&#8221;<\/em> and <em>&#8220;KnobDiameter&#8221;<\/em> (knob&#8217;s height and diameter, in mm):<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-175 imgBorder\" src=\"http:\/\/sergepayen.fr\/wp-content\/uploads\/sergePayen-OStuto-numeric1.jpg\" alt=\"sergePayen-OStuto-numeric1\" width=\"825\" height=\"330\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-176 imgBorder\" src=\"http:\/\/sergepayen.fr\/wp-content\/uploads\/sergePayen-OStuto-numeric2.jpg\" alt=\"sergePayen-OStuto-numeric2\" width=\"825\" height=\"330\" \/><\/p>\n<p>At first, the button was &#8220;20&#8221; mm high for &#8220;20&#8221; mm diameter. By simply changing these values to the numbers &#8220;15&#8221; and &#8220;100&#8221;, we obtained a button 15mm high for 100mm diameter.<\/p>\n<h3><strong>View the changes: the preview<\/strong><\/h3>\n<p>After changing something in the code editor, you must tell OpenScad that you want to generate a preview by pressing F5 (in order to &#8220;recalculate&#8221; the model).<\/p>\n<p>TO SEE YOUR CHANGES:<br \/>\nPUSH F5<br \/>\nOR THIS BUTTON :<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sergepayen.fr\/wp-content\/uploads\/openScad-compileIcon.jpg\" alt=\"\" width=\"41\" height=\"40\" class=\"alignnone size-full wp-image-177\" \/><\/p>\n<h3><strong>Other types of values<\/strong><\/h3>\n<p><em>Numerical <\/em> values expressing dimensions are the most common, but there are others, such as the values used to propose a binary choice (YES \/ NO). There are then only two possibilities: for &#8220;yes&#8221; it is 1 (or TRUE), for &#8220;no&#8221; it is 0 (or FALSE).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-180 imgBorder\" src=\"http:\/\/sergepayen.fr\/wp-content\/uploads\/sergePayen-OStuto-legoTrue.jpg\" alt=\"sergePayen-OStuto-legoTrue\" width=\"825\" height=\"264\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-179 imgBorder\" src=\"http:\/\/sergepayen.fr\/wp-content\/uploads\/sergePayen-OStuto-legoFalse.jpg\" alt=\"sergePayen-OStuto-legoFalse\" width=\"825\" height=\"265\" \/><\/p>\n<p><em>Parametric Lego Brick<\/em><br \/>\nFile created by Andrew Sweet<br \/>\nYou can download it here : <a href=\"http:\/\/www.thingiverse.com\/thing:231651\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.thingiverse.com\/thing:231651<\/a>) :<\/p>\n<p>&nbsp;<\/p>\n<p>There are also values to propose a choice between several options. These can be numerical values such as &#8220;1, 2, 3, 4&#8230;&#8221;.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-182 imgBorder\" src=\"http:\/\/sergepayen.fr\/wp-content\/uploads\/sergePayen-OStuto-furniture8.jpg\" alt=\"sergePayen-OStuto-furniture8\" width=\"825\" height=\"268\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-183 imgBorder\" src=\"http:\/\/sergepayen.fr\/wp-content\/uploads\/sergePayen-OStuto-furniture15.jpg\" alt=\"sergePayen-OStuto-furniture15\" width=\"825\" height=\"268\" \/><\/p>\n<p><em>Customizable Furniture Minis<\/em><br \/>\nFile created by mathgrrl<br \/>\nYou can download it here : <a href=\"http:\/\/www.thingiverse.com\/thing:332507\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.thingiverse.com\/thing:332507<\/a>) :<\/p>\n<p>&nbsp;<\/p>\n<p>This type of value can also be expressed &#8220;in words&#8221;:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-184 imgBorder\" src=\"http:\/\/sergepayen.fr\/wp-content\/uploads\/sergePayen-OStuto-stringCircle.jpg\" alt=\"sergePayen-OStuto-stringCircle\" width=\"825\" height=\"322\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-185 imgBorder\" src=\"http:\/\/sergepayen.fr\/wp-content\/uploads\/sergePayen-OStuto-stringLine.jpg\" alt=\"sergePayen-OStuto-stringLine\" width=\"825\" height=\"322\" \/><\/p>\n<p>The parameter then takes a value in the form of a &#8220;word&#8221;. In this form, the value must be written in quotation marks. The possible options are generally included in the comments.<\/p>\n<h3><strong>Obtaining a STL file: Rendering and Export<\/strong><\/h3>\n<p>TO RENDER (REQUIRED BEFORE STL EXPORT)<br \/>\nPUSH F6<br \/>\nOR THIS BUTTON :<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sergepayen.fr\/wp-content\/uploads\/openScad-renderIcon.jpg\" alt=\"openScad-renderIcon\" width=\"41\" height=\"42\" class=\"alignnone size-full wp-image-186\" \/><\/p>\n<p>Or via the menu bar : Design \/ Compile and Render.<\/p>\n<p>TO EXPORT THE 3D FILE IN STL FORMAT<br \/>\nPRESS THIS BUTTON:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-188\" src=\"http:\/\/sergepayen.fr\/wp-content\/uploads\/openScad-STLicon.jpg\" alt=\"openScad-STLicon\" width=\"46\" height=\"41\" \/><\/p>\n<p>Or via the menu bar: File \/ Export \/ Export as STL<\/p>\n<p>&nbsp;<\/p>\n<p>The STL file can then be printed, as here the rotary knob seen above:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-189\" src=\"http:\/\/sergepayen.fr\/wp-content\/uploads\/sergePayen-OStuto-boutonPrint.jpg\" alt=\"sergePayen-OStuto-boutonPrint\" width=\"825\" height=\"551\" \/><\/p>\n<p>And once installed on the LCD controller of my 3D printer:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-190\" src=\"http:\/\/sergepayen.fr\/wp-content\/uploads\/sergePayen-OStuto-boutonLCD.jpg\" alt=\"sergePayen-OStuto-boutonLCD\" width=\"825\" height=\"551\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tutorial: how to use a parametric 3D model with the software OpenSCAD, in order to obtain a custom-made object.<\/p>\n","protected":false},"author":2,"featured_media":72,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-15","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/sergepayen.fr\/en\/wp-json\/wp\/v2\/posts\/15","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sergepayen.fr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sergepayen.fr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sergepayen.fr\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sergepayen.fr\/en\/wp-json\/wp\/v2\/comments?post=15"}],"version-history":[{"count":16,"href":"https:\/\/sergepayen.fr\/en\/wp-json\/wp\/v2\/posts\/15\/revisions"}],"predecessor-version":[{"id":200,"href":"https:\/\/sergepayen.fr\/en\/wp-json\/wp\/v2\/posts\/15\/revisions\/200"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sergepayen.fr\/en\/wp-json\/wp\/v2\/media\/72"}],"wp:attachment":[{"href":"https:\/\/sergepayen.fr\/en\/wp-json\/wp\/v2\/media?parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sergepayen.fr\/en\/wp-json\/wp\/v2\/categories?post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sergepayen.fr\/en\/wp-json\/wp\/v2\/tags?post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}