June 4, 2015
Description
This a module for OpenSCAD to create a cylinder with dynamic or fixed fn for consistent resolution.
With a fixed $fn, large cylinders are jagged and small cylinders are ultrafine.
With this module every cylinder has a fixed resolution that can be set to match the resolution of your printer.
Usage:
Like the build in module cylinder() this module accepts r,r2,d,d2,h, and center.
It doens't accept $fn, use fn instead, if you need a fixed $fn (i.e. for hexagonal cylinders).
If fn isn't specified, $fn is calculated from the radius or diameter to match the given resolution.
Resolution can be set globaly and individual (optional).
The variable "resolution" is the length of each segment of the cylinder to aproxximate a circle.
That means a smaller resolution value means more detail!
Caution: if you choose a very small resolution OpenSCAD will work quite hard as the $fn will rise!
The variable enlarge is used to enlarge the cylinder hight, to avoid zero walls, when using difference().
No more translate([0,0,-1]) cylinder(r=5, h=10+2), use fncylinder(r=5, h=10,enlarge=1) instead.
License:
Creative Commons - Attribution - Non-Commercial - Share Alike