From f9df7ff885b2d6ac76c739a36ad4a2a0fcf9abed Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Fri, 1 Mar 2024 12:19:24 -0800 Subject: [PATCH] import docs (#1602) Signed-off-by: Jess Frazelle --- docs/kcl/std.json | 2 +- docs/kcl/std.md | 1 + src/wasm-lib/kcl/src/std/import.rs | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/kcl/std.json b/docs/kcl/std.json index 30299680a..e7857eb91 100644 --- a/docs/kcl/std.json +++ b/docs/kcl/std.json @@ -25627,7 +25627,7 @@ { "name": "import", "summary": "Import a CAD file.", - "description": "For formats lacking unit data (STL, OBJ, PLY), the default import unit is millimeters. Otherwise you can specify the unit by passing in the options parameter. If you import a gltf file, we will try to find the bin file and import it as well.", + "description": "For formats lacking unit data (STL, OBJ, PLY), the default import unit is millimeters. Otherwise you can specify the unit by passing in the options parameter. If you import a gltf file, we will try to find the bin file and import it as well.\nImport paths are relative to the current project directory. This only works in the desktop app not in browser.", "tags": [], "args": [ { diff --git a/docs/kcl/std.md b/docs/kcl/std.md index e56935522..674753d63 100644 --- a/docs/kcl/std.md +++ b/docs/kcl/std.md @@ -4703,6 +4703,7 @@ hole(hole_sketch_group: SketchGroupSet, sketch_group: SketchGroup) -> SketchGrou Import a CAD file. For formats lacking unit data (STL, OBJ, PLY), the default import unit is millimeters. Otherwise you can specify the unit by passing in the options parameter. If you import a gltf file, we will try to find the bin file and import it as well. +Import paths are relative to the current project directory. This only works in the desktop app not in browser. ``` import(file_path: String, options: ImportFormat) -> ImportedGeometry diff --git a/src/wasm-lib/kcl/src/std/import.rs b/src/wasm-lib/kcl/src/std/import.rs index ad9a6cc34..39f151d17 100644 --- a/src/wasm-lib/kcl/src/std/import.rs +++ b/src/wasm-lib/kcl/src/std/import.rs @@ -110,6 +110,9 @@ impl From for kittycad::types::InputFormat { /// For formats lacking unit data (STL, OBJ, PLY), the default import unit is millimeters. /// Otherwise you can specify the unit by passing in the options parameter. /// If you import a gltf file, we will try to find the bin file and import it as well. +/// +/// Import paths are relative to the current project directory. This only works in the desktop app +/// not in browser. pub async fn import(args: Args) -> Result { let (file_path, options): (String, Option) = args.get_import_data()?; @@ -121,6 +124,9 @@ pub async fn import(args: Args) -> Result { /// For formats lacking unit data (STL, OBJ, PLY), the default import unit is millimeters. /// Otherwise you can specify the unit by passing in the options parameter. /// If you import a gltf file, we will try to find the bin file and import it as well. +/// +/// Import paths are relative to the current project directory. This only works in the desktop app +/// not in browser. #[stdlib { name = "import", }]