Skip to content

Features DSL

Import

ts
import {
  extrude,
  plane,
  revolve,
  sweep,
  pipe,
  shell,
  mirror,
  deleteFace,
  replaceFace,
  moveFace,
  moveBody,
  splitBody,
  splitFace,
  curveIntersect,
  thicken,
  unwrap,
  hole,
  fillet,
  variableFillet,
  chamfer,
  variableChamfer,
  thread,
  draft,
  patternLinear,
  patternCircular,
  booleanOp,
} from "trueform/dsl/features";

Features

  • extrude(id, profile, depth, result?, deps?, opts?) -> Extrude
  • plane(id, width, height, result?, opts?) -> Plane
  • surface(id, profile, result?, deps?) -> Surface
  • revolve(id, profile, axis, angle, result?, opts?) -> Revolve
  • loft(id, profiles, result?, deps?, opts?) -> Loft
  • sweep(id, profile, path, result?, deps?, opts?) -> Sweep
  • pipe(id, axis, length, outerDiameter, innerDiameter?, result?, opts?) -> Pipe
  • shell(id, source, thickness, result?, deps?, opts?) -> Shell
  • mirror(id, source, plane, result?, deps?) -> Mirror
  • deleteFace(id, source, faces, result?, deps?, opts?) -> DeleteFace
  • replaceFace(id, source, faces, tool, result?, deps?, opts?) -> ReplaceFace
  • moveFace(id, source, faces, result?, deps?, opts?) -> MoveFace
  • moveBody(id, source, result?, deps?, opts?) -> MoveBody
  • splitBody(id, source, tool, result?, deps?, opts?) -> SplitBody
  • splitFace(id, faces, tool, result?, deps?) -> SplitFace
  • curveIntersect(id, first, second, result?, deps?) -> CurveIntersect (staging)
  • draft(id, source, faces, neutralPlane, pullDirection, angle, result?, deps?) -> Draft
  • thicken(id, surface, thickness, result?, deps?, opts?) -> Thicken
  • unwrap(id, source, result?, deps?, opts?) -> Unwrap (strict/default and experimental modes)
  • thread(id, axis, length, majorDiameter, pitch, result?, deps?, opts?) -> Thread (modeled)
  • hole(id, onFace, axis, diameter, depth, opts?) -> Hole
  • fillet(id, edges, radius, depsOrOpts?) -> Fillet
  • variableFillet(id, source, entries, result?, deps?) -> VariableFillet
  • chamfer(id, edges, distance, depsOrOpts?) -> Chamfer
  • variableChamfer(id, source, entries, result?, deps?) -> VariableChamfer
  • booleanOp(id, op, left, right, result?, deps?) -> BooleanOp
  • patternLinear(id, origin, spacing, count, depsOrOpts?) -> PatternLinear
  • patternCircular(id, origin, axis, count, depsOrOpts?) -> PatternCircular

Compatibility helpers (still exported):

  • pipeSweep(id, path, outerDiameter, innerDiameter?, result?, opts?) -> PipeSweep
  • hexTubeSweep(id, path, outerAcrossFlats, innerAcrossFlats?, result?, opts?) -> HexTubeSweep
  • union(id, left, right, result?, deps?) -> BooleanOp
  • cut(id, left, right, result?, deps?) -> BooleanOp (subtract)
  • intersect(id, left, right, result?, deps?) -> BooleanOp

Examples:

Consolidation Notes

  • Prefer sweep + explicit profileCircle(...) / profilePoly(...) for path sweeps.
  • Prefer booleanOp(..., "union" | "subtract" | "intersect", ...) as the canonical boolean surface.
  • pipeSweep, hexTubeSweep, union, cut, and intersect remain as compatibility aliases.

Unwrap options (opts):

  • mode?: "strict" | "experimental" (default: "strict").
  • strict: reliable templates only (single-face planar/cylindrical, full cylinder solids, axis-aligned box nets, thin-sheet solids).
  • experimental: broader best-effort unwrap for complex multi-face/solid inputs.

Thread

Defaults use an ISO-style profile (60 deg flank angle with crest/root flats derived from pitch and minor diameter). Override profileAngle, crestFlat, or rootFlat to customize the profile.

Options (opts):

  • origin?: Point3D
  • minorDiameter?: Scalar
  • handedness?: "right" | "left"
  • segmentsPerTurn?: Scalar
  • profileAngle?: Scalar (radians)
  • crestFlat?: Scalar
  • rootFlat?: Scalar

Thread is a stable feature in the runtime stage registry. As with all modeled threads, validate geometry/performance on your target parts when using dense pitch or long thread lengths.