Graphics Reference
In-Depth Information
You can also compile the code by selection Design
→
Compile
from the menu.
Figure C-4.
center=true;
Smooth it out
You may notice that the surface of the ring is rough. You can smooth it
out by adding a line of code to set the “fragment numbers” to 100, greatly
increasing the resolution of the model.
Here is the ring code with the $fn variable set to high resolution. Compile
the code and watch the model smooth out
Figure C-5
:
$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
}
Figure C-5.
Smoothed out model