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;Worked tube routing example
Read the five-line tube guide, then inspect 23 authored engine routes, clearances and a deliberate collision.
Calls
| Call | What 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. |
Scene.bbox : { min: [number, number, number]; max: [number, number, number] } | Lazy axis-aligned bounding box over all transformed parts. |
Curve3D.length() => number | Total arc length in mm. |
Shape.lower() => Promise<OcctBackend> | Eagerly lower this Shape for inspection. |
kinematic : KinematicFacade | Namespace 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.sweepTolerance({ code|file, params, gates? |
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 }) => DfmSpecHandle | Declare 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]; name?: string }>; meshSize?: number; minSafetyFactor?: number; name?: string }) => FeaStudyHandle | Declare 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), and what it is made of. |
tube(name, { from, to, via?, od?, wall, bendRadius, system?, material?, density?, flow? }) => Shape | Bent 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. |