KittyCAD / modeling-app

The KittyCAD modeling app.
https://kittycad.io/modeling-app/download
MIT License
429 stars 37 forks source link

Disappearing 3D Pattern Instance Between Two Offset Planes #4570

Open nicboone8 opened 3 days ago

nicboone8 commented 3 days ago

I modeled the eyes of a beloved animated trash compacting robot using a two instance 3d pattern (just spinning one around to create the other one). There's an unrelated fillet error, so the offset planes are still visible. Weirdly, one eye disappears when viewed through the offset plane on either side of the robot body.

Fixing the error so that the planes are hidden fixes the eyes.

This might just be a one-off issue, but I'll start keeping an eye out for elements disappearing behind offset planes.

https://github.com/user-attachments/assets/ef33bc0b-c91c-4e40-94d7-68d30004f994

Core Dump [coredump-123dfce1-cd59-45b6-9a7b-6726c02fbd2b.json](https://public.blob.zoo.dev/67931e72-a22d-44f1-8bbb-f3c197c7798a/modeling-app/coredump-123dfce1-cd59-45b6-9a7b-6726c02fbd2b.json) Reference ID: 123dfce1-cd59-45b6-9a7b-6726c02fbd2b
KCL Code ```kcl fn tread = (width) => { filletr = 1.7 sketch001 = startSketchOn(offsetPlane('YZ', width)) |> startProfileAt([0, 0], %) |> xLine(12, %, $edge1) |> angledLine({ angle: 130, length: 8 }, %, $edge2) |> close(%, $edge3) extrude001 = extrude(3, sketch001) sketch002 = startSketchOn(extrude001, 'END') |> startProfileAt([.5, 0.2], %) |> xLine(11.1, %, $edge4) |> angledLine({ angle: 130, length: 7.4 }, %, $edge5) |> close(%, $edge6) extrude002 = extrude(-3, sketch002) |> fillet({ radius: filletr, tags: [getNextAdjacentEdge(edge4)] }, %) |> fillet({ radius: filletr * 1.7, tags: [getNextAdjacentEdge(edge5)] }, %) |> fillet({ radius: filletr*.6, tags: [getNextAdjacentEdge(edge6)] }, %) |> fillet({ radius: filletr * 1.95, tags: [getNextAdjacentEdge(edge1)] }, %) |> fillet({ radius: filletr * .6 + .2, tags: [getNextAdjacentEdge(edge2)] }, %) |> fillet({ radius: filletr + .5, tags: [getNextAdjacentEdge(edge3)] }, %) sketch003 = startSketchOn(offsetPlane('YZ', .3 + width)) |> startProfileAt([.5, 0.2], %) |> xLine(11.1, %, $edge7) |> angledLine({ angle: 130, length: 7.4 }, %, $edge8) |> close(%, $edge9) |> hole(circle({ center: [4, 2.43], radius: .58 }, %), %) |> hole(circle({ center: [6.75, 4.58], radius: .8 }, %), %) extrude003 = extrude(3 - .6, sketch003) |> fillet({ radius: filletr * 1.7, tags: [getNextAdjacentEdge(edge7)] }, %) |> fillet({ radius: filletr * .6, tags: [getNextAdjacentEdge(edge8)] }, %) |> fillet({ radius: filletr, tags: [getNextAdjacentEdge(edge9)] }, %) sketch004 = startSketchOn(extrude003, 'END') sketch005 = startSketchOn('YZ') |> circle({ center: [2.21, 0.85], radius: 0.6 }, %) extrude004 = extrude(3, sketch005) sketch006 = startSketchOn('YZ') |> circle({ center: [6.75, 4.58], radius: 0.8 }, %) extrude005 = extrude(3, sketch006) sketch007 = startSketchOn('YZ') |> circle({ center: [8.68, 1.58], radius: 1.3 }, %) extrude006 = extrude(3, sketch007) sketch008 = startSketchOn('YZ') |> circle({ center: [4, 2.43], radius: 0.58 }, %) extrude007 = extrude(3, sketch008) sketch009 = startSketchOn(extrude007, 'END') |> circle({ center: [4, 2.43], radius: 0.4 }, %) extrude008 = extrude(-3, sketch009) sketch010 = startSketchOn(extrude005, 'END') |> circle({ center: [6.75, 4.58], radius: 0.6 }, %) extrude009 = extrude(-3, sketch010) return extrude002 } tread(0) tread(13) sketch003 = startSketchOn('XY') sketch001 = startSketchOn(offsetPlane('XY', 3)) |> startProfileAt([3, 0], %) |> angledLine([0, 10], %, $rectangleSegmentA001) |> angledLine([segAng(rectangleSegmentA001) + 90, 10], %, $rectangleSegmentB001) |> angledLine([ segAng(rectangleSegmentA001), -segLen(rectangleSegmentA001) ], %, $rectangleSegmentC001) |> lineTo([profileStartX(%), profileStartY(%)], %) |> close(%) extrude001 = extrude(10, sketch001) height = 4 sketch011 = startSketchOn('XZ') |> startProfileAt([7.23, 15.11+height], %) |> line([-2.51, -0.37], %) |> tangentialArcTo([4.47, 13+height], %) |> tangentialArcTo([6.89, 13.56+height], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> close(%) |> hole(circle({ center: [5.8, 14+height], radius: .75 }, %), %) extrude010 = extrude(-5, sketch011) |> patternCircular3d({ axis: [0, 0, 1], center: [7.5, 2.5, 0], instances: 2, arcDegrees: 360, rotateDuplicates: true }, %) ```