Fix #7942: Fix extend_walls_to_underside ridge artifact#7941
Open
theoryshaw wants to merge 1 commit intov0.8.0from
Open
Fix #7942: Fix extend_walls_to_underside ridge artifact#7941theoryshaw wants to merge 1 commit intov0.8.0from
theoryshaw wants to merge 1 commit intov0.8.0from
Conversation
When the operator was called twice on the same wall for a ridge roof, the two IfcPolygonalFaceSet clip solids shared an exact ridge edge (kissing-solid). OCCT produced spurious extra vertices at the coincident boundary. Fix by building the clip solid from a rectangle on the slope plane that extends slightly past the face edge (1 project unit margin) rather than the exact face footprint. Adjacent slope solids now volumetrically overlap at the ridge instead of sharing a boundary face, which OCCT handles correctly. Generated with the assistance of an AI coding tool.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #7942 :
ExtendWallsToUndersideproduces wrong geometry on second callCloses: (link issue here)
Summary
bpy.ops.bim.extend_walls_to_undersideglitched when applied twice to the same wall — once per slope of a ridge roof. The first call produced correct geometry, but the second call introduced spurious extra vertices (e.g. 14 instead of 10), resulting in a malformed gable profile.Root Cause
clip_wall_to_slabbuilds anIfcPolygonalFaceSetclip solid from the downward-facing slope face by extruding its exact vertex footprint upward. When the operator is applied twice for a symmetric ridge roof, the two clip solids share an exact ridge edge — their boundaries are coincident in 3D.OCCT's boolean engine treats this as a kissing-solid condition: two volumes that touch at a shared face or edge rather than overlapping volumetrically. This is numerically degenerate and causes OCCT to introduce extra vertices at the coincident boundary, resulting in a corrupted gable profile.
Fix
Instead of extruding the exact face footprint,
clip_wall_to_slabnow builds the clip solid's bottom face as a rectangle on the slope plane, sized to the tight bounding box of the original face vertices in slope-plane coordinates, extended by a small margin (1 project unit) in each tangent direction.This margin pushes each clip solid slightly past the ridge into the adjacent slope's territory, turning the shared ridge edge into a volumetric overlap between the two solids. OCCT handles overlapping
DIFFERENCEoperands correctly — material already removed by the first boolean simply remains absent.The construction uses an orthonormal basis spanning the slope plane (
tangent1,tangent2derived from the face normal), projects the face vertices onto those axes to find the tight extents, then adds the margin before building the clip bmesh. The extrusion height (max_z - min_z) and all downstream logic (add_boolean,mark_manual_booleans) are unchanged.Changes
File
Change
tool/model.py—clip_wall_to_slabBuild per-face clip solid from a margined slope-plane rectangle instead of exact face footprint; one operand per face instead of one combined mesh
tool/model.py—get_slab_clipping_bmeshAdd
faces.ensure_lookup_table()afterrecalc_face_normalscore/model.py—extend_wall_to_slabMinor cleanup
bim/module/model/wall.py—ExtendWallsToUndersideMinor cleanup
Testing
Tested against a ridge roof with two slopes applied sequentially to both a wall (
IfcWall) and a covering (IfcCovering). Both now produce correct gable profiles after two operator calls.Generated with the assistance of an AI coding tool.