Skip to content

Port BIMForge's excavation review fixes: restored ground, limit extents - #1

Merged
BrandonLewis merged 4 commits into
mainfrom
ccr-efb0d0ab-y07neu
Nov 5, 2026
Merged

BrandonLewis merged 4 commits into
mainfrom
ccr-efb0d0ab-y07neu

Conversation

@BrandonLewis

Copy link
Copy Markdown
Owner

Summary

Ports the fixes from BIMForge PR BrandonLewis/BIMForge#8's review (released in BIMForge 0.1.100):

  • Restored ground stays inside its host. Before its dig date, a cut that voids the ground restores only the ground, not the air above it. A cut can reach past grade, as an opening runs past its wall.
    • Sections and DXF (developed.py): the restored fill is clipped to the section of the host's uncut shape (Clip / Restore, _uncut, _cut_into).
    • Blender add-on: _cut_features now carries each hosted cut's uncut host, and _clip_to_host clips the pre-dig fill, and Solid mode's volume-removed fill, to it in 2D.
    • A pay-item excavation body (unhosted) is still restored whole.
  • Drawing extents include the limits of excavation (_extent).
  • developed.py now matches BIMForge's copy, except one line of IfcSection wording.

Test plan

  • Full suite with bpy 5.2.3 and a BIMForge that has Element.voids: 64 passed.
  • Against PyPI's BIMForge 0.1.99: test_developed.py 18 passed, 2 skipped (the voids tests). BIMForge 0.1.100 carries Element.voids, so CI runs them once it is on PyPI.
  • New tests: test_restored_ground_stays_inside_its_host (sections, and the Blender add-on) and test_the_extent_takes_in_the_limits_of_excavation.

Generated by Claude Code

Before its dig, a hosted cut restores only its host's ground: the section
fill is clipped to the host's uncut section (developed / cross sections,
and the Blender add-on, whose Solid fill is clipped too), so a cut reaching
past grade no longer fills air. Drawing extents take in the limit lines.
developed.py matches BIMForge 0.1.100's copy; its new tests come along.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XRnqNmAEttrAq1w1dKrNCu
Copilot AI balanced review requested due to automatic review settings November 5, 2026 14:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Hosted cutters can incorrectly fill soil outside their hosts, while excluding restored bodies from beyond-plane visibility can hide valid ground in pre-dig views.

2 open issues
What changed in this PR

Ports BIMForge’s excavation fixes into IfcSection’s section drawing and Blender add-on paths, keeping restored ground within its host and including excavation limits in drawing extents.

Changes:

  • Clips hosted excavation fills to the host’s uncut section while preserving whole restoration for unhosted bodies.
  • Shares section-cut processing and includes excavation limit lines in extent calculations.
  • Adds regression tests and documents the fixes.
File Description
tests/​test_developed.py Adds host-clipping and excavation-extent regression tests.
tests/​blender/​test_alignment_section.py Tests pre-dig restored ground clipping in Blender.
src/​ifcsection/​developed.py Adds host-clipped restoration, shared cut processing, and limit-aware extents.
src/​ifcsection/​addon.py Caches uncut host geometry and clips excavation fills.
CHANGELOG.md Documents the ported excavation fixes.

Review effort: Balanced

Comment thread src/ifcsection/addon.py Resolved
Comment thread src/ifcsection/developed.py Resolved
BrandonLewis and others added 3 commits November 5, 2026 15:06
When the plane cut a hosted cut but not its host, _clip_to_host returned
None and the caller filled the whole cut: soil drawn outside the ground,
in the pre-dig view and in Solid mode. Return no rings there, as the DXF
path (developed._cut_into) already skips a Restore with no host region.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XRnqNmAEttrAq1w1dKrNCu
@BrandonLewis
BrandonLewis merged commit 2090554 into main Nov 5, 2026
4 checks passed
BrandonLewis added a commit that referenced this pull request Nov 5, 2026
Before the dig, the edges beyond a section showed the ground with its hole
already dug, and a ground solid wholly behind the plane that its cut
removes vanished. A host whose every void is still to dig is now drawn
beyond the cut as its uncut shape, in place of its voided body. No 3D
boolean. Raised in the review of #1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XRnqNmAEttrAq1w1dKrNCu
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.

2 participants