import_model
Import a 3D model file (STL, OBJ, 3MF, STEP) into a PreForm scene for printing, with automatic repair and unit handling. Returns the model ID for further operations.
Instructions
Import a model file (STL, OBJ, 3MF, STEP) into a scene. file must be an absolute path. Returns the model with its id. Defaults differ from the raw API: repair_behavior=REPAIR (the API default ERROR fails on slightly broken meshes most CAD tools export) and units=MILLIMETERS (use INCHES for inch files, DETECTED to let PreForm guess). After importing, the scene is re-read and the call fails with IMPORT_PRODUCED_EMPTY_SCENE if no model was added: the file is malformed, do not retry.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | ||
| name | No | ||
| scale | No | ||
| units | No | MILLIMETERS | |
| position | No | ||
| scene_id | No | Scene id; omit for the default scene | default |
| orientation | No | Euler degrees {x,y,z}, or {z_direction:[..], x_direction:[..]} unit vectors | |
| repair_behavior | No | REPAIR | |
| split_multi_model_file | No |