docs / Import & export

Import & export

Bring in vendor geometry, and write models back out.

These calls read and write files, so they need the CLI (npm install -g kernelcad) or the MCP server. In a browser they raise cli.host-fs-unavailable.

Worked drafting example

One mounting plate, three dimensioning styles, and a bearing mount with a section view. Read the drafting tutorial and review workflow.

Baseline drawing of a mounting plate with a centre bore, four mounting holes and datums

Download vector PDF · Download editable source

Calls

CallWhat it does
lib : { fromSTEP(path: string): Promise<Shape>; fromBREP(path: string): Promise<Shape>; fromSTL(path: string, opts?: { tolerance?: number; allowOpen?: boolean; maxTriangles?: number }): Promise<Shape>; meshFromSTL(path: string): Promise<Shape>; fromDXF(path: string, opts?: { units?: LengthUnit; tolerance?: number }): Promise<Sketch[]>; fromSVG(path: string, opts?: { units?: LengthUnit; tolerance?: number; curveTolerance?: number }): Promise<Sketch[]>; findPart(query: string, opts?): Promise<FindPartResult>; fetchPart(idOrQuery: string, opts?): Promise<Shape>; part(request: { family: string; thread?: string; lengthMm?: number }): Promise<Shape>; stack(request: { thread: string; gripMm: number; mode?: "screw" | "bolt" }): Promise<{ lengthMm: number; screw: Shape }>; insert(shape: Shape, request: { diameterMm?: number; near?: Vec3; family: "socket-head-cap-screw" | "button-head-cap-screw" | "flat-head-countersunk"; mode?: "screw" | "bolt"; gripMm?: number; seat?: "auto" | "none" | "counterbore"; headAt?: Vec3 }): Promise<{ shape: Shape; holes: Array<{ centerMm: Vec3; direction: Vec3; diameterMm: number; depthMm: number; thread: string; fit: "close" | "normal" | "loose"; lengthMm: number; screw: Shape; headWasher?: Shape; tailWasher?: Shape; nut?: Shape }> }>; fixture: FixtureParts; standard: StandardParts }Parts library namespace.
Scene.toCompound() => ShapeGroups bodies without booleaning.