Skip to content

feat(ifc): gable, hip and slope-arrow roofs as their planes, and roof slopes on Revit 2025 (#356) (RE-199) - #870

Merged
DrunkOnJava merged 6 commits into
DrunkOnJava:mainfrom
puzzbobb:roof_function
Oct 21, 2026
Merged

DrunkOnJava merged 6 commits into
DrunkOnJava:mainfrom
puzzbobb:roof_function

Conversation

@puzzbobb

@puzzbobb puzzbobb commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Exports Revit roofs as their sloped planes, not as level blocks. This covers gables, hips and L-shaped hips, slope arrows, rafter cuts and Revit 2025 roof slopes. Each body is drawn only where it reproduces the roof's record box height, as RE-56 does for sheds.

Motivation

Before this change, every multi-edge roof, every slope-arrow roof and every Revit 2025 roof was exported as a level block as tall as its record box. On Revit 2025, the edge-slope and sketch readers refused the file version, so every roof slope was lost, along with the outlines of edited sketches.

Full findings are in reports/element-framing/RE-199-roof-planes.md (RE-199).

Changes

  • src/partition_roof_slopes.rs
    • edge_slope_in reads RE-56's edge block on Revit 2025, including each edge's plate offset.
    • arrow_heights / scan_arrow_heights read slope arrows (SlopeCurveData), set either by "Height at Tail" or by "Slope".
    • scan_rafter_cuts reads the rafter cut (parameter -1001710: plumb, two-cut plumb or two-cut square) from the roof's object graph, and fascia_depth reads the fascia depth.
  • src/partition_beam_axes.rs: scan_sketch_bounded_lines reads sketch line segments (RE-49) on 2024 and 2025.
  • src/partition_schema_mvp.rs: carries edges, plate offsets, rafter cut and fascia depth through the instance fields. attach_roof_slopes takes a roof's edges from its Sketch's curve list where it has one. scan_sketch_curve_lists now reads 2025.
  • src/ifc/export_content.rs: roof_planes_solid builds a roof as its edges' straight-skeleton planes (each plane held to its edge's wedge, so L-shaped valleys come out right), with the eave set by the shallowest edge. It applies two-cut bodies and arrow planes.
  • src/ifc/body_geometry.rs: envelope_slab_mesh cuts the plan triangulation wherever two tops, two undersides, or an underside and a cut level meet, then lifts each piece into an IfcFacetedBrep, drawing nothing past 65,536 pieces or side segments.
  • src/element_record_plan_profiles.rs: a roof's slope arrow is left out of its outline.
  • examples/probe_re199_roof_edge_slopes.rs: probe that prints each roof sketch line's slope block, offsets and bounded line, the slope arrows, and each roof's rafter cut and fascia depth.
  • tools/re/roof_bodies_vs_ifc.py, in every Measure run: each roof's body against Revit's export, its volume and how far Revit's vertices lie from rvt-rs's.
  • reports/element-framing/RE-199-roof-planes.md: the RE-199 report.
  • README.md, docs/status.md, docs/support-matrix.json, ROADMAP.md, CHANGELOG.md: the public status.

Maintainer changes

puzzbobb's three commits were replaced by one signed commit with the same tree and puzzbobb as author, since main requires signed commits. On top of it:

  • The finding is renumbered RE-199: RE-170 is the unread-joins finding already on main.
  • arrow_heights read four f64s at at - 0x28 to at - 0x10 unchecked, which underflowed (a panic under overflow checks) for a 16-byte ff run in a line's first 0x28 bytes. It now reads them from at.checked_sub(0x28).
  • envelope_slab_mesh is bounded at 65,536 pieces or side segments, since a sketch with many defining edges could otherwise ask for millions of pieces before the record-box check.
  • scan_rafter_cuts reads through native_document::extract_graphs, which skips the parameter-definition pass that made Autodesk's rac_advanced 2025 sample export 1.24x slower.
  • The roof scorer, the probe's extra output, and the public status files.

Testing

Oracle: R2025_Models.zip, attached to #356 under Apache-2.0 (sha256 8673d803fb0b9b6aa20d08448eeed16eb34222566bfaf7a2dc761c064dc30d6a, pinned in research/r2025-models.tsv). It contains 23 purpose-made Revit 2025 projects, with Revit 25.0.2's IFC4 Reference View exports. Probe: cargo run --example probe_re199_roof_edge_slopes -- <file.rvt>.

Measure on GitHub's runners, base main, with the R2025 models, Autodesk's 2024 and 2025 sample projects, the probe and same-runner timing: run 39602093604 (head cf0ab157, whose code is this PR's). tools/re/roof_bodies_vs_ifc.py gives, for each roof in Revit's export (both meshed with IfcOpenShell):

file Revit vertices farthest vertex volume, rvt-rs volume, Revit main
02_1Slope 8 3e-6 ft 334.639943 ft³ 334.640341 ft³ 4356.29 ft³
02_1Slope_Rafter2PlumbCut 8 3.74e-6 320.718286 320.717684 4021.65
02_1Slope_Rafter2SquareCut 8 3.74e-6 320.718286 320.717684 4021.65
02_1Slope_Rafter2SquareCut_Overhang 8 2.83e-6 318.656072 318.655475 3972.24
03_2Slope_Rafter2SquareCut 12 2.83e-6 304.732578 304.732818 2041.48
04_Gable 12 2.45e-6 363.106249 363.106044 3552.79
04_Gable_Swapped_Slopes 16 3e-6 331.029126 331.029631 1805.89
05_1Slope_ArrowDefined 8 3e-6 325.960337 325.961323 6470.70
06_1Slope_ArrowDefined_SetToSlope 8 2.45e-6 331.469560 331.468952 7835.98
08_LShapedHipRoof 20 2.45e-6 356.504015 356.504300 4223.59
09_LShapedHipRoof_1Edge300Offset 24 3e-6 356.503864 356.504300 4223.59
10_LShapedHipRoof_1Edge300Offset_Hole 40 3e-6 336.967483 336.967803 4223.59

12_Rooms_Door_Windows and the stairs files 13 to 17 hold 02_1Slope's roof and match the same way: 18 of the 19 roofs in Revit's exports match (every vertex within 0.001 ft, volume within 1e-4), against 0 of 19 on main. The 19th is 11_RoofByExtrusion (#883). 07_1Slope_ArrowDefined_2Cut50mmFascia has no Revit export, but its body reproduces its record box (12.096 ft).

Elsewhere (the same run, and run 39600694074 for the BIM4LCA office):

  • Core Interior, Einhoven, the four RE1 models, both BIM4LCA office models, the family corpus and every 2024 sample but rac_advanced export byte-identically to main.

  • rac_advanced, in its 2024 and its 2025 save, draws roof 201262 along its slope arrow (line 201283, tail 0, head 1.5 ft), reproducing its record box. On 2025 its three 15° hips are read as plumb cuts, but each record box is exactly the hip's rise with no thickness, so they fail the record-box check and stay level (Roof cases with no oracle: 2024 gables and hips, a square two-cut with a fascia, a slope arrow stopping short (RE-199 follow-up) #885).

  • On 2025, 29 more elements of rac_advanced, 4 of rac_basic and 1 of rst_basic are drawn from their sketches rather than as their boxes. None of the samples has a Revit export to compare against. puzzbobb measured rac_basic 2025's three floors locally: their volumes are now the 2024 save's.

  • The IFC4 schema check finds nothing new; each sloped roof is one fewer swept solid.

  • Same-runner timing (base and head on one runner, three rounds a file): rac_advanced 2025 1.08x main (3,437 to 3,715 ms) and rac_basic 2025 1.06x (3,214 to 3,421 ms); every other file within 4%. With the rafter cut read through extract, rac_advanced 2025 had been 1.24x (run 39600160617).

  • puzzbobb's local runs (report section 7) also cover Snowdon Towers 2025, the Japanese 2025 samples and the Golden Nugget models, which cannot run in CI. Snowdon Facades 2025 gains a 7.1° shed and a 4.8° gable, both matching their record boxes, and took 11 s instead of 7 s before the rafter-cut change above.

  • Verified end to end on real Revit files (Measure runs above; probe and report included)

  • IFC exporter: witness verdicts replay, or changed observations refreshed (Core Interior's export is byte-identical)

  • Performance: same-runner timing above

Audit-honesty checklist

  • README / docs reflect the current state after this PR
  • "Known limitations" / "What works today" updated
  • New limitations documented in the PR body and in the report (see below)
  • Commit messages describe what changed and why
  • No emojis in code, docs, or commit messages
  • No private paths, personal email addresses, or internal jargon in committed files
  • Reverse-engineering finding: probe under examples/ is included

Known limitations

Legal and contribution hygiene

Breaking changes

None to the API. IFC output changes for sloped roofs (now IfcFacetedBrep bodies, not level extrusions) and for the 2025 elements listed above.

Related issues

Closes #356 (RE-199). Follow-ups: #883, #884, #885.

puzzbobb and others added 4 commits October 21, 2026 08:26
puzzbobb's change from pull request DrunkOnJava#870 (commits 54b93c1a, 0990e254 and
fde03348), replaced by one signed commit with the same tree, since main
requires signed commits.
…he roof envelope's pieces (DrunkOnJava#356) (RE-199)

arrow_heights read the tail, head and level f64s at at - 0x28 to at - 0x10
unchecked once the angle at at - 0x08 had passed, so a 16-byte ff run within
the first 0x28 bytes of a line's data underflowed: a panic wherever overflow
checks are on (debug builds, the i686 job). It now reads all of them from
at.checked_sub(0x28).

envelope_slab_mesh cuts the plan along up to about 2,000 lines for 32 planes,
and each cut can split every piece, so a sketch with many defining edges
could ask for millions of pieces before the record-box check rejects the
body. Past MAX_ENVELOPE_PIECES (65,536) pieces or side segments it now draws
nothing, as for any other body it cannot draw.
…e and vertices (DrunkOnJava#356) (RE-199)

tools/re/roof_bodies_vs_ifc.py meshes every IfcRoof both exports hold (same
Tag), the roof's own body and its aggregated parts' together, and compares
the meshes' volumes and the farthest any vertex of Revit's body lies from
rvt-rs's, in feet. Measure runs it on every model with a Revit export, so
RE-199's volume and vertex table comes from a run on GitHub's runners rather
than from one machine, and a roof that falls back to a level block shows.
…e, without the parameter-definition pass (DrunkOnJava#356) (RE-199)

scan_rafter_cuts reads m_paramSet, a field of the ProfileRoof's object
graph, which native_document decodes against the schema registry alone.
native_document::extract first decodes every parameter-definition owner in
the file to project saved parameter values, which this reader does not use;
extract_graphs skips that pass, as the wall-function reader does (RE-185).
On Measure's same-runner timing (run 39600160617), Autodesk's rac_advanced
2025 sample exported 1.24x slower than main with the rafter-cut read.

The probe also prints the slope arrows' heights and each roof's rafter cut
and fascia depth, so a Measure run shows what was read.
…s from Measure (DrunkOnJava#356) (RE-199)

README, docs/status.md, the support matrix's roof row, ROADMAP and an
[Unreleased] CHANGELOG entry crediting puzzbobb now say what RE-199 draws
and what it does not (DrunkOnJava#883, DrunkOnJava#884, DrunkOnJava#885). The report gives the oracle's
hash, the Measure runs that reproduce its table (39602093604, and
39600694074 for the BIM4LCA office), what changes and does not on the
reference models and Autodesk's samples, the same-runner timing, and marks
the unattached imperial models and the unmeasured 2024 tutorial house as
such.
@DrunkOnJava DrunkOnJava changed the title Roof function #356 (RE-170) feat(ifc): gable, hip and slope-arrow roofs as their planes, and roof slopes on Revit 2025 (#356) (RE-199) Oct 21, 2026

@DrunkOnJava DrunkOnJava left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this, and for building the oracle #356 asked for. Purpose-made models with Revit's own exports, under Apache-2.0, are what this project is short of, and Measure reproduces your table on GitHub's runners to the sixth decimal.

Measured (Measure run 39602093604, base main, -f r2025=true plus Autodesk's 2024 and 2025 samples, with a new scorer, tools/re/roof_bodies_vs_ifc.py, that meshes each roof in both exports): 18 of the 19 roofs in Revit's exports of your models now have Revit's body (every vertex within 3.7e-6 ft, the volumes yours), against 0 of 19 on main; the 19th is 11_RoofByExtrusion. The reference models, the BIM4LCA office, the family corpus and every 2024 sample but rac_advanced export byte-identically. rac_advanced draws one roof along its slope arrow in both its 2024 and 2025 saves, and the 2025 samples draw 29, 4 and 1 more elements from their sketches.

What I changed on your branch (maintainerCanModify is on):

  1. Signing. main requires signed commits, so your three commits are replaced by one signed commit with the same tree (I checked it is identical to fde03348's), you as its author. Your second commit's author email had come through as --?; it now carries your noreply address. You don't need to do anything.
  2. RE-199. RE-170 was already given out: reports/element-framing/RE-170-unread-joins.md is on main. The report, probe and every mention are renumbered RE-199.
  3. arrow_heights underflow. After checking the angle at at.checked_sub(0x08), it read at - 0x18, at - 0x10, at - 0x28 and at - 0x20 unchecked, so a 16-byte ff run in a line's first 0x28 bytes panics wherever overflow checks are on (debug builds, the i686 job). It now reads all of them from at.checked_sub(0x28), with the same results everywhere else.
  4. A bound on envelope_slab_mesh. With up to 32 planes it cuts along about 2,000 lines, and each cut can split every piece, so a crafted sketch could ask for millions of pieces before the record-box check rejects the body. Past 65,536 pieces or side segments it now draws nothing.
  5. The rafter cut through extract_graphs. m_paramSet is an object-graph field, and native_document::extract first decodes every parameter-definition owner in the file, which this reader does not use. Same-runner timing showed rac_advanced 2025 at 1.24x main with it; through extract_graphs it is 1.08x (rac_basic 2025 1.06x, every other file within 4%), and every export is byte-identical to the extract version's.
  6. Evidence and status. The roof scorer in every Measure run, the rafter cuts, fascia depths and slope arrows in the probe's output, and README, docs/status.md, the support matrix, ROADMAP and a CHANGELOG entry crediting you. In the report I gave the oracle's hash, marked the seven unattached imperial models as not checkable from the repository, and qualified the tutorial-house sentence: on 2024 a roof's edges now also come from its Sketch's curve list, so that file is not known to export unchanged.

Two observations for later, in #885: on rac_advanced 2024 the defining edges of three 15° hips carry 0.0 at +0x3b, not −rise/run, so RE-56's 2024 rule rejects them, while the same edges in the 2025 save, also 0.0 there, pass your 2025 rule. And on 2025 those three hips are read but fail the record-box check: each box is exactly the hip's rise, about 1.348 ft over a 10 ft span, with no thickness added.

The follow-ups for the limitations you listed are #883 (roofs by extrusion), #884 (T and U footprints) and #885 (the cases with no oracle). This merges once CI passes.

@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 21, 2026 13:00
@DrunkOnJava
DrunkOnJava merged commit b6086d4 into DrunkOnJava:main Oct 21, 2026
30 checks passed
@puzzbobb puzzbobb mentioned this pull request Oct 22, 2026
14 tasks done
@DrunkOnJava DrunkOnJava mentioned this pull request Oct 24, 2026
10 of 12 tasks
DrunkOnJava added a commit that referenced this pull request Oct 24, 2026
## Summary

Prepares v0.7.0 (RELEASE.md steps 4 to 8): the version files, the
`[0.7.0]` changelog section assembled from `changelog.d/`, the README's
release section, and corrections to the status docs where they still
described the state before RE-212 or before the BIM4LCA office was
measured. Merging this is not the release; the signed tag on its squash
commit is.

## Motivation

Griffin's go-ahead (2026-10-24, about 3:00 PM): tag v0.7.0 once #887,
#930, #935, #940, #942 and #943 are on main with CI green. All six have
landed, the last at b04c0cb (#930). #934 (`--revit-property-sets`,
breaking) and #923 (the `ElementId` newtype, breaking) go in the next
release.

## Changes

- **Version files** (0.6.1 to 0.7.0): `Cargo.toml`, `rvt-py/Cargo.toml`
(and its `=0.7.0` pin on `rvt`), `rvt-wasm/Cargo.toml`, the `rvt` pin in
`tools/stream_evidence/Cargo.toml`, `viewer/package.json`,
`CITATION.cff` (`date-released: 2026-10-24`),
`.release-please-manifest.json`, and the workspace crates' entries in
`Cargo.lock` and `fuzz/Cargo.lock`.
- **`CHANGELOG.md`**: `python3 tools/release/changelog.py assemble`
moved the nine fragments in, then `[Unreleased]` became `[0.7.0] —
2026-10-24`, with an introduction, credits to puzzbobb (#870, #886,
#887, #935) and n3ur0m4n (#882), and "Upgrading from 0.6": the research
readers behind `unstable-research`, the `#[non_exhaustive]` types, the
error variants (and Python's `ValueError`), `SimpleDecoder`, the
property set builders' `Vec`, the removed `ifc::pset_validate`, the
element walk failing closed, and changed exports. Headings in the
assembler's order (Added, Changed, Fixed, Removed, Research), one each.
`[Unreleased]` is left empty.
- **Entries corrected for the release as a whole**: #847's pipe-port
entry said In ports' axes were wrong because their flow direction was
not read, and that other family-instance ports had no placement; RE-212
and #943 changed both, and it now gives main's counts (Measure
40126110706, base side: 124 of 124 and 62 of 62 with Revit's axis;
joined ports 108 and 53 as Revit's, 10 and 6 opposite). The
unjoined-ports entry says Revit 2025 in its headline. RE-215's entry
adds the office.
- **`README.md`**: "Release 0.7.0 and main", what 0.7.0 adds in brief.
The 0.6.1 section listed RE-215 under 0.6.0's additions; it shipped in
neither.
- **`docs/support-matrix.json`**:
- `native-symbol-cut-sizes`: the BIM4LCA office's result, and
`user_impact` limited to families whose symbol cuts an outline;
- `element-record-mep-connections`: still said HVAC and piping
directions, names and descriptions are not read and In ports' axes are
reversed; it now states RE-212 (direction, `InPort_`/`OutPort_` names,
`Flow` descriptions, axes), keeps SystemType and the electrical
description as unread, and lists RE-212's probe, scorer, test and report
as evidence.
- **`docs/status.md`** and
**`reports/element-framing/RE-215-symbol-cut-loops.md`**: the office,
which §6 called NOT MEASURED, as measured on 2026-10-24 (Measure
40121636312 and 40122363218): 187 of its 269 doors cut an outline and
have Revit's sizes; its 269 windows and other 82 doors are drawn by
symbols with no cut loop (#810).

## Testing

Unit tests are banned in this repository: do not add them. Show the
change working end to end on real files instead.

- [ ] `tools/check-local.sh` passes: this PR's CI. No code changes; the
version string changes the IFC header.
- [x] Verified end to end on real Revit files: no behaviour changes; the
measurements cited are the runs named above.
- [ ] If this touches the IFC exporter: the IFC header carries the
version (#417), so both Core Interior `rvt-rs.json` observations and
their verdicts are refreshed from this PR's CI run (its
`octetproof-core-interior` artifact) in a follow-up commit here,
differing only in `witness_version` and the verdict hashes.
- N/A: performance.

## Audit-honesty checklist

- [x] README / docs reflect the current state after this PR
- [x] The changelog section is assembled from the fragments;
`changelog.py check` passes with none left
- [x] Resolved limitations updated (RE-212's in the support matrix, the
office's NOT MEASURED)
- N/A: no new limitation
- [x] Commit messages describe what changed and why
- [x] No emojis in code, docs, or commit messages
- [x] No private paths, personal email addresses, or internal jargon in
committed files
- N/A: not a reverse-engineering finding

## Legal and contribution hygiene

- [x] Apache-2.0
- [x] No Autodesk proprietary content
- [x] No fixtures

## Breaking changes

The release's, listed under "Upgrading from 0.6" in `CHANGELOG.md`. This
PR itself changes no API.

## Screenshots or output samples

N/A: the IFC changes only in its header's version.
@DrunkOnJava

Copy link
Copy Markdown
Owner

This shipped in v0.7.0, released today (2026-10-24) on crates.io, PyPI, the release archives and the container image, and it is credited in the release notes. Thank you.

@puzzbobb
puzzbobb deleted the roof_function branch October 27, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:geometry Work in the geometry area. area:ifc Work in the ifc area. area:partitions Work in the partitions area. community From a contributor outside the maintainers re-finding New RVT on-disk format finding type:feature New product or library capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sloped roofs need a Revit 2024/2025 pitched-roof oracle

2 participants