Skip to content

P&C fix: second hole on same end cap#11245

Draft
pierremtb wants to merge 15 commits into
mainfrom
pierremtb/issue9371-can-not-add-second-hole-to-the-same-face-using-point-and-click
Draft

P&C fix: second hole on same end cap#11245
pierremtb wants to merge 15 commits into
mainfrom
pierremtb/issue9371-can-not-add-second-hole-to-the-same-face-using-point-and-click

Conversation

@pierremtb
Copy link
Copy Markdown
Contributor

@pierremtb pierremtb commented Apr 23, 2026

Fixes #9371 by making sure Wall and Cap artifacts actually have path_ids set. This is a bit more involved than I thought, Codex wrote the Rust part based on my failing codemod test. Happy to try different approaches out too.

It's about adding a second hole to code like this

sketch001 = startSketchOn(XY)
profile001 = startProfile(sketch001, at = [0, 0])
  |> yLine(length = 5, tag = $seg04)
  |> xLine(length = 5, tag = $seg02)
  |> yLine(length = -5, tag = $seg01)
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg03)
  |> close()
extrude001 = extrude(profile001, length = 2)
sketch002 = startSketchOn(extrude001, face = END)
profile002 = circle(sketch002, center = [2.5, 2.5], radius = 2)
extrude002 = extrude(profile002, length = 1)
fillet001 = fillet(extrude001, tags = getCommonEdge(faces = [seg01, seg02]), radius = 2.5)
fillet002 = fillet(extrude001, tags = getCommonEdge(faces = [seg03, seg04]), radius = 2.5)
chamfer001 = chamfer(extrude001, tags = getCommonEdge(faces = [seg03, seg01]), length = 1)
hole001 = hole::hole(
  extrude002,
  face = END,
  cutAt = [2, 2],
  holeBottom = hole::flat(),
  holeBody = hole::blind(depth = 2, diameter = 1),
  holeType = hole::simple(),
)

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
modeling-app Ready Ready Preview, Comment May 11, 2026 7:37pm

Request Review

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 23, 2026

Merging this PR will not alter performance

✅ 116 untouched benchmarks
⏩ 151 skipped benchmarks1


Comparing pierremtb/issue9371-can-not-add-second-hole-to-the-same-face-using-point-and-click (dda1965) with main (d79c2f7)

Open in CodSpeed

Footnotes

  1. 151 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@pierremtb
Copy link
Copy Markdown
Contributor Author

pierremtb commented May 10, 2026

Ok not ready yet, just found out that p&c edit of a second hole on face doesn't work, getting

installHook.js:1 Error: No sweep artifact found in solids selection
    at retrieveFaceSelectionsFromOpArgs (index-CKnMLoRq.js:232518:33)
    at Object.prepareToEditHole [as prepareToEdit] (index-CKnMLoRq.js:261134:16)
    at enterEditFlow (index-CKnMLoRq.js:262582:27)
    at index-CKnMLoRq.js:263111:7
    at new Promise (<anonymous>)
    at prepareEditCommand (index-CKnMLoRq.js:263109:12)
    at index-CKnMLoRq.js:263675:11
    at Ag (index-CKnMLoRq.js:7077:15)
    at index-CKnMLoRq.js:7328:9
    at Vu (index-CKnMLoRq.js:2104:18)

Adding a test case for

sketch001 = startSketchOn(XY)
profile001 = startProfile(sketch001, at = [0, 0])
  |> yLine(length = 5, tag = $seg04)
  |> xLine(length = 5, tag = $seg02)
  |> yLine(length = -5, tag = $seg01)
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg03)
  |> close()
extrude001 = extrude(profile001, length = 2)
sketch002 = startSketchOn(extrude001, face = END)
profile002 = circle(sketch002, center = [2.5, 2.5], radius = 2)
extrude002 = extrude(profile002, length = 1, tagEnd = $capEnd001)
fillet001 = fillet(extrude001, tags = getCommonEdge(faces = [seg01, seg02]), radius = 2.5)
fillet002 = fillet(extrude001, tags = getCommonEdge(faces = [seg03, seg04]), radius = 2.5)
chamfer001 = chamfer(extrude001, tags = getCommonEdge(faces = [seg03, seg01]), length = 1)
hole001 = hole::hole(
  extrude002,
  face = END,
  cutAt = [2, 2],
  holeBottom = hole::flat(),
  holeBody = hole::blind(depth = 2, diameter = 1),
  holeType = hole::simple(),
)
hole002 = hole::hole(
  hole001,
  face = capEnd001,
  cutAt = [3, 3],
  holeBottom = hole::flat(),
  holeBody = hole::blind(depth = 2, diameter = 1),
  holeType = hole::simple(),
)

…to-the-same-face-using-point-and-click

# Conflicts:
#	rust/kcl-lib/src/execution/artifact/mermaid_tests.rs
#	rust/kcl-lib/tests/kcl_samples/fun-stacker-toy/artifact_graph_flowchart.snap.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

can not add second hole to the same face using Point and Click

1 participant