Parametric Ring – 3D Printing Lesson Using OpenSCAD
Go the OpenSCAD Web Site (http://www.openscad.org/) Unlike other 3D modeling software, OpenSCAD does not have a way to manipulate an object’s shape with a mouse or touchpad. Instead, you describe objects with programming commands – mathematical expressions based on polar coordinate geometry, and then you render the 3D object from the description. OpenSCAD has two benefits – first, it is parametric. That is, once you design a 3D model, it can be changed or fitted by changing the input of one or two parameters. For this project, you will design a ring for you and me. You’ll measure the diameter of your ring finger to size the ring for yourself. Then, simply measure my ring finger and input the parameter – your program should resize the ring automatically. Second, if you download a 3D model based on OpenSCAD, you have the tool to change it. Many publicly available 3D objects on the Thingverse are written in OpenSCAD, so they can be modified by you. The projects-specific code for the design of a ring is given in this handout. The design of the ring is parametric – you enter the ring size (diameter of your ring finger), and the model renders a ring for this input dimension. You are to design a ring for you and me. General Tips about OpenSCAD • Units in OpenSCAD are in millimeters • Each command in OpenSCAD should end with a semicolon (;) • Changing the view mode to show axes will help to orient you in the x-y-z planes; you can get this setting from • To get a visual representation of the model you are creating with your code, go to the menu and select or press F5 (Windows) or fn+F5 to compile and fn+F6 to compile and render (MAC OS) • When you are ready to export your model, select Compile and Render (CGAL) from the Design menu or press F6 Page 1
• • • •
If you get lost, select to all the shapes you are using in the model without the Boolean operations performed If you are looking for some basic examples, OpenSCAD comes with pre-loaded examples located in If OpenSCAD complains about an error, it will highlight the offending line of code in red to make the error easier to find; most errors are either you forgot a semicolon at the end of a line or you had one too many open or close brackets {}, open or close parenthesis () Comments – two forward slashes // before text in the code indicate a comment. These are notes in the code that you or others can leave to tell you what each particular line or blocks of code are meant to do
Step-by-Step Making Instructions (scripted lesson from Getting Started with MakerBot by Bre Pettis, Anna Kaziunas France, and Jay Shergill We will use constructive solid geometries (cylinders and squares/rectangles) to make a parametric ring that is completely customizable. Open OpenSCAD
1
Turn on Show Axes by selecting You will type your code statements into the white plane on the left. When you compile, the object will show in the beige plane on the right Create a cylinder
2
You need to specify the height of the cylinder and the radius Type Cylinder(h=6; r=18); Compile the code by pressing F5 (Windows) or fn+F5 (MAC OS)
Page 2
Subtract the inside from the outside
3
We use two cylinders and a difference operator. Note the syntax – parentheses after difference, plus open and close brackets Why the green skin on the bottom of the opening? – because the inside cylinder has not completely removed the material. Both cylinders are created at the same point – the origin (0,0,0)
4
Add the center attribute to the code and both cylinders are centered at the origin – and the skin goes away Smooth it out by increasing the resolution
5
Add a line of code to set the fragment numbers to 100 and watch the model smooth it out
Page 3
Page 4
Page 5
6
Your code should look like this:
5
And your ring should look like this
6
Use the calipers to measure the diameter of yours (and my) ring finger
Page 6
Page 7
Now it’s time to add a pattern
7
Let’s add one cube/ rectangle. Here is the code and the ring with one rectangle subtracted (making two holes in the ring)
And here is the ring with one cube cutout (2 holes)
Page 8
Now we’ll add three more cubes (6 more holes)
8
If you got the first cube cutout right, you simply copy, paste, and edit the rotational angle…watch your decorative ring build Here is the final code and appearance of the ring
The current version of OpenSCAD has an export to STL option that allows Take a picture of you and your ring….plus glam shots. Present me with my ring and take a picture with our rings. Be sure to capture “making” views in your web blog. Good luck and Happy Making!!!
Page 9