Repository navigation
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
Conversation
…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.
DrunkOnJava
force-pushed
the
feat/mesh-net-volume
branch
from
November 9, 2026 18:34
f0e8b01 to
cd5bfc0
Compare
… 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
marked this pull request as ready for review
November 9, 2026 19:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A body rvt-rs draws from the mesh Revit saved for it now gives its
NetVolumewhere 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 (anIfcMember, anIfcPlateand anIfcColumn), where it held none. Revit's export takes these from the volume of the solid it writes, which the saved mesh is. A column'sGrossVolumeis 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,mainatcbeba4c7) compares the mesh's volume with Revit'sNetVolume: 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 notNetSurfaceArea(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) andall_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_volumesgivesNetVolumeto theIfcMember,IfcPlateandIfcColumnit draws from a flat-faced closed mesh and that holds none, inQto_MemberBaseQuantities,Qto_PlateBaseQuantitiesandQto_ColumnBaseQuantities;--no-base-quantitiesleaves 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 ofdocs/supported-profile.md,docs/release-1.0-criteria.mdanddocs/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 passedon the final headholdout=true, run 42680955225 (codea82047abagainstmainat5247e7ba, 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.NetVolumemissing 2,208 to 325,Qto_PlateBaseQuantities.NetVolume260 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 2025Rooms_Stairsmodels 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-quantitiesleaves 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 onlyexported.total_entitiesdoes (90,983 to 91,261 as built;decoded.parameter_value_countstays).same-project gatespasses ona82047ab. RE-387 section 3.Audit-honesty checklist
changelog.d/added/.GrossVolumeand a mullion'sNetSurfaceAreastay out (RE-387 section 4).Legal and contribution hygiene
CONTRIBUTING.md)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 (NetVolumeCalculatorof 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.Breaking changes
None.
Related issues
Refs #1046 (W7), #1016, #1191, RE-243, RE-268.