How to Make Cylinders and Circles Smoother in OpenSCAD

All OpenSCAD tools and guides

Increase $fn to give a cylinder more sides. For models with several differently sized curves, leave $fn=0 and adjust $fa and $fs instead.

Compare low and high facet counts

translate([-15,0,0]) cylinder(h=12,d=20,$fn=12);
translate([15,0,0]) cylinder(h=12,d=20,$fn=96);

Run this example

Both cylinders have the same nominal diameter and height. The left one has a clearly polygonal outline; the right one uses 96 sides. Rotate the preview and inspect the top edges to compare their silhouettes.

Low-facet and smooth cylinders side by side

Let the settings respond to curve size

cylinder(h=12,d=20,$fn=0,$fa=5,$fs=0.5);
translate([30,0,0])
  cylinder(h=12,d=40,$fn=0,$fa=5,$fs=0.5);

Run this example

Both cylinders use the same angle and segment-size controls. With these settings the larger cylinder receives more segments, rather than forcing every curve to share one fixed count.

What to watch for

A positive $fn overrides $fa and $fs for circular tessellation. If changing the latter settings appears to do nothing, look for a local or global $fn first.

More segments create larger meshes and can make boolean operations slower. Start with a modest setting, inspect the silhouette at the intended size, and increase it only as needed. Smooth shading on a preview is not proof that an exported mesh has enough sides.

A printed hole can still need clearance compensation: adding facets does not account for printer calibration or material behavior. For the geometry of a hole, see the hole-cutting guide.

Related guides

Reference: OpenSCAD manual.