Skip to content

feat(ifc): give a building element proxy its NetVolume from its saved mesh (#1016) - #1753

Closed
DrunkOnJava wants to merge 1 commit into
mainfrom
pilot/29-buildingelementproxy-netsurfacearea-netvolum
Closed

DrunkOnJava wants to merge 1 commit into
mainfrom
pilot/29-buildingelementproxy-netsurfacearea-netvolum

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

Revit's export writes Qto_BuildingElementProxyQuantities on all 12 IfcBuildingElementProxy objects of the BIM4LCA office as built; rvt-rs writes no base quantity set on any of them, so both NetSurfaceArea and NetVolume are missing on 12 (qtos_vs_ifc.txt lines 25-26 and 113-114). This change gives a proxy the NetVolume that the existing saved-mesh rule already gives a member, a panel and a column: the volume of the closed mesh of flat faces Revit saved for its body, written as Qto_BuildingElementProxyQuantities.NetVolume where the element holds none.

It does not write NetSurfaceArea, and it writes nothing on a proxy whose body has a curved face; both are explained below.

Evidence

What was read:

  • The census: Qto_BuildingElementProxyQuantities.NetSurfaceArea: 12, equal 0, different 0, missing 12 and .NetVolume: 12, equal 0, different 0, missing 12, both on IfcBuildingElementProxy x12.
  • The 12 objects, matched by Tag between revit.ifc and rvt-rs.ifc: the same 12 Tags in both files, one for one (1337610, 3318085, 3318255, 3318316, 3318379, 3320044, 3321175, 3321733, 3322083, 3322685, 3437318, 3437475). rvt-rs already writes all 12 proxies; none holds a Qto_ set.
  • Revit's values on each. Three are drawn in rvt-rs as a box, and Revit's two values are exactly the box's:
    • 1337610 Kohdistuskappale:3x2x1, body 1.0 x 2.0 x 3.0 m: Revit's NetVolume 6.0000000000000107 (box: 6) and NetSurfaceArea 22.000000000000025 (box: 22).
    • 3437318 and 3437475 HISSI-HEN-1, body 1.1 x 1.4 x 2.4 m: Revit's NetVolume 3.6960000000001529 and 3.6960000000001432 (box: 3.696) and NetSurfaceArea 15.080000000000476 twice (box: 15.08).
    • The other nine, the wall sweeps Wall Sweep:JSV-4 (3) and Wall Sweep:JSV-5 (6), are drawn in rvt-rs from a 12-corner profile with rounded folds (for example 19.680112424148135 m2 and 0.019600992914251877 m3 on 3318085), not a box.
  • The code that leaves them out: saved_meshes::add_mesh_volumes maps only IFCMEMBER, IFCPLATE and IFCCOLUMN to a base quantity set (_ => continue), so a proxy's mesh volume is computed and then dropped. mesh_volume::all_faces_flat and closed_mesh_volume already refuse a body with a curved face and one that does not close.
  • RE-387 §2, the measurement the rule comes from: revit-ifc's NetVolumeCalculator takes the volume of the solid it writes, the mesh Revit saved is that solid tessellated, and "the mesh's volume is not Revit's where the body has a curved face ... 4 of the office's 12 IfcBuildingElementProxy NetVolume differ by 1.7e-5 to 4.5e-5 of the value" - so 8 of the 12 the mesh volume equals to the scorer's 1e-5. RE-387 §4 records that only members, plates and columns are given a volume so far.

The rule, and what it leaves out:

  • A building element proxy drawn from a mesh that is one closed surface of flat faces gets its NetVolume, the volume of that mesh, in Qto_BuildingElementProxyQuantities, where it holds none; no value an element holds is replaced.
  • A body with a curved face is refused by all_faces_flat, as for a member: its mesh is a tessellation of the solid, and RE-387 measures the mesh's volume away from Revit's on 4 of the office's 12 proxies. The nine wall sweeps of the office, whose mesh comes from a 12-corner rounded profile, are that kind; the three boxes are not, and their mesh gives exactly the value Revit's export writes (above).
  • Nothing else is written. In particular the NetSurfaceArea stays out: RE-387 §2 measures that a mesh's surface area is not Revit's NetSurfaceArea where Revit's own area leaves out a face a join hides (4,087 of the office's 9,678 mullions only), and no measurement exists of a proxy's area against its mesh's. That the three box-drawn proxies' Revit area is exactly the box's surface (22 and 15.08 twice) is noted here as the reason a later rule could carry it, not as a rule now.
  • The split of the office's 12 by this rule is for the measurement to report. What is established by the bytes above is that the rule's value is Revit's on the three boxes, that Revit writes the set on all 12, and that RE-387 measures the mesh's volume equal to Revit's on 8 of the 12 and not on 4, which are drawn from a curved profile and are refused.

Changes

  • src/ifc/saved_meshes.rs: add_mesh_volumes maps IFCBUILDINGELEMENTPROXY to Qto_BuildingElementProxyQuantities with NetVolume, beside the member, plate and column arms. The function's doc comment names the proxy among the entities the rule covers and says why a proxy drawn from a tessellated profile gets none.
  • docs/supported-profile.md: the NetVolume-from-the-saved-mesh sentence now lists IfcBuildingElementProxy with IfcMember, IfcPlate and IfcColumn.
  • changelog.d/added/proxy-net-volume.md: the fragment.

No test is edited; the tests that touch quantities assert only total_entities >= 1.

What was not checked

  • I could not compile or run anything: cargo clippy -D warnings, rustfmt, the real-file tests and the measurement are CI's. The match arm's block and the doc-comment intra-doc link ([all_faces_flat], already imported in the file) are the parts a compiler must confirm.
  • The measurement must confirm three things: that Qto_BuildingElementProxyQuantities.NetVolume on the office as built reads equal on every proxy it now writes and different on none; that rvt-rs quantities Revit does not write stays 0 (Revit's export must write the set on every proxy the rule reaches in the other measured models); and that NetSurfaceArea and the nine wall sweeps stay missing. If any proxy it writes reads different, the rule is wrong on that element and must be narrowed - RE-387 §4 warns that a proxy's mesh volume is not Revit's where the solid has a curved face, and this change relies on all_faces_flat refusing exactly those.

Pilot draft: written by an automated worker and pushed as proposed, with rustfmt applied. Not yet read by a maintainer session; please do not review, approve or arm it.

@DrunkOnJava

Copy link
Copy Markdown
Owner Author

Superseded by #1775: the same change on a fresh branch on today's main, with the measured rows in its body.

DrunkOnJava added a commit that referenced this pull request Nov 11, 2026
… mesh (#1016) (#1781)

## Summary

Revit's export writes `Qto_BuildingElementProxyQuantities` on all 12
`IfcBuildingElementProxy` objects of the BIM4LCA office as built; rvt-rs
writes no base quantity set on any of them, so both `NetSurfaceArea` and
`NetVolume` are missing on 12 (`qtos_vs_ifc.txt` lines 25-26 and
113-114). This change gives a proxy the `NetVolume` that the existing
saved-mesh rule already gives a member, a panel and a column: the volume
of the closed mesh of flat faces Revit saved for its body, written as
`Qto_BuildingElementProxyQuantities.NetVolume` where the element holds
none.

It does not write `NetSurfaceArea`, and it writes nothing on a proxy
whose body has a curved face; both are explained below.

## Evidence

What was read:

- The census: `Qto_BuildingElementProxyQuantities.NetSurfaceArea: 12,
equal 0, different 0, missing 12` and `.NetVolume: 12, equal 0,
different 0, missing 12`, both `on IfcBuildingElementProxy x12`.
- The 12 objects, matched by Tag between `revit.ifc` and `rvt-rs.ifc`:
the same 12 Tags in both files, one for one (1337610, 3318085, 3318255,
3318316, 3318379, 3320044, 3321175, 3321733, 3322083, 3322685, 3437318,
3437475). rvt-rs already writes all 12 proxies; none holds a `Qto_` set.
- Revit's values on each. Three are drawn in rvt-rs as a box, and
Revit's two values are exactly the box's:
- 1337610 `Kohdistuskappale:3x2x1`, body 1.0 x 2.0 x 3.0 m: Revit's
`NetVolume` 6.0000000000000107 (box: 6) and `NetSurfaceArea`
22.000000000000025 (box: 22).
- 3437318 and 3437475 `HISSI-HEN-1`, body 1.1 x 1.4 x 2.4 m: Revit's
`NetVolume` 3.6960000000001529 and 3.6960000000001432 (box: 3.696) and
`NetSurfaceArea` 15.080000000000476 twice (box: 15.08).
- The other nine, the wall sweeps `Wall Sweep:JSV-4` (3) and `Wall
Sweep:JSV-5` (6), are drawn in rvt-rs from a 12-corner profile with
rounded folds (for example 19.680112424148135 m2 and
0.019600992914251877 m3 on 3318085), not a box.
- The code that leaves them out: `saved_meshes::add_mesh_volumes` maps
only `IFCMEMBER`, `IFCPLATE` and `IFCCOLUMN` to a base quantity set (`_
=> continue`), so a proxy's mesh volume is computed and then dropped.
`mesh_volume::all_faces_flat` and `closed_mesh_volume` already refuse a
body with a curved face and one that does not close.
- RE-387 §2, the measurement the rule comes from: revit-ifc's
`NetVolumeCalculator` takes the volume of the solid it writes, the mesh
Revit saved is that solid tessellated, and "the mesh's volume is not
Revit's where the body has a curved face ... 4 of the office's 12
`IfcBuildingElementProxy` `NetVolume` differ by 1.7e-5 to 4.5e-5 of the
value" - so 8 of the 12 the mesh volume equals to the scorer's 1e-5.
RE-387 §4 records that only members, plates and columns are given a
volume so far.

The rule, and what it leaves out:

- A building element proxy drawn from a mesh that is one closed surface
of flat faces gets its `NetVolume`, the volume of that mesh, in
`Qto_BuildingElementProxyQuantities`, where it holds none; no value an
element holds is replaced.
- A body with a curved face is refused by `all_faces_flat`, as for a
member: its mesh is a tessellation of the solid, and RE-387 measures the
mesh's volume away from Revit's on 4 of the office's 12 proxies. The
nine wall sweeps of the office, whose mesh comes from a 12-corner
rounded profile, are that kind; the three boxes are not, and their mesh
gives exactly the value Revit's export writes (above).
- Nothing else is written. In particular the **`NetSurfaceArea` stays
out**: RE-387 §2 measures that a mesh's surface area is not Revit's
`NetSurfaceArea` where Revit's own area leaves out a face a join hides
(4,087 of the office's 9,678 mullions only), and no measurement exists
of a proxy's area against its mesh's. That the three box-drawn proxies'
Revit area is exactly the box's surface (22 and 15.08 twice) is noted
here as the reason a later rule could carry it, not as a rule now.
- The split of the office's 12 by this rule is for the measurement to
report. What is established by the bytes above is that the rule's value
is Revit's on the three boxes, that Revit writes the set on all 12, and
that RE-387 measures the mesh's volume equal to Revit's on 8 of the 12
and not on 4, which are drawn from a curved profile and are refused.

## Changes

- `src/ifc/saved_meshes.rs`: `add_mesh_volumes` maps
`IFCBUILDINGELEMENTPROXY` to `Qto_BuildingElementProxyQuantities` with
`NetVolume`, beside the member, plate and column arms. The function's
doc comment names the proxy among the entities the rule covers and says
why a proxy drawn from a tessellated profile gets none.
- `docs/supported-profile.md`: the `NetVolume`-from-the-saved-mesh
sentence now lists `IfcBuildingElementProxy` with `IfcMember`,
`IfcPlate` and `IfcColumn`.
- `changelog.d/added/proxy-net-volume.md`: the fragment.

No test is edited; the tests that touch quantities assert only
`total_entities >= 1`.

## Measured

One Measure run scored this change together with nine others it was
drafted beside (run 43086493417, head `f5f54467`, base `5e3ac5b0`: every
model, with the BIM4LCA office and housing, the Revit 2025 models,
Autodesk's samples of every release, rac_advanced, BIMcollab and the
held-out pairs; every shard and both same-project gates passed; rows
registered on #1636 before it was read). Each change writes a value of a
different name, so the rows below are this change's alone. Both sides'
exports were kept, and the 58 sample saves, which no Revit export
scores, were compared value by value. After the second read the stack
was rebuilt on `main` as seven changes (the pipe change left it, and the
roof and floor-opening rules were narrowed to square-cornered outlines)
and measured once more in full (run 43100937918, head `53c19487` against
`e8a99d03`, rows registered first, read on #1636): all shards and both
same-project gates pass, "different" and "values Revit does not write"
are unchanged on every model, and the rows below repeat except where a
line says otherwise.

| Models | `Qto_BuildingElementProxyQuantities.NetVolume` equal, after
(0 before) | different |
|---|---:|---:|
| Office as built, at permit | 8 of 12 each | 0 |
| Timber office as built, at permit | 6 of 11 each | 0 |
| Housing, four files | 3 of 3 each | 0 |
| Office and housing terrain, four files | 1 of 1 each | 0 |
| Revit 2025 models 12 to 17 | 6 of 9 each | 0 |
| Held-out pairs of 2024, 2025, 2026, 2027 | 24 of 48 each | 0 |
| Held-out office pairs of 2024 to 2027 | 20 of 40 each | 0 |

- 256 values on 26 models, none different, under four exporter releases;
"quantities Revit does not write" is unchanged on every model. The draft
named the office's 3 boxes; 8 of its 12 proxies have a saved mesh of
flat faces.
- On exports that write no base quantities the values are counted apart
(RE1 Architecture 6).
- **Sample saves, which nothing scores:** 5,374 proxies in 15 saves gain
the value, most of them receptacles and switches (778 in Snowdon Towers
Electrical, 514 in each `rme` save). Those are proxies in Revit's own
export too: on RE1 Electrical, Revit's and rvt-rs's exports agree on all
30. Every value added is positive; none was removed or changed.

## Still open

- `NetSurfaceArea`: a join may hide faces from Revit's area (RE-387), so
none is written.
- A proxy whose solid has a curved face gets no `NetVolume`: its saved
mesh is a tessellation.

Stack: this is change 2 of 7; each branch holds the ones before it, so
its own diff is its last commits until those land. First draft: #1753,
then #1775.

## Testing

- Built, linted and tested by CI on this head; nothing was built on a
workstation.
- Verified end to end on real Revit files against Revit's own exports:
the Measure runs named above, which anyone can repeat with `gh workflow
run measure.yml --ref main -f ref=<this head> -f
base=e8a99d03be8a76a2c8871ea8cc28d036653ec6e2 -f nordic=true -f
r2025=true -f samples=true -f racadv=true -f bimcollab=true -f
holdout=true`.
- No test was added: no unit test, and no pinned count moves except
where the body says so.

## Audit-honesty checklist

- [x] Docs state what this change writes and what it leaves out
- [x] A changelog fragment under `changelog.d/`
- [x] No emojis, private paths or personal data in committed files
- [x] Limits are in the body above and in the code's doc comments

## Legal and contribution hygiene

- [x] Apache-2.0
- [x] No Autodesk proprietary source, decompiled internals or NDA
material. Where revit-ifc (CLEANROOM.md source 5) is cited, it is read
and cited by file and class, and no code is copied.
- [x] No fixture with real-world personal data

## Breaking changes

None.
@DrunkOnJava
DrunkOnJava deleted the pilot/29-buildingelementproxy-netsurfacearea-netvolum branch November 12, 2026 02:13
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