docs / Measure & verify

Measure & verify

Ask the kernel what you actually built, and check it before shipping.

boundingBox() asks the kernel what you actually built. Here it checks the fillet did not change the overall width.

const bracket = box(60, 40, 12).fillet(3);

const bb = await bracket.boundingBox();
if (Math.abs(bb.size[0] - 60) > 1e-6) {
  throw new Error('fillet changed the overall width: ' + bb.size[0]);
}

return bracket;
JavaScript is off — the listing above is the whole example.

Worked tube routing example

Read the five-line tube guide, then inspect 23 authored engine routes, clearances and a deliberate collision.

Calls

CallWhat it does
Shape.boundingBox(opts?: { exact?: boolean }) => Promise<{ min: [number, number, number]; max: [number, number, number]; size: [number, number, number]; center: [number, number, number] }>Axis-aligned bounding box in the CURRENT world frame (after every transform appended so far), in mm.
bbox(selection) => RequirementPredicateBounding-box size of a body selection in mm.
Scene.bbox : { min: [number, number, number]; max: [number, number, number] }Lazy axis-aligned bounding box over all transformed parts.
Curve3D.length() => numberTotal arc length in mm.
Shape.lower() => Promise<OcctBackend>Eagerly lower this Shape for inspection.
kinematic : KinematicFacadeNamespace with in-process feasibility checks an agent can run before declaring a mechanism design done: kinematic.checkMountingHoleConsistency(arm) (fastener-side hole agreement; dispatches to the v0.7.4 substrate), kinematic.checkSweptCollision(arm, opts?) (sampled-pose collision sweep across declared joint ranges), kinematic.checkReachable(arm, opts) (IK reachability — analytical Pieper first, DLS numeric fallback), kinematic.checkLoadCapacity(arm, opts?) (closed-form Euler-Bernoulli beam load check), kinematic.checkStaticHold(arm, opts?) (gravitational holding torque/force at a sampled pose grid vs each joint's declared actuator capacity), kinematic.motionLoad(arm, opts?) (per-joint wrench along the animation tracks, a joint-limit range, or explicit poses; also returns partLoads, the worst wrench per part in that part's frame, for feaStudy({ loadsFrom })), `kinematic.sweepTolerance({ code|file, params, gates?, boundaryTolerance?, boundaryBudget?
dfmSpec(spec: { minWall?: number; minClearance?: number; includeArticulatedMates?: boolean; ignore?: [string, string][]; exclude?: string[]; channels?: Array<{ part: string; name: string; openings: number; sealed?: boolean }>; process?: 'fdm'; buildDirection?: '+x' | '-x' | '+y' | '-y' | '+z' | '-z' | [number, number, number]; nozzleMm?: number; maxOverhangDeg?: number; maxBridgeMm?: number; printer?: string }) => DfmSpecHandleDeclare printability (design-for-manufacture) gates for the model.
Shape.feaStudy(spec: { material: 'mild-steel' | 'aluminum-6061' | 'pla' | 'petg' | 'abs' | 'nylon' | { E: number; nu: number; yield: number }; fixed: FaceQuery | string; loads?: Array<{ faces: FaceQuery | string; force: [number, number, number]; pointMm?: [number, number, number]; momentNmm?: [number, number, number]; name?: string }>; loadsFrom?: { motion: { partLoads: MotionPartLoadSample[] }; part: string; joint?: string; pose?: Record<string, number>; faces?: FaceQuery | string }; meshSize?: number; minSafetyFactor?: number; name?: string }) => FeaStudyHandleDeclare a linear-static structural study on this shape: where it is held (fixed), what pushes on it (loads, force in TOTAL newtons over the selected faces, or loadsFrom to take the worst sampled wrench from kinematic.motionLoad), and what it is made of.
tube(name, { from, to, via?, od?, wall, bendRadius, system?, material?, density?, flow? }) => ShapeBent tube between two ends: straight legs joined by constant-radius bends, built as one hollow solid in assembly space.
tubeSpec({ minBendRadiusFactor?, minStraightBetweenBends?, minStraightAtEnd?, maxBendAngle?, clearance?: { default?, pairs? }, systems?: { [system]: { minBendRadiusFactor?, minStraightBetweenBends?, minStraightAtEnd?, maxBendAngle? } } }) => { id, metadata }Declare the rules every tube() in the script must meet.
require(name: string, predicate: RequirementPredicate) => voidDeclare a named, kernel-measured requirement, reported in the requirements ledger every evaluation returns.
clearance(a, b) => RequirementPredicateMinimum surface-to-surface BREP distance between two selections, mm.
distance(a, b) => RequirementPredicateDistance between two selections, mm.
mass(selection) => RequirementPredicateMass of a body selection in kg.
volume(selection) => RequirementPredicateVolume of a body selection in mm^3.
centerOfMass(selection) => RequirementPredicateCentre of mass in mm.
count(selection) => RequirementPredicateNumber of resolved faces/edges in a selection.
innerLoops(selection) => RequirementPredicateLargest inner-boundary-loop (cutout) count across selected faces.
angle(a, b) => RequirementPredicateAngle between two selections' directions (face normal, edge tangent/axis or a body's principal axis), degrees.
concentric(a, b) => RequirementPredicateTwo selections share an axis: parallel axes and coincident centres.
coplanar(a, b) => RequirementPredicateTwo selections are coplanar: parallel normals and zero plane offset.