Skip to content

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
DrunkOnJava merged 3 commits into
mainfrom
fix/1947-exact-section
Nov 14, 2026
Merged

DrunkOnJava merged 3 commits into
mainfrom
fix/1947-exact-section

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

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::section turns 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, but sloped_slab_mesh, between_surfaces_mesh and envelope_slab_mesh_split used it to build IfcFacetedBrep bodies written into the IFC. They now take exact_section, which returns None in 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: section and the new exact_section share build_section(outer, holes, exact). With exact, a self-crossing hole, a hole that cannot be bridged in, and the bounding-rectangle fallback each return None. A hole that clean drops 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), because bridge_holes does 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 take exact_section, and the module doc says so.
  • changelog.d/fixed/1947-exact-section.md.

Testing

Measure 43649082612, unfiltered at a9632516 against the merge-base 8529bb01, holdout included: ifc.sha256 61 of 61 equal, diagnostics.json 43 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 at a9632516. The head after it changes only the changelog fragment.

  • tools/check-local.sh: CI runs it (no local builds on this machine)
  • End to end: Measure (above)
  • Witness verdicts: replay if Core Interior moves

Audit-honesty checklist

  • Docs reflect the state: the module doc and section's doc say which rule each path keeps
  • Changelog fragment
  • No emojis, private paths or jargon

Legal and contribution hygiene

  • Apache-2.0
  • No Autodesk proprietary source, decompiled internals or NDA'd SDK content
  • No fixtures

Breaking changes

None. exact_section is a new public function beside section.

@DrunkOnJava
DrunkOnJava marked this pull request as ready for review November 14, 2026 23:06
@DrunkOnJava
DrunkOnJava merged commit ca822f2 into main Nov 14, 2026
63 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/1947-exact-section branch November 14, 2026 23:41
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.

1 participant