Skip to content

fix(ifc): a wall's base is cut at a roof's top only where the roof is a level plate (#1947) - #1953

Merged
DrunkOnJava merged 3 commits into
mainfrom
fix/1947-base-on-box-roof
Nov 14, 2026
Merged

DrunkOnJava merged 3 commits into
mainfrom
fix/1947-base-on-box-roof

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

decide_base (wall_tops.rs, #1384) took any roof among the elements a wall's base join names as a level the wall's base stops at, using the cutter's top. For a roof drawn as its record box that is the box's top, not the roof's. RE-351 section 4 names this flaw, and the top pass already avoids it through level_underside: a roof cuts only where it is one of plate_roofs (its outline read, its box exactly its type's layers). The base pass now applies the same test, with plate_roofs passed down to it.

Item 4 of #1947 (a top cut at a slab or footing whose outline was not read) is not changed here. A footing drawn as its box is its real shape, so requiring an outline there could undo measured cuts; it needs its own measurement.

Testing

Measure 43540737360, unfiltered against main with nordic, r2025, samples and holdout:

Refs #1947.

Audit-honesty checklist

  • README / docs reflect the current state after this PR
  • A user-visible change has its entry as a fragment under changelog.d/fixed/

… a level plate, as the top pass requires (#1947) (RE-351)
@DrunkOnJava

DrunkOnJava commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner Author

The base context has a second user, the wall-end pass (decide_ends, which decides a joined wall's end standing on what its base names): it now gets plate_roofs too, so it applies the same rule (a roof cuts a base only where it is a level plate). The first head did not compile (E0063, missing plates in that initializer); ba7df24 fixes it, and the Measure is redispatched on it (run 43521274737).

@DrunkOnJava

Copy link
Copy Markdown
Owner Author

The one export that moves, read. Measure 43540737360, unfiltered with the held-out models, moved only the BIM4LCA concrete housing as built (wall_base_cut_at_floor_covering_in_part 11 to 10). A filtered run on that model, 43544679473 (wall_top_cover_vs_ifc, wall_heights_vs_ifc), names it:

So main's cut, at a box top that is not the roof's surface, lands closer to Revit's volume, but it is not Revit's base at the 0.001 ft bar. This PR refuses it, as fail-closed asks for a cutter whose level is not read (RE-351 §4, #1947 item 5). Every census line is unchanged on both sides (qtos_vs_ifc, psets_vs_ifc), all 18 held-out models included, so no scored value moves.

What would make this wall right is reading the roof's slope. A roof drawn as its record box would then become a surface to cut at, as #1967 does for Revit 2025 roofs drawn from their slopes. That is #1480's third point, not this PR.

@DrunkOnJava
DrunkOnJava marked this pull request as ready for review November 14, 2026 02:22
@DrunkOnJava
DrunkOnJava merged commit b3ae856 into main Nov 14, 2026
65 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/1947-base-on-box-roof branch November 14, 2026 02:39
DrunkOnJava added a commit that referenced this pull request Nov 14, 2026
…s, not the IFC entity it is exported as (#1480) (RE-351) (#1974)

## Summary

The third ask of #1480. The wall top and base passes asked "is this
cutter a roof?" by the IFC entity it is exported as (`ifc_type ==
"IFCROOF"` in `level_underside`). They now ask the Revit record:
`export_content` records every `Roof` element record with whether it is
a level plate (RE-351: record box exactly its type's layers, plan
outline read), as `wall_tops::Roofs`, and `level_underside(id, roofs)`
lets any non-Roof record cut and a Roof only when it is a plate.

- A Floor exported as `IfcRoof` keeps its cut (it was refused,
fail-closed).
- A Roof exported as `IfcSlab` is held to the plate rule (it cut at its
box's underside).

The base pass (`decide_base`, from #1953) shares `level_underside`, so
both passes change together.

## Testing

Measure, unfiltered with held-out models, against main: dispatched with
this PR. Expected: no export moves on models where every roof is
exported as `IfcRoof` and every `IfcRoof` is a Roof record; any wall
that moves is read against Revit's export before this leaves draft.

Clean-room: no format finding; a change of which existing field decides
the rule.
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