docs / Add material

Add material

Turn a profile into a solid, or grow one along a path.

A revolved knob. Draw half the section as a closed path, then spin it. finish() names the material; the color option tints the anodised surface.

const section = path()
  .moveTo(4, 0)
  .lineTo(16, 0)
  .lineTo(16, 6)
  .lineTo(9, 22)
  .lineTo(4, 22)
  .close();

return section.revolve().finish('anodized', { color: '#2F6F63' });
JavaScript is off — the listing above is the whole example.

Calls

CallWhat it does
Sketch.extrude(depth) => ShapeExtrude this closed sketch normal to its plane by depth (mm).
Sketch.revolve() => ShapeRevolve 360 degrees around the Z axis.
Sketch.sweep(rail, opts?: { frenet?, transitionMode?, spine? }) => ShapeSweep this profile along a 3D rail.
Sketch.loft(other: Sketch | Sketch[], opts?: { spacing?, planes?, ruled?, startPoint?, endPoint? }) => ShapeLoft this profile through one or more additional sections to produce a 3D solid that smoothly interpolates between them.
variableSweep(spine: Curve3D | Sketch | Vec3[], sections: Array<{ t: number; profile: Sketch }>, opts?: { closed?: boolean; continuity?: "C0" | "C1" | "C2" }) => ShapeMulti-section sweep that blends sections[i].profile along the spine at the section's t ∈ [0, 1] spine parameter.
helix({ radius, pitch, turns, axis?, pointsPerTurn?, startAngle? }) => [number, number, number][]Polyline helix rail for Sketch.sweep.