Repository navigation
fix(ifc): a solid the export writes from a plan takes the plan itself, never its bounding rectangle or a plan with a hole filled (#1947) - #2019
Merged
Conversation
DrunkOnJava
marked this pull request as ready for review
November 14, 2026 23:06
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.
Summary
A solid the export writes from a plan (a sloped slab, a roof drawn along its planes, a wall's base cut along a footing's top) is now meshed from the plan itself or not at all.
body_geometry::sectionturns a plan that does not triangulate into its bounding rectangle, and fills a hole it cannot join. That is a drawing rule for the viewer and the plan SVG, butsloped_slab_mesh,between_surfaces_meshandenvelope_slab_mesh_splitused it to buildIfcFacetedBrepbodies written into the IFC. They now takeexact_section, which returnsNonein both cases, so the element keeps the body its caller falls back to. That is the same fallback the caller already takes for any other plan it cannot draw. Item 13 of #1947 ("unsure").Motivation
#1947, batch 9's export audit, item 13: "A profile that does not triangulate is written as its bounding rectangle, a viewer rule, into the IFC" (
src/ifc/body_geometry.rs:385). The read confirms it and adds a second case. When the outer ring triangulates but a hole cannot be bridged in, the section keeps the outer ring alone, so the written slab has its hole filled. Nothing labels either case.Changes
src/ifc/body_geometry.rs:sectionand the newexact_sectionsharebuild_section(outer, holes, exact). Withexact, a self-crossing hole, a hole that cannot be bridged in, and the bounding-rectangle fallback each returnNone. A hole thatcleandrops for having no area is still dropped, which is exact. In exact mode the triangles must also cover the plan's area (outer less holes, within 1e-6 sq ft plus 1e-9 of the area), becausebridge_holesdoes not check that a bridge crosses nothing or that a hole lies inside, so ear-clipping alone does not prove the result is the plan. The wall-top pass tests its rings the same way. The three IFC-facing mesh builders takeexact_section, and the module doc says so.changelog.d/fixed/1947-exact-section.md.Testing
Measure 43649082612, unfiltered at
a9632516against the merge-base8529bb01, holdout included:ifc.sha25661 of 61 equal,diagnostics.json43 of 43 equal, and no scorer output differs. No measured model holds such a plan, so this is a fail-closed change with no measured gain. Same-project gates: samples run 43650423569 ata9632516. The head after it changes only the changelog fragment.tools/check-local.sh: CI runs it (no local builds on this machine)Audit-honesty checklist
section's doc say which rule each path keepsLegal and contribution hygiene
Breaking changes
None.
exact_sectionis a new public function besidesection.