Skip to content

fix(ifc): on Revit 2025 a wall under a roof drawn from its slopes is cut along the roof's underside (#1478) - #1967

Merged
DrunkOnJava merged 7 commits into
mainfrom
fix/1478-sloped-roof-wall-tops
Nov 14, 2026
Merged

DrunkOnJava merged 7 commits into
mainfrom
fix/1478-sloped-roof-wall-tops

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

On Revit 2025 to 2027, a wall that no level underside cuts, whose top join names one roof and nothing else, and whose roof is drawn from its slopes as one solid of faces, is now cut along that roof's underside. Each convex piece of its plan, cut by the plan of each roof face that looks down, rises to that face's plane, one item each. Before, these walls stood level at their record top, through the roof.

What each export gains, on 25 IfcWall in 17 Revit 2025 models (the R2025 roof models 02_1Slope to 17_Rooms_Stairs_Spiral) and on rac_basic's 2025, 2026 and 2027 saves (no Revit export):

  • the body goes from one extrusion to a solid of one item per piece (IfcWall body extrusion to solid);
  • RvtElementRecordGeometry.BodyHeightSource and the trust marker BodyHeightSource read wall_top_cut_along_sloped_roof;
  • RvtElementRecordGeometry.TopCoverElementId names the roof that cuts the wall: 2901 on 12 walls, 3823 on 11 (the L-shaped hips), 3546 on 2 (the gables);
  • provenance.value_sources gains two rows per wall, the inputs the cut read: the roof's element record (parts with the roof's element_id, 2901, 3546 or 3823, and its Partitions stream) and the wall's own native record (reader native_wall, rule native).

No other class, property or quantity changes. The wall's Qto_WallBaseQuantities keep their values.

Motivation

#1478, measured first: on puzzbobb's Revit 2025 models (Measure 43542785440, wall_top_cover_vs_ifc), wall 2892 is 355 plan points too tall on 17 models (11.53 ft² of full height each), and 5 or 6 of the 7 walls are too tall on the L-shaped hips (48.27 and 59.80 ft²). Revit's top follows the roof's underside, as polygonal face sets. Every pair line shows rvt-rs's roof underside equal to Revit's over each wall's plan ("varies 13.1684..19.4729 in 71 runs" on both sides), so the surface to cut at is the one rvt-rs already writes.

Changes

  • src/ifc/export_content/wall_tops.rs:
    • sloped_top_solid: the roof's FacetedBrep faces that look down (outward normals, Mesh winds counter-clockwise from outside), each as its plan triangle and plane; the wall's plan cut into convex pieces, each clipped by each triangle (clip_convex), and each part a solid between_surfaces_mesh from the wall's base to the face's plane;
    • refused (the wall keeps its body) unless the parts cover the plan once (COVER_TOLERANCE_SQUARE_FEET) and every vertex's underside lies above the base and at or below the wall's top (UNDERSIDE_TOLERANCE_FEET);
    • cut_wall_tops applies it to the walls decide left uncut, with BodyHeightSource wall_top_cut_along_sloped_roof and TopCoverElementId;
    • the base pass leaves such a wall as it is, as base_cut_left_under_a_sloped_top, so a base cut does not redraw it to its own top;
    • the module doc says so.
  • partition_schema_mvp.rs and fields.rs: roofs on SLOPED_ROOF_WALL_TOP_REVIT_VERSIONS (2025 to 2027: 2025 is measured against Revit's own exports of puzzbobb's 20 models, Measure 43542785440; 2026 and 2027 have no Revit export with such a wall and are held to the same project's 2025 save by the same-project gate) carry ROOF_CUTS_WALL_TOPS_FIELD; export_content.rs collects them and passes them to the top pass.
  • wall_cut_openings.rs: an opening voids every piece of such a wall, as of a stepped one. element_provenance.rs, tests/value_sources_offsets.rs and docs/export-diagnostics.md register the new source.
  • A changelog fragment.

Testing

Measure 43544122324, unfiltered against main, with nordic, r2025, samples and holdout. Registered before it runs:

  1. On the 20 R2025 models listed on Walls under a read roof: cut along its sloped underside, as Revit does (RE-351 follow-up) #1478, wall_top_cover_vs_ifc's walls under a sloped roof become equal over the plan (summary taller 0), and no wall becomes lower.
  2. Only Revit 2025 files' exports move: the R2025 models and any 2025 sample with a wall under a sloped roof. Every 2024, 2026 and 2027 export is byte for byte main's. As it turned out: the gate was widened to 2026 and 2027 before the Result run, so the Revit 2025 roof models and rac_basic's 2025, 2026 and 2027 saves move; every 2024 export is byte for byte main's, and the 2026 and 2027 saves are held to the 2025 save by the same-project gate (run 43547699441).
  3. same-project gates: a 2025 sample that moves is checked against its 2024 and 2026 saves, which this change leaves as they are. If the gate reads that as a difference, the result goes on the PR, not a widened gate.
  4. Held-out counts: none moves for the worse.

If a wall comes out lower than Revit's, or the faces do not cover the plan once on any of the 20, the rule is narrowed before this leaves draft.

  • tools/check-local.sh: no local builds; rustfmt --check passes; CI runs the rest.

Result

Measure 43551765959 (head 0232f664 against main faec9c51, unfiltered with nordic, r2025, samples and holdout): 20 of 120 exports move, and only these 20. They are the 17 Revit 2025 roof models whose walls stand under a sloped roof (02_1Slope to 17_Rooms_Stairs_Spiral, less 02_..._Overhang, 03_2Slope and the models with no sloped roof), and rac_basic's 2025, 2026 and 2027 saves. Diagnostics are 102 of 102 equal. No qtos_vs_ifc or psets_vs_ifc row moves on any model: the wall Height keeps its value through the cut. The one scorer line that moves is schema.txt's count of swept solids placed apart from their product, which drops on each moved model (on Gable from 5 to 4) as the cut walls stop being plain extrusions. The same-project gates pass, holding rac_basic's 2026 and 2027 saves to its 2025 save.

What the walls do against Revit's, wall_top_cover_vs_ifc on the 20 (Measure 43554259332, same head and base):

walls equal to Revit's over the plan plan points taller than Revit's
main 138 105 10,815
this PR 138 136 705

Every one of the 17 moved Revit 2025 models goes to every wall equal over its plan, 10,465 taller points to 0 (for example 08_LShapedHipRoof from 2 of 7 walls to 7 of 7, 09 and 10 from 1 of 7 to 7 of 7). No point is lower than Revit's on either side. The 705 left are one wall each on 02_1Slope_Rafter2SquareCut_Overhang (350) and 03_2Slope_Rafter2SquareCut (355), whose exports this PR does not move, and they stay on #1478. rac_basic's saves have no Revit export to score.

After #1974 landed, main was merged in (1e8829f9): plate_roofs is now keyed on the Roof record and sloped_roofs sits beside it, and a sloped roof still gives no level cut. Its Measure is 43555026485.

Audit-honesty checklist

  • No claim beyond what the run shows; gated to Revit 2025 to 2027. 2025 is measured against Revit's exports of puzzbobb's 20 models (run 43542785440); 2026 and 2027 have no Revit export to score and are held to rac_basic's 2025 save by the same-project gate. rac_basic has no Revit export on any release.
  • A changelog fragment.
  • No private paths or emojis.

Legal and contribution hygiene

  • Apache-2.0; no Autodesk source; no fixtures.

Part of #1478.

…wall-tops

# Conflicts:
#	src/research/partition_schema_mvp.rs
#	src/research/partition_schema_mvp/fields.rs
…o, the saves the same-project gate holds to 2025's (#1478)
…wall-tops

# Conflicts:
#	src/ifc/export_content.rs
#	src/ifc/export_content/wall_tops.rs
@DrunkOnJava

Copy link
Copy Markdown
Owner Author

Measure 43555026485 on the merged head 1e8829f9 against main 21d310f0 (unfiltered, with nordic, r2025, samples and holdout) reads as the run in the body:

  • 20 of 120 exports move, the same 20: the 17 Revit 2025 roof models and rac_basic's 2025, 2026 and 2027 saves.
  • Diagnostics are 102 of 102 equal.
  • The one scorer line that moves is still schema.txt's count of swept solids placed apart from their product, down on each moved model (Gable 5 to 4, 08_LShapedHipRoof 7 to 2, rac_basic 136 to 123). No qtos_vs_ifc, psets_vs_ifc or wall scorer row moves.
  • same-project gates passes on 1e8829f9: 15 samples held to their earlier saves, and the Areas on 4 saves and on the 2021 save.

The merge of main changed nothing this PR measures. It stays a draft until the 0.23.0 tag is out, then goes ready for review.

@DrunkOnJava
DrunkOnJava marked this pull request as ready for review November 14, 2026 06:04
@DrunkOnJava
DrunkOnJava merged commit 8936cbc into main Nov 14, 2026
104 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/1478-sloped-roof-wall-tops branch November 14, 2026 07:03
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