Skip to content

Hole drills hidden bodies, and its preview draws them #7520

Closed

Description

@Jacquesvdberg92

What happens

Hiding a body doesn't keep a Hole out of it. The Hole dialog draws the hidden bodies while its preview runs, and OK drills them as well. Afterwards they are hidden again, so you don't see that they changed.

I hid two bodies to work on a third, a long flat support. The support sits in pockets of the hidden bodies. Then I placed a Single hole on the support's underside:

  • Once the preview has finished (6–9 s here), the two hidden bodies are drawn in the view and the hole tool runs up into them. The browser still shows them as hidden. ui.inspect reports preview.replaced: ["MainCorner", "DoorCorner", "Body2"].
  • OK saves the hole with no targets, so it drills every body in its path. MainCorner loses 45.7 mm³, DoorCorner 46.5 mm³, and Body2, the only shown body, 196.2 mm³ (the whole Ø5 × 10 hole).
  • The saved hole's face_names is ["F2:start"]: the bottom face of the hidden bodies, which is coplanar with the support's underside there. The face I picked was Body2 face 0, which is named F42:start.

Steps

As a script:

{"commands": [
 {"command": "solid.box", "params": {"length": 40, "width": 40, "height": 5, "body_name": "Plate"}},
 {"command": "solid.box", "params": {"corner": [0, 0, 5], "length": 40, "width": 40, "height": 20, "operation": "new", "body_name": "Block"}},
 {"command": "browser.visibility", "params": {"items": ["Block"], "visible": false}},
 {"command": "solid.hole", "params": {"position": [20, 20, 0], "diameter": 5, "depth": 10, "name": "Hole1"}}
]}

Hole1 reports changed_bodies: ["Plate", "Block"], although Block is hidden.

In the app: hide one of two bodies that touch, start Hole, and pick a face of the shown body where the drill will reach the hidden one. The hidden body appears while the preview is up, and OK drills it.

Expected

The same rule #2464 and #6901 set for Extrude and the other feature windows:

  • With no targets picked, Hole drills only the shown bodies. The shown set is saved as the feature's targets, so showing or hiding a body later doesn't change the model.
  • The preview doesn't draw hidden bodies.
  • The face reference names the body that was picked.

#6901 lists Hole as "unchanged" and #2465 adds Targets to Extrude only, so neither covers this. The fix is in the Hole command's default targets and in the dialog's preview, not in crates/kernel/.

Screenshots (main 783ee91, 0.24.0)

While the dialog is open: the hidden bodies are drawn and the preview runs into them.

After OK the view looks right: the bodies are hidden again and only Body2 shows a hole.

A section through the hole axis with only the two hidden bodies shown, before and after: they now have a new Ø5 bore, and its drill tip breaks into the Ø4 hole above.

Environment

main 783ee91 (0.24.0) and the 0.23.1 release; Linux x86_64, NVIDIA GTX 1080 Ti on Vulkan.

Activity

  1. added
    area:kernel
    needs-triage
    on Oct 27, 2026
  2. dahakbuilds commented on Oct 27, 2026

    @dahakbuilds
    Contributor

    Triage by Dahak (agent): reproduced on 0.24.0 (Linux x86_64, official build) with the script from the report — solid.box Plate 40×40×5, solid.box Block 40×40×20 at z=5, browser.visibility hides Block, then solid.hole Ø5×10 at (20,20,0): Hole1 reports changed_bodies: ["Plate", "Block"] although Block is hidden. Also reproduced on main at 514b0c8.

    Confirmed in source: hole() in crates/engine/src/cmd/features.rs only maps an explicit targets param to participants (features.rs:2515); with no targets it never applies the shown-body scope, unlike the Extrude Cut path, which defaults to shown_scope() (features.rs:832) per #2464. So the fix is the Hole command's default targets (and the dialog preview), not crates/kernel/.

    Not a duplicate: #2464/#2465 cover Extrude only, and #6901 lists Hole as unchanged. The dialog-preview half of the report (hidden bodies drawn while the preview runs) is GUI-only and was not verified headlessly; the drilling half is fully reproducible via CLI.

  3. added
    in progress
    on Oct 27, 2026
  4. github-actions commented on Oct 27, 2026

    @github-actions
    Contributor

    Claimed by @sascha2101 through #7562. The claim lapses after 14 days without pushes.

  5. froglemonade2 commented on Nov 1, 2026

    @froglemonade2
    Contributor

    Reproduced on: SolidCraft 0.29.0 (release), Linux x86_64, NVIDIA GTX 1060 (Vulkan), in the app and with headless solidcraft-cli
    Kernel: no — Hole's default bodies in crates/engine/src/cmd/features.rs and the dialog preview in crates/ui-egui/src/preview.rs; no crates/kernel change

    Still happens on 0.29.0. One more case: the hidden body is cut even when the hole drills away from it. The hole's tool starts a little above the picked face (top = max(1 % of the part size, 0.1 mm), crates/doc/src/eval.rs:4904), so a hidden body resting on that face loses a thin disc.

    Steps (app)

    1. Box "Lower" 40 × 40 × 5 mm. Box "Upper" 40 × 40 × 20 mm on top of it (corner (0, 0, 5), new body).
    2. Hide Upper.
    3. Hole → pick Lower's top face at (20, 20, 5). The hole drills down, into Lower, away from Upper.
    4. Wait for the preview, then OK.
    {"commands":[
     {"command":"solid.box","params":{"length":40,"width":40,"height":5,"body_name":"Lower"}},
     {"command":"solid.box","params":{"corner":[0,0,5],"length":40,"width":40,"height":20,"operation":"new","body_name":"Upper"}},
     {"command":"browser.visibility","params":{"items":["Upper"],"visible":false}},
     {"command":"solid.hole","params":{"position":[20,20,5],"direction":[0,0,-1],"diameter":5,"depth":10}},
     {"command":"inspect.measure","params":{}}
    ]}

    Expected

    Upper is not drawn during the preview and stays 32000 mm³.

    Actual

    • While the preview is up, Upper is drawn in full although its eye is off: ui.inspect → "preview": {"replaced": ["Lower", "Upper"]}, "hidden_bodies": ["Upper"].
    • After OK: Lower 7901.84 mm³, Upper 31988.22 mm³ (−11.78 mm³, a Ø5 × 0.6 mm disc out of its bottom face). The script above gives the same numbers headless, with changed_bodies: ["Lower", "Upper"].
    • A countersink does the same, with a wider pocket: Lower 10 × 10 × 5, hidden Upper 10 × 10 × 5 on top, countersink Ø2 / cs Ø6 at (5, 5, 5) drilling down. changed_bodies: ["Lower", "Upper"], Upper 500 → 495.54 mm³, a pocket Ø6.28 × 0.15 mm (face F3:csink:base at z = 5.15).

    Every time.

    Where it happens

    From reading the source (main e77c555):

    Screenshots

    • Top: Upper hidden, only Lower drawn; bottom: the Hole dialog's preview, with Upper (eye still off in the Browser) drawn above Lower.

      h_before_during_preview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:kernelin progressneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions