Bump modeling api & pull thru csg endpoints (#6245)

* csg-upts

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

* base

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

* do the id shit

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

* tried to run

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

* csg-upts

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

* use bens samples

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

* use bens samples

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

* gen std

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

* gen std

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

* updates

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

* updates

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

* fix;

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2025-04-10 18:30:57 -07:00
committed by GitHub
parent 843e772094
commit 35844842de
40 changed files with 6876 additions and 1002 deletions

View File

@ -178,7 +178,7 @@ description: Artifact commands intersect_cubes.kcl
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 10.0,
"distance": 20.0,
"faces": null,
"opposite": "None"
}
@ -342,7 +342,7 @@ description: Artifact commands intersect_cubes.kcl
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": -2.0,
"x": 2.0,
"y": -2.0,
"z": 0.0
}
@ -364,7 +364,7 @@ description: Artifact commands intersect_cubes.kcl
"segment": {
"type": "line",
"end": {
"x": 18.0,
"x": 12.0,
"y": -2.0,
"z": 0.0
},
@ -381,8 +381,8 @@ description: Artifact commands intersect_cubes.kcl
"segment": {
"type": "line",
"end": {
"x": 18.0,
"y": 18.0,
"x": 12.0,
"y": 8.0,
"z": 0.0
},
"relative": false
@ -398,8 +398,8 @@ description: Artifact commands intersect_cubes.kcl
"segment": {
"type": "line",
"end": {
"x": -2.0,
"y": 18.0,
"x": 2.0,
"y": 8.0,
"z": 0.0
},
"relative": false
@ -544,5 +544,41 @@ description: Artifact commands intersect_cubes.kcl
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "set_object_transform",
"object_id": "[uuid]",
"transforms": [
{
"translate": {
"property": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"set": false,
"is_local": true
},
"rotate_rpy": null,
"rotate_angle_axis": null,
"scale": null
}
]
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "boolean_intersection",
"solid_ids": [
"[uuid]",
"[uuid]"
],
"tolerance": 0.0000001
}
}
]

View File

@ -1,23 +1,23 @@
```mermaid
flowchart LR
subgraph path2 [Path]
2["Path<br>[52, 103, 0]"]
3["Segment<br>[111, 163, 0]"]
4["Segment<br>[171, 223, 0]"]
5["Segment<br>[231, 283, 0]"]
6["Segment<br>[291, 298, 0]"]
2["Path<br>[58, 113, 0]"]
3["Segment<br>[121, 177, 0]"]
4["Segment<br>[185, 241, 0]"]
5["Segment<br>[249, 305, 0]"]
6["Segment<br>[313, 320, 0]"]
7[Solid2d]
end
subgraph path24 [Path]
24["Path<br>[52, 103, 0]"]
25["Segment<br>[111, 163, 0]"]
26["Segment<br>[171, 223, 0]"]
27["Segment<br>[231, 283, 0]"]
28["Segment<br>[291, 298, 0]"]
24["Path<br>[58, 113, 0]"]
25["Segment<br>[121, 177, 0]"]
26["Segment<br>[185, 241, 0]"]
27["Segment<br>[249, 305, 0]"]
28["Segment<br>[313, 320, 0]"]
29[Solid2d]
end
1["Plane<br>[27, 44, 0]"]
8["Sweep Extrusion<br>[306, 326, 0]"]
1["Plane<br>[33, 50, 0]"]
8["Sweep Extrusion<br>[328, 354, 0]"]
9[Wall]
10[Wall]
11[Wall]
@ -32,8 +32,8 @@ flowchart LR
20["SweepEdge Adjacent"]
21["SweepEdge Opposite"]
22["SweepEdge Adjacent"]
23["Plane<br>[27, 44, 0]"]
30["Sweep Extrusion<br>[306, 326, 0]"]
23["Plane<br>[33, 50, 0]"]
30["Sweep Extrusion<br>[328, 354, 0]"]
31[Wall]
32[Wall]
33[Wall]

View File

@ -101,16 +101,20 @@ description: Result of parsing intersect_cubes.kcl
},
"operator": "-",
"right": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"raw": "10",
"name": {
"commentStart": 0,
"end": 0,
"name": "size",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 10.0,
"suffix": "None"
}
"type": "Name",
"type": "Name"
},
"start": 0,
"type": "BinaryExpression",
@ -149,16 +153,20 @@ description: Result of parsing intersect_cubes.kcl
},
"operator": "-",
"right": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"raw": "10",
"name": {
"commentStart": 0,
"end": 0,
"name": "size",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 10.0,
"suffix": "None"
}
"type": "Name",
"type": "Name"
},
"start": 0,
"type": "BinaryExpression",
@ -246,16 +254,20 @@ description: Result of parsing intersect_cubes.kcl
},
"operator": "+",
"right": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"raw": "10",
"name": {
"commentStart": 0,
"end": 0,
"name": "size",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 10.0,
"suffix": "None"
}
"type": "Name",
"type": "Name"
},
"start": 0,
"type": "BinaryExpression",
@ -294,16 +306,20 @@ description: Result of parsing intersect_cubes.kcl
},
"operator": "-",
"right": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"raw": "10",
"name": {
"commentStart": 0,
"end": 0,
"name": "size",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 10.0,
"suffix": "None"
}
"type": "Name",
"type": "Name"
},
"start": 0,
"type": "BinaryExpression",
@ -386,16 +402,20 @@ description: Result of parsing intersect_cubes.kcl
},
"operator": "+",
"right": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"raw": "10",
"name": {
"commentStart": 0,
"end": 0,
"name": "size",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 10.0,
"suffix": "None"
}
"type": "Name",
"type": "Name"
},
"start": 0,
"type": "BinaryExpression",
@ -434,16 +454,20 @@ description: Result of parsing intersect_cubes.kcl
},
"operator": "+",
"right": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"raw": "10",
"name": {
"commentStart": 0,
"end": 0,
"name": "size",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 10.0,
"suffix": "None"
}
"type": "Name",
"type": "Name"
},
"start": 0,
"type": "BinaryExpression",
@ -526,16 +550,20 @@ description: Result of parsing intersect_cubes.kcl
},
"operator": "-",
"right": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"raw": "10",
"name": {
"commentStart": 0,
"end": 0,
"name": "size",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 10.0,
"suffix": "None"
}
"type": "Name",
"type": "Name"
},
"start": 0,
"type": "BinaryExpression",
@ -574,16 +602,20 @@ description: Result of parsing intersect_cubes.kcl
},
"operator": "+",
"right": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"raw": "10",
"name": {
"commentStart": 0,
"end": 0,
"name": "size",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 10.0,
"suffix": "None"
}
"type": "Name",
"type": "Name"
},
"start": 0,
"type": "BinaryExpression",
@ -656,14 +688,38 @@ description: Result of parsing intersect_cubes.kcl
"arg": {
"commentStart": 0,
"end": 0,
"raw": "10",
"left": {
"commentStart": 0,
"end": 0,
"raw": "2",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"operator": "*",
"right": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 0,
"end": 0,
"name": "size",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 10.0,
"suffix": "None"
}
"type": "BinaryExpression",
"type": "BinaryExpression"
}
}
],
@ -719,6 +775,16 @@ description: Result of parsing intersect_cubes.kcl
"start": 0,
"type": "Identifier"
}
},
{
"type": "Parameter",
"identifier": {
"commentStart": 0,
"end": 0,
"name": "size",
"start": 0,
"type": "Identifier"
}
}
],
"start": 0,
@ -780,6 +846,18 @@ description: Result of parsing intersect_cubes.kcl
"start": 0,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"commentStart": 0,
"end": 0,
"raw": "10",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 10.0,
"suffix": "None"
}
}
],
"callee": {
@ -825,61 +903,129 @@ description: Result of parsing intersect_cubes.kcl
"type": "Identifier"
},
"init": {
"arguments": [
"body": [
{
"commentStart": 0,
"elements": [
"arguments": [
{
"commentStart": 0,
"elements": [
{
"commentStart": 0,
"end": 0,
"raw": "7",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 7.0,
"suffix": "None"
}
},
{
"commentStart": 0,
"end": 0,
"raw": "3",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 3.0,
"suffix": "None"
}
}
],
"end": 0,
"raw": "8",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 8.0,
"suffix": "None"
}
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"commentStart": 0,
"end": 0,
"raw": "8",
"raw": "5",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 8.0,
"value": 5.0,
"suffix": "None"
}
}
],
"end": 0,
"start": 0,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
],
"callee": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"name": {
"callee": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 0,
"end": 0,
"name": "cube",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 0,
"end": 0,
"name": "cube",
"start": 0,
"type": "Identifier"
"type": "CallExpression",
"type": "CallExpression"
},
"path": [],
"start": 0,
"type": "Name"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"commentStart": 0,
"end": 0,
"name": "z",
"start": 0,
"type": "Identifier"
},
"arg": {
"commentStart": 0,
"end": 0,
"raw": "1",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
}
}
],
"callee": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 0,
"end": 0,
"name": "translate",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 0,
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
}
],
"commentStart": 0,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 0,
"type": "VariableDeclarator"

View File

@ -1,14 +1,15 @@
fn cube(center) {
fn cube(center, size) {
return startSketchOn(XY)
|> startProfileAt([center[0] - 10, center[1] - 10], %)
|> line(endAbsolute = [center[0] + 10, center[1] - 10])
|> line(endAbsolute = [center[0] + 10, center[1] + 10])
|> line(endAbsolute = [center[0] - 10, center[1] + 10])
|> startProfileAt([center[0] - size, center[1] - size], %)
|> line(endAbsolute = [center[0] + size, center[1] - size])
|> line(endAbsolute = [center[0] + size, center[1] + size])
|> line(endAbsolute = [center[0] - size, center[1] + size])
|> close()
|> extrude(length = 10)
|> extrude(length = 2 * size)
}
part001 = cube([0, 0])
part002 = cube([8, 8])
part001 = cube([0, 0], 10)
part002 = cube([7, 3], 5)
|> translate(z = 1)
fullPart = intersect([part001, part002])

View File

@ -10,7 +10,7 @@ description: Operations executed intersect_cubes.kcl
"name": "cube",
"functionSourceRange": [
7,
328,
356,
0
],
"unlabeledArg": null,
@ -38,7 +38,7 @@ description: Operations executed intersect_cubes.kcl
"length": {
"value": {
"type": "Number",
"value": 10.0,
"value": 20.0,
"ty": {
"type": "Default",
"len": {
@ -75,7 +75,7 @@ description: Operations executed intersect_cubes.kcl
"name": "cube",
"functionSourceRange": [
7,
328,
356,
0
],
"unlabeledArg": null,

View File

@ -7,182 +7,365 @@ description: Variables in memory after executing intersect_cubes.kcl
"type": "Function"
},
"fullPart": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
-10.0,
-10.0
],
"tag": null,
"to": [
10.0,
-10.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
10.0,
-10.0
],
"tag": null,
"to": [
10.0,
10.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
10.0,
10.0
],
"tag": null,
"to": [
-10.0,
10.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
-10.0,
10.0
],
"tag": null,
"to": [
-10.0,
-10.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
}
],
"on": {
"type": "plane",
"type": "HomArray",
"value": [
{
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
}
},
"start": {
"from": [
-10.0,
-10.0
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
}
],
"to": [
-10.0,
-10.0
],
"units": {
"type": "Mm"
},
"tag": null,
"__geoMeta": {
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"sourceRange": []
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
-10.0,
-10.0
],
"tag": null,
"to": [
10.0,
-10.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
10.0,
-10.0
],
"tag": null,
"to": [
10.0,
10.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
10.0,
10.0
],
"tag": null,
"to": [
-10.0,
10.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
-10.0,
10.0
],
"tag": null,
"to": [
-10.0,
-10.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
}
},
"start": {
"from": [
-10.0,
-10.0
],
"to": [
-10.0,
-10.0
],
"units": {
"type": "Mm"
},
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
}
},
"height": 20.0,
"startCapId": "[uuid]",
"endCapId": "[uuid]",
"units": {
"type": "Mm"
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
}
},
"height": 10.0,
"startCapId": "[uuid]",
"endCapId": "[uuid]",
"units": {
"type": "Mm"
{
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
-10.0,
-10.0
],
"tag": null,
"to": [
10.0,
-10.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
10.0,
-10.0
],
"tag": null,
"to": [
10.0,
10.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
10.0,
10.0
],
"tag": null,
"to": [
-10.0,
10.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
-10.0,
10.0
],
"tag": null,
"to": [
-10.0,
-10.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
}
},
"start": {
"from": [
-10.0,
-10.0
],
"to": [
-10.0,
-10.0
],
"units": {
"type": "Mm"
},
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
}
},
"height": 20.0,
"startCapId": "[uuid]",
"endCapId": "[uuid]",
"units": {
"type": "Mm"
}
}
}
}
]
},
"part001": {
"type": "Solid",
@ -354,7 +537,7 @@ description: Variables in memory after executing intersect_cubes.kcl
"type": "Mm"
}
},
"height": 10.0,
"height": 20.0,
"startCapId": "[uuid]",
"endCapId": "[uuid]",
"units": {
@ -408,12 +591,12 @@ description: Variables in memory after executing intersect_cubes.kcl
"sourceRange": []
},
"from": [
-2.0,
2.0,
-2.0
],
"tag": null,
"to": [
18.0,
12.0,
-2.0
],
"type": "ToPoint",
@ -427,13 +610,13 @@ description: Variables in memory after executing intersect_cubes.kcl
"sourceRange": []
},
"from": [
18.0,
12.0,
-2.0
],
"tag": null,
"to": [
18.0,
18.0
12.0,
8.0
],
"type": "ToPoint",
"units": {
@ -446,13 +629,13 @@ description: Variables in memory after executing intersect_cubes.kcl
"sourceRange": []
},
"from": [
18.0,
18.0
12.0,
8.0
],
"tag": null,
"to": [
-2.0,
18.0
2.0,
8.0
],
"type": "ToPoint",
"units": {
@ -465,12 +648,12 @@ description: Variables in memory after executing intersect_cubes.kcl
"sourceRange": []
},
"from": [
-2.0,
18.0
2.0,
8.0
],
"tag": null,
"to": [
-2.0,
2.0,
-2.0
],
"type": "ToPoint",
@ -510,11 +693,11 @@ description: Variables in memory after executing intersect_cubes.kcl
},
"start": {
"from": [
-2.0,
2.0,
-2.0
],
"to": [
-2.0,
2.0,
-2.0
],
"units": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

@ -2,17 +2,18 @@
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing intersect_cubes.kcl
---
fn cube(center) {
fn cube(center, size) {
return startSketchOn(XY)
|> startProfileAt([center[0] - 10, center[1] - 10], %)
|> line(endAbsolute = [center[0] + 10, center[1] - 10])
|> line(endAbsolute = [center[0] + 10, center[1] + 10])
|> line(endAbsolute = [center[0] - 10, center[1] + 10])
|> startProfileAt([center[0] - size, center[1] - size], %)
|> line(endAbsolute = [center[0] + size, center[1] - size])
|> line(endAbsolute = [center[0] + size, center[1] + size])
|> line(endAbsolute = [center[0] - size, center[1] + size])
|> close()
|> extrude(length = 10)
|> extrude(length = 2 * size)
}
part001 = cube([0, 0])
part002 = cube([8, 8])
part001 = cube([0, 0], 10)
part002 = cube([7, 3], 5)
|> translate(z = 1)
fullPart = intersect([part001, part002])