Skip to content

feat(ifc): a body drawn from its saved mesh of flat faces gives its NetVolume, as Revit's export writes it (#1046) (RE-387) - #1625

Merged
DrunkOnJava merged 3 commits into
mainfrom
feat/mesh-net-volume
Nov 9, 2026
Merged

DrunkOnJava merged 3 commits into
mainfrom
feat/mesh-net-volume

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

A body rvt-rs draws from the mesh Revit saved for it now gives its NetVolume where every face of the mesh is flat and the mesh closes: the volume of the mesh, in the base quantity set of its entity, for a curtain mullion, a curtain panel and a column (an IfcMember, an IfcPlate and an IfcColumn), where it held none. Revit's export takes these from the volume of the solid it writes, which the saved mesh is. A column's GrossVolume is not written: Revit's export omits it on 18 columns at permit that nothing tells from the 6 it writes it on.

Motivation

#1046 keeps in W7 the base quantities Revit computes from its joined geometry. #1610 draws every element that would be a box from its saved mesh by default, so rvt-rs now holds each mullion's and panel's solid. The new scorer tools/re/mesh_quantities_vs_ifc.py (Measure 42669397638, the office as built and at permit and the 24 Revit 2025 models, main at cbeba4c7) compares the mesh's volume with Revit's NetVolume: it is Revit's on all 9,678 mullions as built (9,706 at permit), 260 panels (269) and 199 columns (289), with 1,883 mullions and 260 panels that rvt-rs wrote none for. It is not Revit's where a face is curved (4 of 12 proxies, 42 of 44 spaces: a tessellation) and the mesh's surface area is not NetSurfaceArea (Revit leaves out the end faces its joins hide, 4,087 of 9,678 equal). The report is RE-387.

Changes

  • src/ifc/mesh_volume.rs: closed_mesh_volume (a volume only for triangles that, their vertices welded, close a surface wound one way) and all_faces_flat (one normal on all the vertices of each face), with failure-first unit tests of the two pure helpers.
  • src/ifc/saved_meshes.rs: add_mesh_volumes gives NetVolume to the IfcMember, IfcPlate and IfcColumn it draws from a flat-faced closed mesh and that holds none, in Qto_MemberBaseQuantities, Qto_PlateBaseQuantities and Qto_ColumnBaseQuantities; --no-base-quantities leaves it out with the rest.
  • tools/re/mesh_quantities_vs_ifc.py, changelog.d/added/387-mesh-net-volume.md, the report RE-387, and the W7 lines of docs/supported-profile.md, docs/release-1.0-criteria.md and docs/evidence.md.

Testing

The two helpers are pure and have a few failure-first unit tests (an open mesh, one triangle wound the other way, a repeated triangle, a vertex that is missing or not finite, no triangle, faces that hold their own vertices); the change itself is shown end to end on real files:

  • full / CI passed on the final head
  • Verified end to end on real Revit files: the unfiltered Measure with every flag and holdout=true, run 42680955225 (code a82047ab against main at 5247e7ba, 118 exports; the commits after it change only the report and docs). 37 exports move; the other 81 are byte-identical. Office as built: equal 29,761 to 31,904 of 39,754 (Qto_MemberBaseQuantities.NetVolume missing 2,208 to 325, Qto_PlateBaseQuantities.NetVolume 260 to 0), at permit 30,037 to 32,196 of 40,006 (the same, plates 269 to 0, and 7 columns); different stays 1 and the quantities written that Revit's export does not stay 0 on both. The 2 members of each of the three Revit 2025 Rooms_Stairs models are equal (43 to 45 each, different 0). The held-out counts: the 2 members of each of the four Revit 2024 to 2027 pairs and the 8 columns of one Revit 2023 model are equal, different unchanged, and no quantity is written that their exports omit. RE1 Architecture's export writes no base quantities (RE-242), so its 2 panels' volumes are counted apart, 96 to 98 written, which --no-base-quantities leaves out. Einhoven and the 25 Autodesk samples have no Revit export and only gain the values. No body, property, box, mesh or material scorer moves, and of the diagnostics only exported.total_entities does (90,983 to 91,261 as built; decoded.parameter_value_count stays). same-project gates passes on a82047ab. RE-387 section 3.
  • If this touches the IFC exporter: Core Interior's export is byte-identical on both sides (it is not among the 37 that move), so no witness observation changes.

Audit-honesty checklist

  • README / docs reflect the current state after this PR: the report, and the W7 lists of the supported profile, the 1.0 criteria and the evidence page.
  • A user-visible change has its entry as a fragment under changelog.d/added/.
  • If a limitation was resolved, the docs are updated: RE-387 section 3 and the three pages above.
  • If a new limitation was introduced, it is documented in the PR body and in-code: a body with a curved face gets no volume (the test refuses it, and no member, plate or column of the measured models is refused, so the refusal is shown on no Revit export), a wall drawn from a mesh and the ramp flight are not given one here, a column's GrossVolume and a mullion's NetSurfaceArea stay out (RE-387 section 4).
  • 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: the report RE-387.

Legal and contribution hygiene

  • I agree this work is licensable under Apache-2.0 (see CONTRIBUTING.md)
  • This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content (see CLEANROOM.md). Contributor declaration: every fact here comes from byte observations of the BIM4LCA office's and puzzbobb's files with Revit's own IFC4 exports of them, and from reading Autodesk's open-source exporter (NetVolumeCalculator of revit-ifc, CLEANROOM.md source 5, as RE-243 cites it) for what Revit's export writes. No Autodesk or ODA SDK source, disassembly, leaked document or NDA material was used, and nothing was copied or translated from revit-ifc.
  • No new test fixtures

Breaking changes

None.

Related issues

Refs #1046 (W7), #1016, #1191, RE-243, RE-268.

…etVolume, as Revit's export writes it (#1046) (RE-387)

revit-ifc's NetVolumeCalculator takes the volume of the solid it writes, and
the mesh Revit saved for an element is that solid. Measured on the BIM4LCA
office (Measure 42669397638, tools/re/mesh_quantities_vs_ifc.py), the volume
of the mesh equals Revit's NetVolume on all 9,678 mullions (9,706 at
permit), 260 panels (269) and the columns it is taken of, where rvt-rs wrote
1,883 and 260 fewer; a body with a curved face is a tessellation and a surface
area is not the mesh's (Revit leaves out the end faces its joins hide).

mesh_volume::closed_mesh_volume gives a volume only for triangles, their
vertices welded, that close a surface wound one way, and all_faces_flat only
for faces with one normal; saved_meshes gives it to an IfcMember, IfcPlate or
IfcColumn that holds none, in its base quantity set (a column's GrossVolume
too). The scorer lands with it.
… as Revit omits its GrossVolume on 18 columns at permit (#1046) (RE-387)
…rofile, the 1.0 criteria and the evidence page name the volumes it writes (#1046) (RE-387)

The unfiltered Measure of the code commit (run 42680955225, a82047a against main at 5247e7b) moves 37 of 118 exports and only their quantity census, the held-out counts, the MCP answers and the entity total: the office's equal quantities go from 29,761 to 31,904 as built and 30,037 to 32,196 at permit, different stays 1, and the quantities written that Revit's export does not stay 0.
@DrunkOnJava
DrunkOnJava marked this pull request as ready for review November 9, 2026 19:56
@DrunkOnJava
DrunkOnJava merged commit ae08c1d into main Nov 9, 2026
63 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/mesh-net-volume branch November 9, 2026 20:04
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