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: Editable<number>, opts?: { faceLabels?, twistAngle? }) => ShapeExtrude this closed sketch normal to its plane by depth (mm).
Sketch.revolve(opts?: { angleDeg?: Editable<number> }) => ShapeRevolve around the Z axis, 360 degrees unless angleDeg (number or ParamRef).
Sketch.revolve() => ShapeRevolve 360 degrees around the Z axis.
Sketch.sweep(rail, opts?: { frenet?, transitionMode?, spine?, section?: 'axial' | 'transverse' }) => ShapeSweep this profile along a 3D rail.
Sketch.sweep(rail, opts?: { frenet?, transitionMode?, spine? }) => ShapeSweep this profile along a 3D rail.
Sketch.loft(other: Sketch | Sketch[], opts?: { spacing?, planes?, twistDeg?, twistCenter?, ruled?, startPoint?, endPoint?, faceLabels?, continuity?: "G0" | "G1" | "G2", spanSize?: number, mode?: "single" | "sewn" }) => ShapeLoft this profile through one or more additional sections to produce a 3D solid that smoothly interpolates between them.
Sketch.loft(other: Sketch | Sketch[], opts?: { spacing?, planes?, twistDeg?, twistCenter?, ruled?, startPoint?, endPoint?, faceLabels?, rails?: Curve3D[], continuity?: "G0" | "G1" | "G2", spanSize?: number, mode?: "single" | "sewn" }) => 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: Editable<number>, pitch: Editable<number>, turns: Editable<number>, axis?, pointsPerTurn?, startAngle?: Editable<number> }) => [number, number, number][]Helix rail for Sketch.sweep.