Files
modeling-app/docs/kcl/import.md
Jess Frazelle 9a437ca973 Updates path docs for website (#4019)
* fix docs paths for website

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix docs paths for website

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-09-27 14:26:53 -07:00

453 KiB

title, excerpt, layout
title excerpt layout
import Import a CAD file. manual

Import a CAD file.

For formats lacking unit data (such as STL, OBJ, or PLY files), the default unit of measurement is millimeters. Alternatively you may specify the unit by passing your desired measurement unit in the options parameter. When importing a GLTF file, the bin file will be imported as well. Import paths are relative to the current project directory. Note: The import command currently only works when using the native Modeling App.

import(file_path: String, options?: ImportFormat) -> ImportedGeometry

Arguments

Name Type Description Required
file_path String Yes
options ImportFormat Import format specifier No

Returns

ImportedGeometry - Data for an imported geometry.

Examples

const model = import("tests/inputs/cube.obj")

Rendered example of import 0

const model = import("tests/inputs/cube.obj", { type: "obj", units: "m" })

Rendered example of import 1

const model = import("tests/inputs/cube.gltf")

Rendered example of import 2

const model = import("tests/inputs/cube.sldprt")

Rendered example of import 3

const model = import("tests/inputs/cube.step")

Rendered example of import 4