3D Modeling: Using OpenScad to Design a Ring

One of the biggest hurdles for most people to get into 3D printing is just knowing where to start, but just like any other type of printer you need something print to make it worth it and anyone can start this free and be sure to have something worth printing before deciding the next step. If you don’t want to just download other peoples model and would like to create your own there are plenty of free options to get started with. Here is an excerpt from one of those options from my ring making guide/tutorial/instructables I was making to cover the creation of YuQi’s engagment ring.ringOpenScad is a lot more intimidating to most people who are not familiar with programming, but in all honesty if you just want to make a simple ring all your self (i.e. not downloading a model) and don’t have much computing power you can easily get something out of OpenScad and it can be a great way to much more complicated designs and programming if you care to continue.

  1. First get the free program: http://www.openscad.org/ – this works on most major and some minor operating systems. And is not nearly as resource intensive as most other CAD programs at the outset.
  2. Once installed open the program – you should get something like the first picture. (windows version – as is most of this guide)
  3. OpenScad - Open
  4. On the left hand side is an almost notepad like text box you will be typing all your commands, and on the right will be your output (including a little log of process that may be helpful in finding problems) – this is ‘quick’ updated (rendered) every time you press F5 and can have the view rotated and moved around by using the mouse. The basics are simple you will type what you want it make. But you will do it in a format it can read. It reads like normal (top to bottom, words are left to right) except for a simple catch, each individual ‘line’ is read from the end to the beginning and each section closed in parentheses or brackets is one complete section (brackets supplant ; for ends too). Also for this program I work in millimeters (although technically some places for printing will ask your scale used but the default output seems to be mm as well) but a number alone for me is 1mm (i.e. I write 1 but I mean 1mm).
  5. For a ring the basics that you need to know are:
    • ; – this (the semi colon) ends (starts) each command and it is like the period of a sentence. In a world where grammar is very important (computers take very direct instructions and don’t fill in gaps with ‘common sense’ – pressing enter to make a new line is actually only for the user.
    • translate([x,y,z]) – this moves the object in the x,y,z directions.
    • rotate_extrude([x,y,z]) – this creates a 3D shape by rotating a 2D shape around an axis (think pole you swing the shape around) defined by [x,y,z] or by the origin if you leave that part off.
    • square([s1,s2]) – makes a 2D square with sides of length S1 for side one and S2 for side 2, you can also add “,center = true” in the bracket to make the center the origin (point [0,0,0])

Try just typing this in press F5 and then messing around with some of the numbers to get a very simple ring (next picture):

OpenScad very simple ring

rotate_extrude()translate([(16.1/2)+(1.5/2),0,0])square([1.5,2.5],center=true);

That’s it one simple ring that is 2.5mm wide, 1.5mm thick, and has a center cut out for a 16.1mm diameter finger

So what’s happening here?

  1. Well it starts with a command line (remember working backwards) that’s the “;”
  2. Then it makes a square that is 1.5mm wide and 2.5mm tall and places it right over the center mark – square is the next command moving from the “;” left.
  3. Then it moves the square so the edge is 8.05mm (half our diameter) away from the center (the 1.5/2 part is there to account for the fact that the square is centered and thus .75 away from the edges either way leaving it here spins it like a top, useless for creating a hole, moving it the .75 makes it like a door on a pole it spins and makes a shape but has no hole. but after moving it past the origin moving it more will make a radius of a circle equal to how much further you move it.
  4. Finally it takes this 2D shape and rotates it around the center to make a simple ring.

From here you can have more complex designs by adding shapes moving them about and subtracting shapes etc. See below for more examples – You can always look up more commands and add them to your tool box when making shape simply by looking them up online, some are pretty self explanatory like circle(), rotate(),scale(), or cube() and some are a little bit more complex but still useful [like union{},intersection{},and difference{}] this is only a quick starter guide – I have put a few quick examples below (but there are many other useful concepts such as defining a variable, creating modules, as well as using special note characters such as #,*,%,// to comment or trouble shoot, and such that it may be useful to expand on if you are interested.

Since a computer has to choose between making shapes quickly or detailed it will often simplify harder shapes (curves) into easier shapes (flat surfaces) such as turning a circle into a 20 sided polygon instead of a purely round shape. You can tell it to increase the number of sides it has and thus make it smoother and rounder by adding a $fn=100 into one of the ‘last’ operations, this will make sure your shape has 100 sides (or whatever number you put)

After you finish your design you will want to press F6 to fully render the model then go to ‘file->export->export as stl…’ This will save the needed STL file you want, ‘file->save’ saves your work in progress and not your end model – this is good to do to keep all the command parts and if you want to make tweaks simply open your file and change a few numbers. After you are done you may also want to repair your file using the free or online version of netfabb http://www.netfabb.com/ this is mainly fix little computational problems that will likely come about from more complex designs and increase the printability of your model (for example if you subtract two overlaying part that share an edge what happens to that edge? the computer leaves a surface if thickness = 0 which is not a realistic printing situation). Since this is not a “necessary” step I will leave other guides to explain it beyond its very simple use (basically open model, click repair, click apply, click export model).

Double stacked circle ring

rotate_extrude($fn=100)translate([(16.1/2)+(1.5/2),0,0])union(){circle(r=1.5);translate([0,1.4,1])circle(r=1.5);}

This means the same thing as above (remember line breaks are for you not the computer):

rotate_extrude($fn=100)
translate([(16.1/2)+(1.5/2),0,0])

union(){

circle(r=1.5);

translate([0,1.4,0])circle(r=1.5);

}

OpenScad - Double Stacked Ring

True wedding band ring style (see cross section)

rotate_extrude($fn=300)translate([(16.1/2)+(1.5/2),0,0])intersection(){square([1.5,2.5],center=true);translate([-2.3,0,0])circle(r=3,$fn=100);translate([2.3,0,0])circle(r=3,$fn=100);}

OpenScad - True RingOpenScad Cross section

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s