Skip to main content
A primitive is a body made from a few parameters. Pass the kind as the first argument of new Wire or new Solid.

Wires

A regular polygon, a slot and a rounded rectangle are closed wires, so each is an extrude profile or hole:

Profile

A profile starts at start. Each segment goes to its to point:
  • { to } is a line.
  • { to, arc: { center, counterClockwise } } is an arc about center. to must be on the arc’s circle.
A closed profile must end at its start. Use it as an extrude profile or hole, a sweep profile, or a revolve profile.
A profile refuses repeated points, an arc whose end is not on its circle, segments that cross, and a closed profile that does not end at its start. Each throws InvalidParameter.

Solids

A size that is not finite, or not above four times the geometric tolerance, throws InvalidParameter. Not built: horn, spindle and lemon tori, whose minor radius is equal to or above the major one. A slot, a rounded box and a pipe segment are straight extrusions of lines and arcs, so they cut and join like any arc-edged solid:

Polysolid

A polysolid is a wall of constant width and height along a path. The path has the fields of a profile, in plane coordinates [u, v]. The wall stands on the plane where the path is, and rises along the normal. It is not centred. justify is 'centre' (the default), 'left' or 'right' of the path direction. Corners between two legs are mitred, and bevelled above a mitre limit of 4. closed: true makes a ring wall; an open path has square ends.
A segment with arc bends the wall around the arc’s centre. Each arc must join the segments before and after it tangentially: the path keeps its direction through the joint. A joint where an arc meets a leg or another arc at an angle throws InvalidParameter that names the joint, for example joint 1 between segment 0 and segment 1 is not tangent. A closed path of arcs needs two segments, such as two half circles:
A path with fewer than two points, a segment of zero length, or a path that crosses itself throws InvalidParameter. A straight leg next to another straight leg must be at least half the width long. An arc needs room on the inside of its bend: with 'centre', its radius must be above half the width; with 'left' or 'right', it must be above the full width when the wall lies on the inside of the bend. In a path with arcs, a wall that would overlap itself, for example two arms closer together than the width, throws InvalidParameter that names the two segments. With 'left' or 'right', a straight corner sharper than the mitre limit is built in two ways. In a path with arcs, the wall keeps the path’s corner and bevels its far side. In a path of straight legs only, the shifted centre line is bevelled, so the corner on the path side is cut too.

Typed parameters

OG_PRIMITIVE_PARAMS_<KIND>(params) returns its argument unchanged. It only gives the object a type, so your editor checks the field names. The entry exports the types too, such as ProfileParams, ArcParams, SphereParams, ConeParams and TorusParams.

On another plane

Pass plane in the options. A cylinder on an upright plane lies along Z:
See Coordinates and planes.
Last modified on November 10, 2026