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.

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>; fromDXF(path: string, opts?: { units?: LengthUnit; tolerance?: number }): Promise<Sketch[]>; fromSVG(path: string, opts?: { units?: LengthUnit; tolerance?: number; curveTolerance?: number }): Promise<Sketch[]> }Parts library namespace.
Scene.toCompound() => ShapeOCCT TopoDS_Compound โ€” groups bodies without booleaning.