ngon()

Extrude a regular polygon with n sides, inscribed in a circle of diameter d.

The (x, y) center follows ellipseMode() (default CENTER; RADIUS treats d as a radius). rotation (radians) turns the polygon; at 0 the first vertex points along +X. Outline only — no infill.

Parameters

Name Type Description
x number Center X position in mm (interpreted per ellipseMode).
y number Center Y position in mm.
z number Layer height in mm.
d number Diameter of the circumscribing circle in mm.
n number Number of sides (e.g. 6 for a hexagon).
rotation? number Rotation in radians. Default: 0.

Examples

Syntax

fab.ngon(x, y, z, d, n, [rotation])