Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 0 additions & 80 deletions docs/kcl/import.md

This file was deleted.

381 changes: 0 additions & 381 deletions docs/kcl/std.json
Original file line number Diff line number Diff line change
Expand Up @@ -99073,387 +99073,6 @@
"// Hollow a sketch on face object.\nsize = 100\ncase = startSketchOn(-XZ)\n |> startProfileAt([-size, -size], %)\n |> line(end = [2 * size, 0])\n |> line(end = [0, 2 * size])\n |> tangentialArcTo([-size, size], %)\n |> close()\n |> extrude(length = 65)\n\nthing1 = startSketchOn(case, 'end')\n |> circle(center = [-size / 2, -size / 2], radius = 25)\n |> extrude(length = 50)\n\nthing2 = startSketchOn(case, 'end')\n |> circle(center = [size / 2, -size / 2], radius = 25)\n |> extrude(length = 50)\n\nhollow(0.5, case)"
]
},
{
"name": "import",
"summary": "Import a CAD file.",
"description": "**DEPRECATED** Prefer to use import statements.\n\nFor 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.\n\nNote: The import command currently only works when using the native Design Studio.",
"tags": [],
"keywordArguments": false,
"args": [
{
"name": "filePath",
"type": "String",
"schema": {
"$schema": "https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema",
"title": "String",
"type": "string"
},
"required": true,
"includeInSnippet": true,
"labelRequired": true
},
{
"name": "options",
"type": "ImportFormat",
"schema": {
"$schema": "https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema",
"title": "Nullable_ImportFormat",
"allOf": [
{
"$ref": "#/components/schemas/ImportFormat"
}
],
"nullable": true,
"definitions": {
"ImportFormat": {
"description": "Import format specifier",
"oneOf": [
{
"description": "Autodesk Filmbox (FBX) format",
"type": "object",
"required": [
"format"
],
"properties": {
"format": {
"type": "string",
"enum": [
"fbx"
]
}
}
},
{
"description": "Binary glTF 2.0. We refer to this as glTF since that is how our customers refer to it, but this can also import binary glTF (glb).",
"type": "object",
"required": [
"format"
],
"properties": {
"format": {
"type": "string",
"enum": [
"gltf"
]
}
}
},
{
"description": "Wavefront OBJ format.",
"type": "object",
"required": [
"format",
"units"
],
"properties": {
"format": {
"type": "string",
"enum": [
"obj"
]
},
"coords": {
"description": "Co-ordinate system of input data. Defaults to the [KittyCAD co-ordinate system.",
"allOf": [
{
"$ref": "#/components/schemas/System"
}
],
"nullable": true
},
"units": {
"description": "The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc. Defaults to millimeters.",
"allOf": [
{
"$ref": "#/components/schemas/UnitLength"
}
]
}
}
},
{
"description": "The PLY Polygon File Format.",
"type": "object",
"required": [
"format",
"units"
],
"properties": {
"format": {
"type": "string",
"enum": [
"ply"
]
},
"coords": {
"description": "Co-ordinate system of input data. Defaults to the [KittyCAD co-ordinate system.",
"allOf": [
{
"$ref": "#/components/schemas/System"
}
],
"nullable": true
},
"units": {
"description": "The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc. Defaults to millimeters.",
"allOf": [
{
"$ref": "#/components/schemas/UnitLength"
}
]
}
}
},
{
"description": "SolidWorks part (SLDPRT) format.",
"type": "object",
"required": [
"format"
],
"properties": {
"format": {
"type": "string",
"enum": [
"sldprt"
]
}
}
},
{
"description": "ISO 10303-21 (STEP) format.",
"type": "object",
"required": [
"format"
],
"properties": {
"format": {
"type": "string",
"enum": [
"step"
]
}
}
},
{
"description": "ST**ereo**L**ithography format.",
"type": "object",
"required": [
"format",
"units"
],
"properties": {
"format": {
"type": "string",
"enum": [
"stl"
]
},
"coords": {
"description": "Co-ordinate system of input data. Defaults to the [KittyCAD co-ordinate system.",
"allOf": [
{
"$ref": "#/components/schemas/System"
}
],
"nullable": true
},
"units": {
"description": "The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc. Defaults to millimeters.",
"allOf": [
{
"$ref": "#/components/schemas/UnitLength"
}
]
}
}
}
]
},
"System": {
"description": "Co-ordinate system definition.\n\nThe `up` axis must be orthogonal to the `forward` axis.\n\nSee [cglearn.eu] for background reading.\n\n[cglearn.eu](https://cglearn.eu/pub/computer-graphics/introduction-to-geometry#material-coordinate-systems-1)",
"type": "object",
"required": [
"forward",
"up"
],
"properties": {
"forward": {
"description": "Axis the front face of a model looks along.",
"allOf": [
{
"$ref": "#/components/schemas/AxisDirectionPair"
}
]
},
"up": {
"description": "Axis pointing up and away from a model.",
"allOf": [
{
"$ref": "#/components/schemas/AxisDirectionPair"
}
]
}
}
},
"AxisDirectionPair": {
"description": "An [`Axis`] paired with a [`Direction`].",
"type": "object",
"required": [
"axis",
"direction"
],
"properties": {
"axis": {
"description": "Axis specifier.",
"allOf": [
{
"$ref": "#/components/schemas/Axis"
}
]
},
"direction": {
"description": "Specifies which direction the axis is pointing.",
"allOf": [
{
"$ref": "#/components/schemas/Direction"
}
]
}
}
},
"Axis": {
"description": "Co-ordinate axis specifier.\n\nSee [cglearn.eu] for background reading.\n\n[cglearn.eu]: https://cglearn.eu/pub/computer-graphics/introduction-to-geometry#material-coordinate-systems-1",
"oneOf": [
{
"description": "'Y' axis.",
"type": "string",
"enum": [
"y"
]
},
{
"description": "'Z' axis.",
"type": "string",
"enum": [
"z"
]
}
]
},
"Direction": {
"description": "Specifies the sign of a co-ordinate axis.",
"oneOf": [
{
"description": "Increasing numbers.",
"type": "string",
"enum": [
"positive"
]
},
{
"description": "Decreasing numbers.",
"type": "string",
"enum": [
"negative"
]
}
]
},
"UnitLength": {
"description": "The valid types of length units.",
"oneOf": [
{
"description": "Centimeters <https://en.wikipedia.org/wiki/Centimeter>",
"type": "string",
"enum": [
"cm"
]
},
{
"description": "Feet <https://en.wikipedia.org/wiki/Foot_(unit)>",
"type": "string",
"enum": [
"ft"
]
},
{
"description": "Inches <https://en.wikipedia.org/wiki/Inch>",
"type": "string",
"enum": [
"in"
]
},
{
"description": "Meters <https://en.wikipedia.org/wiki/Meter>",
"type": "string",
"enum": [
"m"
]
},
{
"description": "Millimeters <https://en.wikipedia.org/wiki/Millimeter>",
"type": "string",
"enum": [
"mm"
]
},
{
"description": "Yards <https://en.wikipedia.org/wiki/Yard>",
"type": "string",
"enum": [
"yd"
]
}
]
}
}
},
"required": false,
"labelRequired": true
}
],
"returnValue": {
"name": "",
"type": "ImportedGeometry",
"schema": {
"$schema": "https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema",
"title": "ImportedGeometry",
"description": "Data for an imported geometry.",
"type": "object",
"required": [
"id",
"value"
],
"properties": {
"id": {
"description": "The ID of the imported geometry.",
"type": "string",
"format": "uuid"
},
"value": {
"description": "The original file paths.",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"required": true,
"includeInSnippet": true,
"labelRequired": true
},
"unpublished": false,
"deprecated": true,
"examples": [
"model = import(\"tests/inputs/cube.obj\")",
"model = import(\"tests/inputs/cube.obj\", { format = \"obj\", units = \"m\" })",
"model = import(\"tests/inputs/cube.gltf\")",
"model = import(\"tests/inputs/cube.sldprt\")",
"model = import(\"tests/inputs/cube.step\")",
"import height, buildSketch from \"common.kcl\"\n\nplane = XZ\nmargin = 2\ns1 = buildSketch(plane, [0, 0])\ns2 = buildSketch(plane, [0, height() + margin])"
]
},
{
"name": "int",
"summary": "Convert a number to an integer.",
Expand Down
2 changes: 1 addition & 1 deletion docs/kcl/types/KclValue.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ Data for an imported geometry.

| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: [`ImportedGeometry`](/docs/kcl/types/ImportedGeometry)| | No |
| `type` |enum: `ImportedGeometry`| | No |
| `id` |[`string`](/docs/kcl/types/string)| The ID of the imported geometry. | No |
| `value` |`[` [`string`](/docs/kcl/types/string) `]`| The original file paths. | No |

Expand Down
Loading
Loading