OpenSCAD Tutorial

Lesson 1 · Your First Shapes

Smooth curves with $fn

Curves are drawn as flat facets. The special variable $fn sets how many: a sphere with $fn = 8 looks like a gem, and one with $fn = 64 looks round. More facets look smoother but render more slowly.

Spheres are always centered on the origin. sphere(r = 6) takes a radius; sphere(d = 12) takes a diameter. A cube can be centered too: cube(10, center = true) puts its middle at the origin, which makes it easier to line up with spheres.

The smooth cylinders guide explains $fn, $fa, and $fs in depth.

Your task: this sphere looks like a gem. Make it smooth by raising $fn to 64.

Loading the OpenSCAD editor…
Step 3 of 16