Graphics Reference
In-Depth Information
Now that you have the code for a basic ring, you can modify that code to
make it parametric. Then you can quickly modify a variable or two and the
ring can be easily sized to anyone's finger. You could also even turn the ring
into a bracelet.
What Does Parametric Mean?
On Thingiverse, you will often come across OpenSCAD models that are “fully
parametric”. The term “parametric” refers to a model that has been con-
structed using parameters or variables (such as height, width, length, diam-
eter, repetition of structures, and other attributes) that can be used to alter
or customize a model. After modifying the parameters of a model, the object
must be re-rendered to display the new configuration.
To make the ring fit, start by taking a finger measurement. Then you'll create
variables for the diameter, width, and height of the ring.
Measure your finger
Measure the width your finger at the widest point (in mm), straight
across the widest point of your knuckle. Calipers will be very handy here,
if you have them. This is the diameter of your finger at the widest point,
in mm.
You can express this value in code with the following assignment state-
ment (and comment). Add this line to the very top of your code:
ringSize=16.24; //width of your finger
Now set the thickness and the height of the ring
The ring has an inside and an outside. To keep the ring structurally sound
for a variety of sizes, you need to set the thickness of the ring between
the inside and the outside cylinders at 2mm. You'll also set the ring height
at an arbitrary value of 6mm.
Let's call the ring height ringHeight and the ring thickness ringThick
ness and add them to the code under the ringSize variable. Here is the
code so far:
//Parametric Variables - change these to modify your ring
ringSize=16.24; // width of your finger
ringThickness=2; // thickness of ring
ringHeight=6; // height of ring
$fn=100; //set the resolution for the model to "high"
difference() {
cylinder(h=6,r=18,center=true); // outside of ring
cylinder(h=20,r=16,center=true); // inside of ring
}
 
Search WWH ::




Custom Search