Files
modeling-app/rust/kcl-lib/tests/sketch-on-chamfer-two-times/program_memory.snap

2266 lines
54 KiB
Plaintext
Raw Normal View History

---
source: kcl-lib/src/simulation_tests.rs
description: Variables in memory after executing sketch-on-chamfer-two-times.kcl
---
{
"extrude001": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 148,
"end": 169,
"start": 148,
"type": "TagDeclarator",
"value": "rectangleSegmentA001"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 253,
"end": 259,
"start": 253,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 423,
"end": 429,
"start": 423,
"type": "TagDeclarator",
"value": "seg02"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 580,
"end": 586,
"start": 580,
"type": "TagDeclarator",
"value": "seg04"
},
"type": "chamfer"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 653,
"end": 659,
"start": 653,
"type": "TagDeclarator",
"value": "seg03"
},
"type": "chamfer"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
75.8,
317.2
],
"tag": {
"commentStart": 148,
"end": 169,
"start": 148,
"type": "TagDeclarator",
"value": "rectangleSegmentA001"
},
"to": [
344.23,
317.2
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
344.23,
317.2
],
"tag": {
"commentStart": 253,
"end": 259,
"start": 253,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
344.23,
99.94
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
344.23,
99.94
],
"tag": null,
"to": [
75.8,
99.94
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
75.8,
99.94
],
"tag": {
"commentStart": 423,
"end": 429,
"start": 423,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
75.8,
317.2
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
75.8,
317.2
],
"tag": null,
"to": [
75.8,
317.2
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
}
],
"on": {
"artifactId": "[uuid]",
"id": "[uuid]",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"units": {
"type": "Mm"
}
},
"type": "plane",
"value": "XZ",
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {
"type": "Unknown"
}
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0,
"units": {
"type": "Unknown"
}
}
},
"start": {
"from": [
75.8,
317.2
],
"to": [
75.8,
317.2
],
"units": {
"type": "Mm"
},
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
}
},
"tags": {
"rectangleSegmentA001": {
"type": "TagIdentifier",
"value": "rectangleSegmentA001"
},
"seg01": {
"type": "TagIdentifier",
"value": "seg01"
},
"seg02": {
"type": "TagIdentifier",
"value": "seg02"
},
"seg03": {
"type": "TagIdentifier",
"value": "seg03"
},
"seg04": {
"type": "TagIdentifier",
"value": "seg04"
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
}
},
"height": 100.0,
"startCapId": "[uuid]",
"endCapId": "[uuid]",
"edgeCuts": [
{
"type": "fillet",
"id": "[uuid]",
"radius": {
"n": 20.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"edgeId": "[uuid]",
"tag": null
},
{
"type": "chamfer",
"id": "[uuid]",
"length": {
"n": 50.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"edgeId": "[uuid]",
"tag": {
"commentStart": 580,
"end": 586,
"start": 580,
"type": "TagDeclarator",
"value": "seg04"
}
},
{
"type": "chamfer",
"id": "[uuid]",
"length": {
"n": 50.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"edgeId": "[uuid]",
"tag": {
"commentStart": 653,
"end": 659,
"start": 653,
"type": "TagDeclarator",
"value": "seg03"
}
}
],
"units": {
"type": "Mm"
Add clone (#5462) * updates 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> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> update the extrude idds Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fix sample Signed-off-by: Jess Frazelle <github@jessfraz.com> better docs Signed-off-by: Jess Frazelle <github@jessfraz.com> fix the start and end tag Signed-off-by: Jess Frazelle <github@jessfraz.com> better docs Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> new tests Signed-off-by: Jess Frazelle <github@jessfraz.com> codespell 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> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix examples Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix some stuff Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes 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> * add another test for fillet Signed-off-by: Jess Frazelle <github@jessfraz.com> * Update rust/kcl-lib/src/std/clone.rs Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * add sweep test Signed-off-by: Jess Frazelle <github@jessfraz.com> * revolve test; Signed-off-by: Jess Frazelle <github@jessfraz.com> * Update rust/kcl-lib/src/std/clone.rs Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * add another test for fillet Signed-off-by: Jess Frazelle <github@jessfraz.com> * allow cloning an imported geometry; Signed-off-by: Jess Frazelle <github@jessfraz.com> * allow for imported geometry Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * update docs Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-04-23 21:26:09 -07:00
},
"sectional": false
}
},
"extrude002": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 1271,
"end": 1292,
"start": 1271,
"type": "TagDeclarator",
"value": "rectangleSegmentA002"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 1376,
"end": 1397,
"start": 1376,
"type": "TagDeclarator",
"value": "rectangleSegmentB001"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 1499,
"end": 1520,
"start": 1499,
"type": "TagDeclarator",
"value": "rectangleSegmentC001"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
159.25,
278.35
],
"tag": {
"commentStart": 1271,
"end": 1292,
"start": 1271,
"type": "TagDeclarator",
"value": "rectangleSegmentA002"
},
"to": [
200.07,
278.35
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
200.07,
278.35
],
"tag": {
"commentStart": 1376,
"end": 1397,
"start": 1376,
"type": "TagDeclarator",
"value": "rectangleSegmentB001"
},
"to": [
200.07,
146.08
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
200.07,
146.08
],
"tag": {
"commentStart": 1499,
"end": 1520,
"start": 1499,
"type": "TagDeclarator",
"value": "rectangleSegmentC001"
},
"to": [
159.25,
146.08
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
159.25,
146.08
],
"tag": null,
"to": [
159.25,
278.35
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
159.25,
278.35
],
"tag": null,
"to": [
159.25,
278.35
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
}
],
"on": {
"type": "face",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "seg03",
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {
"type": "Unknown"
}
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0,
"units": {
"type": "Unknown"
}
},
"solid": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 148,
"end": 169,
"start": 148,
"type": "TagDeclarator",
"value": "rectangleSegmentA001"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 253,
"end": 259,
"start": 253,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 423,
"end": 429,
"start": 423,
"type": "TagDeclarator",
"value": "seg02"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 580,
"end": 586,
"start": 580,
"type": "TagDeclarator",
"value": "seg04"
},
"type": "chamfer"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 653,
"end": 659,
"start": 653,
"type": "TagDeclarator",
"value": "seg03"
},
"type": "chamfer"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
75.8,
317.2
],
"tag": {
"commentStart": 148,
"end": 169,
"start": 148,
"type": "TagDeclarator",
"value": "rectangleSegmentA001"
},
"to": [
344.23,
317.2
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
344.23,
317.2
],
"tag": {
"commentStart": 253,
"end": 259,
"start": 253,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
344.23,
99.94
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
344.23,
99.94
],
"tag": null,
"to": [
75.8,
99.94
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
75.8,
99.94
],
"tag": {
"commentStart": 423,
"end": 429,
"start": 423,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
75.8,
317.2
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
75.8,
317.2
],
"tag": null,
"to": [
75.8,
317.2
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
}
],
"on": {
"artifactId": "[uuid]",
"id": "[uuid]",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"units": {
"type": "Mm"
}
},
"type": "plane",
"value": "XZ",
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {
"type": "Unknown"
}
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0,
"units": {
"type": "Unknown"
}
}
},
"start": {
"from": [
75.8,
317.2
],
"to": [
75.8,
317.2
],
"units": {
"type": "Mm"
},
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
}
},
"tags": {
"rectangleSegmentA001": {
"type": "TagIdentifier",
"value": "rectangleSegmentA001"
},
"seg01": {
"type": "TagIdentifier",
"value": "seg01"
},
"seg02": {
"type": "TagIdentifier",
"value": "seg02"
},
"seg03": {
"type": "TagIdentifier",
"value": "seg03"
},
"seg04": {
"type": "TagIdentifier",
"value": "seg04"
}
},
"artifactId": "[uuid]",
KCL: Patterns of patterns can use the original sketch/solid as target (#5284) Right now, if you model something like this box with a button: <img width="413" alt="Screenshot 2025-02-06 at 3 08 03 PM" src="https://github.com/user-attachments/assets/04818a70-7cf3-4ee3-b8c5-df5959ac10db" /> Let's say you want to pattern the button, and repeat it a second time. If you try, you'll actually pattern the entire model (box + button). <img width="486" alt="Screenshot 2025-02-06 at 3 08 52 PM" src="https://github.com/user-attachments/assets/09fc28d9-5d80-4ab3-b4dc-b8de2945fcba" /> Why? Because right now, when you sketch on a face (like the button was), both the box and the button share the same ID. All extrusions from a solid will share the same ID, because they all refer to the same composite solid. This is helpful in some ways -- arguably the solid _is_ just one big complex shape now -- but it's not helpful in other ways. What if I want to only pattern the button? Luckily there's an original ID for the button part, which is still stored. So we just need a way to tell the pattern stdlib functions whether to use the target's main ID or its original ID. This PR adds a new optional bool, `useOriginal`, to patterns. It's false by default, to keep backwards-compatibility (make sure that old KCL code doesn't change). This PR is based on https://github.com/KittyCAD/modeling-app/pull/3914. It's based on work Serena and I are doing to fix a bug (engine does not allow patterning a 3D solid which was sketched on a face of another solid). @gserena01 our test program is now: ``` w = 400 case = startSketchOn('XY') |> startProfileAt([-w, -w], %) |> line(endAbsolute = [-w, w]) |> line(endAbsolute = [w, -w]) |> line(endAbsolute = [-w, -w]) |> close() |> extrude(length = 200) bump1 = startSketchOn(case, 'end') |> circle({ center = [-50, -50], radius = 40 }, %) |> extrude(length = 20) // We pass in "bump1" here since we want to pattern just this object on the face. useOriginal = true target = bump1 transform = { axis = [1, 0, 0], instances = 3, distance = -100 } patternLinear3d(transform, target, useOriginal) ``` If you change the `useOriginal = true` to `false` you can see the difference.
2025-02-06 17:46:47 -06:00
"originalId": "[uuid]",
"units": {
"type": "Mm"
}
},
"height": 100.0,
"startCapId": "[uuid]",
"endCapId": "[uuid]",
"edgeCuts": [
{
"type": "fillet",
"id": "[uuid]",
"radius": {
"n": 20.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"edgeId": "[uuid]",
"tag": null
},
{
"type": "chamfer",
"id": "[uuid]",
"length": {
"n": 50.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"edgeId": "[uuid]",
"tag": {
"commentStart": 580,
"end": 586,
"start": 580,
"type": "TagDeclarator",
"value": "seg04"
}
},
{
"type": "chamfer",
"id": "[uuid]",
"length": {
"n": 50.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"edgeId": "[uuid]",
"tag": {
"commentStart": 653,
"end": 659,
"start": 653,
"type": "TagDeclarator",
"value": "seg03"
}
}
],
"units": {
"type": "Mm"
Add clone (#5462) * updates 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> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> update the extrude idds Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fix sample Signed-off-by: Jess Frazelle <github@jessfraz.com> better docs Signed-off-by: Jess Frazelle <github@jessfraz.com> fix the start and end tag Signed-off-by: Jess Frazelle <github@jessfraz.com> better docs Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> new tests Signed-off-by: Jess Frazelle <github@jessfraz.com> codespell 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> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix examples Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix some stuff Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes 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> * add another test for fillet Signed-off-by: Jess Frazelle <github@jessfraz.com> * Update rust/kcl-lib/src/std/clone.rs Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * add sweep test Signed-off-by: Jess Frazelle <github@jessfraz.com> * revolve test; Signed-off-by: Jess Frazelle <github@jessfraz.com> * Update rust/kcl-lib/src/std/clone.rs Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * add another test for fillet Signed-off-by: Jess Frazelle <github@jessfraz.com> * allow cloning an imported geometry; Signed-off-by: Jess Frazelle <github@jessfraz.com> * allow for imported geometry Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * update docs Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-04-23 21:26:09 -07:00
},
"sectional": false
},
"units": {
"type": "Mm"
}
},
"start": {
"from": [
159.25,
278.35
],
"to": [
159.25,
278.35
],
"units": {
"type": "Mm"
},
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
}
},
"tags": {
"rectangleSegmentA002": {
"type": "TagIdentifier",
"value": "rectangleSegmentA002"
},
"rectangleSegmentB001": {
"type": "TagIdentifier",
"value": "rectangleSegmentB001"
},
"rectangleSegmentC001": {
"type": "TagIdentifier",
"value": "rectangleSegmentC001"
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
}
},
"height": 50.0,
"startCapId": null,
"endCapId": "[uuid]",
"units": {
"type": "Mm"
Add clone (#5462) * updates 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> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> update the extrude idds Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fix sample Signed-off-by: Jess Frazelle <github@jessfraz.com> better docs Signed-off-by: Jess Frazelle <github@jessfraz.com> fix the start and end tag Signed-off-by: Jess Frazelle <github@jessfraz.com> better docs Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> new tests Signed-off-by: Jess Frazelle <github@jessfraz.com> codespell 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> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix examples Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix some stuff Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes 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> * add another test for fillet Signed-off-by: Jess Frazelle <github@jessfraz.com> * Update rust/kcl-lib/src/std/clone.rs Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * add sweep test Signed-off-by: Jess Frazelle <github@jessfraz.com> * revolve test; Signed-off-by: Jess Frazelle <github@jessfraz.com> * Update rust/kcl-lib/src/std/clone.rs Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * add another test for fillet Signed-off-by: Jess Frazelle <github@jessfraz.com> * allow cloning an imported geometry; Signed-off-by: Jess Frazelle <github@jessfraz.com> * allow for imported geometry Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * update docs Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-04-23 21:26:09 -07:00
},
"sectional": false
}
},
"rectangleSegmentA001": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "rectangleSegmentA001"
},
"rectangleSegmentA002": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "rectangleSegmentA002"
},
"rectangleSegmentA003": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "rectangleSegmentA003"
},
"rectangleSegmentB001": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "rectangleSegmentB001"
},
"rectangleSegmentB002": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "rectangleSegmentB002"
},
"rectangleSegmentC001": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "rectangleSegmentC001"
},
"rectangleSegmentC002": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "rectangleSegmentC002"
},
"seg01": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg01"
},
"seg02": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg02"
},
"seg03": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg03"
},
"seg04": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "seg04"
},
"sketch001": {
"type": "Sketch",
"value": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
75.8,
317.2
],
"tag": {
"commentStart": 148,
"end": 169,
"start": 148,
"type": "TagDeclarator",
"value": "rectangleSegmentA001"
},
"to": [
344.23,
317.2
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
344.23,
317.2
],
"tag": {
"commentStart": 253,
"end": 259,
"start": 253,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
344.23,
99.94
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
344.23,
99.94
],
"tag": null,
"to": [
75.8,
99.94
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
75.8,
99.94
],
"tag": {
"commentStart": 423,
"end": 429,
"start": 423,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
75.8,
317.2
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
75.8,
317.2
],
"tag": null,
"to": [
75.8,
317.2
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
}
],
"on": {
"artifactId": "[uuid]",
"id": "[uuid]",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"units": {
"type": "Mm"
}
},
"type": "plane",
"value": "XZ",
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {
"type": "Unknown"
}
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0,
"units": {
"type": "Unknown"
}
}
},
"start": {
"from": [
75.8,
317.2
],
"to": [
75.8,
317.2
],
"units": {
"type": "Mm"
},
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
}
},
"tags": {
"rectangleSegmentA001": {
"type": "TagIdentifier",
"value": "rectangleSegmentA001"
},
"seg01": {
"type": "TagIdentifier",
"value": "seg01"
},
"seg02": {
"type": "TagIdentifier",
"value": "seg02"
},
"seg03": {
"type": "TagIdentifier",
"value": "seg03"
},
"seg04": {
"type": "TagIdentifier",
"value": "seg04"
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
}
}
},
"sketch002": {
"type": "Sketch",
"value": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
159.25,
278.35
],
"tag": {
"commentStart": 1271,
"end": 1292,
"start": 1271,
"type": "TagDeclarator",
"value": "rectangleSegmentA002"
},
"to": [
200.07,
278.35
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
200.07,
278.35
],
"tag": {
"commentStart": 1376,
"end": 1397,
"start": 1376,
"type": "TagDeclarator",
"value": "rectangleSegmentB001"
},
"to": [
200.07,
146.08
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
200.07,
146.08
],
"tag": {
"commentStart": 1499,
"end": 1520,
"start": 1499,
"type": "TagDeclarator",
"value": "rectangleSegmentC001"
},
"to": [
159.25,
146.08
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
159.25,
146.08
],
"tag": null,
"to": [
159.25,
278.35
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
159.25,
278.35
],
"tag": null,
"to": [
159.25,
278.35
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
}
],
"on": {
"type": "face",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "seg03",
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {
"type": "Unknown"
}
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0,
"units": {
"type": "Unknown"
}
},
"solid": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 148,
"end": 169,
"start": 148,
"type": "TagDeclarator",
"value": "rectangleSegmentA001"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 253,
"end": 259,
"start": 253,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 423,
"end": 429,
"start": 423,
"type": "TagDeclarator",
"value": "seg02"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 580,
"end": 586,
"start": 580,
"type": "TagDeclarator",
"value": "seg04"
},
"type": "chamfer"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 653,
"end": 659,
"start": 653,
"type": "TagDeclarator",
"value": "seg03"
},
"type": "chamfer"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
75.8,
317.2
],
"tag": {
"commentStart": 148,
"end": 169,
"start": 148,
"type": "TagDeclarator",
"value": "rectangleSegmentA001"
},
"to": [
344.23,
317.2
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
344.23,
317.2
],
"tag": {
"commentStart": 253,
"end": 259,
"start": 253,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
344.23,
99.94
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
344.23,
99.94
],
"tag": null,
"to": [
75.8,
99.94
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
75.8,
99.94
],
"tag": {
"commentStart": 423,
"end": 429,
"start": 423,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
75.8,
317.2
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
75.8,
317.2
],
"tag": null,
"to": [
75.8,
317.2
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
}
],
"on": {
"artifactId": "[uuid]",
"id": "[uuid]",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"units": {
"type": "Mm"
}
},
"type": "plane",
"value": "XZ",
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {
"type": "Unknown"
}
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0,
"units": {
"type": "Unknown"
}
}
},
"start": {
"from": [
75.8,
317.2
],
"to": [
75.8,
317.2
],
"units": {
"type": "Mm"
},
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
}
},
"tags": {
"rectangleSegmentA001": {
"type": "TagIdentifier",
"value": "rectangleSegmentA001"
},
"seg01": {
"type": "TagIdentifier",
"value": "seg01"
},
"seg02": {
"type": "TagIdentifier",
"value": "seg02"
},
"seg03": {
"type": "TagIdentifier",
"value": "seg03"
},
"seg04": {
"type": "TagIdentifier",
"value": "seg04"
}
},
"artifactId": "[uuid]",
KCL: Patterns of patterns can use the original sketch/solid as target (#5284) Right now, if you model something like this box with a button: <img width="413" alt="Screenshot 2025-02-06 at 3 08 03 PM" src="https://github.com/user-attachments/assets/04818a70-7cf3-4ee3-b8c5-df5959ac10db" /> Let's say you want to pattern the button, and repeat it a second time. If you try, you'll actually pattern the entire model (box + button). <img width="486" alt="Screenshot 2025-02-06 at 3 08 52 PM" src="https://github.com/user-attachments/assets/09fc28d9-5d80-4ab3-b4dc-b8de2945fcba" /> Why? Because right now, when you sketch on a face (like the button was), both the box and the button share the same ID. All extrusions from a solid will share the same ID, because they all refer to the same composite solid. This is helpful in some ways -- arguably the solid _is_ just one big complex shape now -- but it's not helpful in other ways. What if I want to only pattern the button? Luckily there's an original ID for the button part, which is still stored. So we just need a way to tell the pattern stdlib functions whether to use the target's main ID or its original ID. This PR adds a new optional bool, `useOriginal`, to patterns. It's false by default, to keep backwards-compatibility (make sure that old KCL code doesn't change). This PR is based on https://github.com/KittyCAD/modeling-app/pull/3914. It's based on work Serena and I are doing to fix a bug (engine does not allow patterning a 3D solid which was sketched on a face of another solid). @gserena01 our test program is now: ``` w = 400 case = startSketchOn('XY') |> startProfileAt([-w, -w], %) |> line(endAbsolute = [-w, w]) |> line(endAbsolute = [w, -w]) |> line(endAbsolute = [-w, -w]) |> close() |> extrude(length = 200) bump1 = startSketchOn(case, 'end') |> circle({ center = [-50, -50], radius = 40 }, %) |> extrude(length = 20) // We pass in "bump1" here since we want to pattern just this object on the face. useOriginal = true target = bump1 transform = { axis = [1, 0, 0], instances = 3, distance = -100 } patternLinear3d(transform, target, useOriginal) ``` If you change the `useOriginal = true` to `false` you can see the difference.
2025-02-06 17:46:47 -06:00
"originalId": "[uuid]",
"units": {
"type": "Mm"
}
},
"height": 100.0,
"startCapId": "[uuid]",
"endCapId": "[uuid]",
"edgeCuts": [
{
"type": "fillet",
"id": "[uuid]",
"radius": {
"n": 20.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"edgeId": "[uuid]",
"tag": null
},
{
"type": "chamfer",
"id": "[uuid]",
"length": {
"n": 50.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"edgeId": "[uuid]",
"tag": {
"commentStart": 580,
"end": 586,
"start": 580,
"type": "TagDeclarator",
"value": "seg04"
}
},
{
"type": "chamfer",
"id": "[uuid]",
"length": {
"n": 50.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"edgeId": "[uuid]",
"tag": {
"commentStart": 653,
"end": 659,
"start": 653,
"type": "TagDeclarator",
"value": "seg03"
}
}
],
"units": {
"type": "Mm"
Add clone (#5462) * updates 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> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> update the extrude idds Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fix sample Signed-off-by: Jess Frazelle <github@jessfraz.com> better docs Signed-off-by: Jess Frazelle <github@jessfraz.com> fix the start and end tag Signed-off-by: Jess Frazelle <github@jessfraz.com> better docs Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> new tests Signed-off-by: Jess Frazelle <github@jessfraz.com> codespell 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> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix examples Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix some stuff Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes 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> * add another test for fillet Signed-off-by: Jess Frazelle <github@jessfraz.com> * Update rust/kcl-lib/src/std/clone.rs Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * add sweep test Signed-off-by: Jess Frazelle <github@jessfraz.com> * revolve test; Signed-off-by: Jess Frazelle <github@jessfraz.com> * Update rust/kcl-lib/src/std/clone.rs Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * add another test for fillet Signed-off-by: Jess Frazelle <github@jessfraz.com> * allow cloning an imported geometry; Signed-off-by: Jess Frazelle <github@jessfraz.com> * allow for imported geometry Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * update docs Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-04-23 21:26:09 -07:00
},
"sectional": false
},
"units": {
"type": "Mm"
}
},
"start": {
"from": [
159.25,
278.35
],
"to": [
159.25,
278.35
],
"units": {
"type": "Mm"
},
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
}
},
"tags": {
"rectangleSegmentA002": {
"type": "TagIdentifier",
"value": "rectangleSegmentA002"
},
"rectangleSegmentB001": {
"type": "TagIdentifier",
"value": "rectangleSegmentB001"
},
"rectangleSegmentC001": {
"type": "TagIdentifier",
"value": "rectangleSegmentC001"
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
}
}
},
"sketch003": {
"type": "Sketch",
"value": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
-69.1,
277.34
],
"tag": {
"commentStart": 803,
"end": 824,
"start": 803,
"type": "TagDeclarator",
"value": "rectangleSegmentA003"
},
"to": [
-27.62,
277.34
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
-27.62,
277.34
],
"tag": {
"commentStart": 907,
"end": 928,
"start": 907,
"type": "TagDeclarator",
"value": "rectangleSegmentB002"
},
"to": [
-27.62,
172.54
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
-27.62,
172.54
],
"tag": {
"commentStart": 1030,
"end": 1051,
"start": 1030,
"type": "TagDeclarator",
"value": "rectangleSegmentC002"
},
"to": [
-69.1,
172.54
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
-69.1,
172.54
],
"tag": null,
"to": [
-69.1,
277.34
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
-69.1,
277.34
],
"tag": null,
"to": [
-69.1,
277.34
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
}
],
"on": {
"type": "face",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "seg04",
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {
"type": "Unknown"
}
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0,
"units": {
"type": "Unknown"
}
},
"solid": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 148,
"end": 169,
"start": 148,
"type": "TagDeclarator",
"value": "rectangleSegmentA001"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 253,
"end": 259,
"start": 253,
"type": "TagDeclarator",
"value": "seg01"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 423,
"end": 429,
"start": 423,
"type": "TagDeclarator",
"value": "seg02"
},
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 580,
"end": 586,
"start": 580,
"type": "TagDeclarator",
"value": "seg04"
},
"type": "chamfer"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [],
"tag": {
"commentStart": 653,
"end": 659,
"start": 653,
"type": "TagDeclarator",
"value": "seg03"
},
"type": "chamfer"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
75.8,
317.2
],
"tag": {
"commentStart": 148,
"end": 169,
"start": 148,
"type": "TagDeclarator",
"value": "rectangleSegmentA001"
},
"to": [
344.23,
317.2
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
344.23,
317.2
],
"tag": {
"commentStart": 253,
"end": 259,
"start": 253,
"type": "TagDeclarator",
"value": "seg01"
},
"to": [
344.23,
99.94
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
344.23,
99.94
],
"tag": null,
"to": [
75.8,
99.94
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
75.8,
99.94
],
"tag": {
"commentStart": 423,
"end": 429,
"start": 423,
"type": "TagDeclarator",
"value": "seg02"
},
"to": [
75.8,
317.2
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
75.8,
317.2
],
"tag": null,
"to": [
75.8,
317.2
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
}
],
"on": {
"artifactId": "[uuid]",
"id": "[uuid]",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"units": {
"type": "Mm"
}
},
"type": "plane",
"value": "XZ",
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {
"type": "Unknown"
}
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0,
"units": {
"type": "Unknown"
}
}
},
"start": {
"from": [
75.8,
317.2
],
"to": [
75.8,
317.2
],
"units": {
"type": "Mm"
},
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
}
},
"tags": {
"rectangleSegmentA001": {
"type": "TagIdentifier",
"value": "rectangleSegmentA001"
},
"seg01": {
"type": "TagIdentifier",
"value": "seg01"
},
"seg02": {
"type": "TagIdentifier",
"value": "seg02"
},
"seg03": {
"type": "TagIdentifier",
"value": "seg03"
},
"seg04": {
"type": "TagIdentifier",
"value": "seg04"
}
},
"artifactId": "[uuid]",
KCL: Patterns of patterns can use the original sketch/solid as target (#5284) Right now, if you model something like this box with a button: <img width="413" alt="Screenshot 2025-02-06 at 3 08 03 PM" src="https://github.com/user-attachments/assets/04818a70-7cf3-4ee3-b8c5-df5959ac10db" /> Let's say you want to pattern the button, and repeat it a second time. If you try, you'll actually pattern the entire model (box + button). <img width="486" alt="Screenshot 2025-02-06 at 3 08 52 PM" src="https://github.com/user-attachments/assets/09fc28d9-5d80-4ab3-b4dc-b8de2945fcba" /> Why? Because right now, when you sketch on a face (like the button was), both the box and the button share the same ID. All extrusions from a solid will share the same ID, because they all refer to the same composite solid. This is helpful in some ways -- arguably the solid _is_ just one big complex shape now -- but it's not helpful in other ways. What if I want to only pattern the button? Luckily there's an original ID for the button part, which is still stored. So we just need a way to tell the pattern stdlib functions whether to use the target's main ID or its original ID. This PR adds a new optional bool, `useOriginal`, to patterns. It's false by default, to keep backwards-compatibility (make sure that old KCL code doesn't change). This PR is based on https://github.com/KittyCAD/modeling-app/pull/3914. It's based on work Serena and I are doing to fix a bug (engine does not allow patterning a 3D solid which was sketched on a face of another solid). @gserena01 our test program is now: ``` w = 400 case = startSketchOn('XY') |> startProfileAt([-w, -w], %) |> line(endAbsolute = [-w, w]) |> line(endAbsolute = [w, -w]) |> line(endAbsolute = [-w, -w]) |> close() |> extrude(length = 200) bump1 = startSketchOn(case, 'end') |> circle({ center = [-50, -50], radius = 40 }, %) |> extrude(length = 20) // We pass in "bump1" here since we want to pattern just this object on the face. useOriginal = true target = bump1 transform = { axis = [1, 0, 0], instances = 3, distance = -100 } patternLinear3d(transform, target, useOriginal) ``` If you change the `useOriginal = true` to `false` you can see the difference.
2025-02-06 17:46:47 -06:00
"originalId": "[uuid]",
"units": {
"type": "Mm"
}
},
"height": 100.0,
"startCapId": "[uuid]",
"endCapId": "[uuid]",
"edgeCuts": [
{
"type": "fillet",
"id": "[uuid]",
"radius": {
"n": 20.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"edgeId": "[uuid]",
"tag": null
},
{
"type": "chamfer",
"id": "[uuid]",
"length": {
"n": 50.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"edgeId": "[uuid]",
"tag": {
"commentStart": 580,
"end": 586,
"start": 580,
"type": "TagDeclarator",
"value": "seg04"
}
},
{
"type": "chamfer",
"id": "[uuid]",
"length": {
"n": 50.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"edgeId": "[uuid]",
"tag": {
"commentStart": 653,
"end": 659,
"start": 653,
"type": "TagDeclarator",
"value": "seg03"
}
}
],
"units": {
"type": "Mm"
Add clone (#5462) * updates 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> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> update the extrude idds Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fix sample Signed-off-by: Jess Frazelle <github@jessfraz.com> better docs Signed-off-by: Jess Frazelle <github@jessfraz.com> fix the start and end tag Signed-off-by: Jess Frazelle <github@jessfraz.com> better docs Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> new tests Signed-off-by: Jess Frazelle <github@jessfraz.com> codespell 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> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix examples Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix some stuff Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes 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> * add another test for fillet Signed-off-by: Jess Frazelle <github@jessfraz.com> * Update rust/kcl-lib/src/std/clone.rs Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * add sweep test Signed-off-by: Jess Frazelle <github@jessfraz.com> * revolve test; Signed-off-by: Jess Frazelle <github@jessfraz.com> * Update rust/kcl-lib/src/std/clone.rs Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * add another test for fillet Signed-off-by: Jess Frazelle <github@jessfraz.com> * allow cloning an imported geometry; Signed-off-by: Jess Frazelle <github@jessfraz.com> * allow for imported geometry Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * update docs Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-04-23 21:26:09 -07:00
},
"sectional": false
},
"units": {
"type": "Mm"
}
},
"start": {
"from": [
-69.1,
277.34
],
"to": [
-69.1,
277.34
],
"units": {
"type": "Mm"
},
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
}
},
"tags": {
"rectangleSegmentA003": {
"type": "TagIdentifier",
"value": "rectangleSegmentA003"
},
"rectangleSegmentB002": {
"type": "TagIdentifier",
"value": "rectangleSegmentB002"
},
"rectangleSegmentC002": {
"type": "TagIdentifier",
"value": "rectangleSegmentC002"
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
}
}
}
}