Repository navigation
fix(ifc): segment lengths in IFC4's base quantities and a pipe's invert in Pset_PipeSegmentOccurrence, not IFC2X3's flow-segment sets (#822) - #829
Merged
Conversation
DrunkOnJava
marked this pull request as ready for review
October 19, 2026 12:38
DrunkOnJava
force-pushed
the
fix/822-segment-sets
branch
2 times, most recently
from
October 19, 2026 12:51
8351f24 to
ca192db
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ca192dbe54
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…a pipe's invert in Pset_PipeSegmentOccurrence, not IFC2X3's flow-segment sets (#822) Revit's IFC2X3 export of the RE1 models writes a segment's length in Pset_FlowSegmentPipeSegment and Pset_FlowSegmentDuctSegment (and a duct's in Pset_DuctSegmentTypeCommon), and a pipe's invert in Pset_FlowSegmentPipeSegment: IFC4 has none of these. Its IFC4 export of the BIM4LCA office writes the length in Qto_PipeSegmentBaseQuantities and the invert in Pset_PipeSegmentOccurrence. A PropertySet named Qto_ is now written as an IfcElementQuantity of IFC4 simple quantities.
…eteElementGeneral, which IFC4 gives none (#822) Revit's IFC2X3 export of the RE1 models gives a building-element proxy's Serial Number in Pset_PrecastConcreteElementGeneral as well as Pset_ManufacturerOccurrence; IFC4's Pset_PrecastConcreteElementGeneral has no SerialNumber, so only Pset_ManufacturerOccurrence holds it. A Qto_ set with no quantity is not written: an IfcElementQuantity holds one at least.
…pipe's own invert parameter keeps its value (#822) Qto_PipeSegmentBaseQuantities, Qto_DuctSegmentBaseQuantities, Pset_PipeSegmentOccurrence and the duct's Pset_DuctSegmentTypeCommon are chosen by the entity an element is written as, not its Revit class, so a pipe or duct whose Export to IFC As writes it as another entity gets none of them. The storey elevation comes off only the invert rvt-rs works out in model height, by the sets' indices, so a pipe's parameter named Pset_PipeSegmentOccurrence.InvertElevation (RE-194) is written as it is.
…FC4 ones apart (#822) Revit's lengths, inverts and references are read from its IFC2X3 sets only and rvt-rs's from the IFC4 quantities and sets only, so the tests fail if rvt-rs writes them in IFC2X3's sets alone, and each checks rvt-rs writes none there.
DrunkOnJava
force-pushed
the
fix/822-segment-sets
branch
from
October 19, 2026 13:22
615912f to
c220943
Compare
…part, as IFC4 keeps it in Pset_ManufacturerOccurrence (#822) Revit's IFC2X3 export of RE1 Electrical writes each of 19 Serial Numbers in both Pset_PrecastConcreteElementGeneral and Pset_ManufacturerOccurrence. IFC4 keeps only the second, which rvt-rs writes and the scorer compares (31 of 31), so the first is counted apart instead of as missing.
DrunkOnJava
added a commit
that referenced
this pull request
Oct 19, 2026
…ot in Pset_PipeFittingTypeCommon, which IFC4 gives none (#822) (#833) ## Summary Part 5 of #822, its last IFC2X3 property. RE-165's pipe fitting `NominalDiameter` moves from `Pset_PipeFittingTypeCommon`, where IFC2X3 has it and IFC4 does not, to rvt-rs's own `RvtElementRecordGeometry` set. With it, Measure's IFC4 property set check (#826) finds nothing on any of the 89 exports. ## Motivation IFC4's `Pset_PipeFittingTypeCommon` has no `NominalDiameter` (buildingSMART's IFC4 definitions); after #829 the check found 5,469 such values on 11 exports. IFC4 keeps a pipe connection's nominal diameter on its port (`Pset_DistributionPortTypePipe`), but Revit's IFC4 export writes no such set: revit-ifc certifies `Pset_DistributionPortCommon` and none of the typed port sets for the IFC4 Reference View or Design Transfer View (`IFCCertifiedEntitiesAndPSets.json`), and its Reference View export of the BIM4LCA office writes no property set on any of its 67 ports. With no IFC4 placement that Revit's export uses, the measured value goes to rvt-rs's own set, as RE-187's door type sizes do. ## Changes - `src/ifc/export_content.rs`: a fitting's nominal diameter is one length, `NominalDiameter`, in its `RvtElementRecordGeometry` set; `Pset_PipeFittingTypeCommon.NominalDiameter` is no longer written. - `tests/fitting_nominal_diameter.rs`: reads Revit's file from `Pset_PipeFittingTypeCommon` only and rvt-rs's from its own set only, and checks that rvt-rs writes none in `Pset_PipeFittingTypeCommon`. - `tools/re/psets_vs_ifc.py`: counts an IFC2X3 reference's fitting `NominalDiameter` apart, as rvt-rs's own set is not scored. - `partition_fitting_sizes` module documentation, `PropertyValue::List` documentation, CHANGELOG. ## Testing Measure A/B against #829's head (c220943), run [39263341670](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39263341670), at 16ec4e9, whose `src` and `tests` are this branch's (it was rebased onto `main` once #829 landed), both sides scored with this PR's `psets_vs_ifc`: - IFC4 property set check: all 89 exports have no finding (78 before; the other 11 had 5,469 `NominalDiameter` values). IfcOpenShell validates all 89 with no finding. - 11 exports change, the ones with fittings: RE1 Mechanical and Plumbing, Autodesk's 2024 to 2027 MEP samples (advanced and basic) and Snowdon Towers' plumbing model. - RE1 Plumbing: the 46 values rvt-rs wrote in `Pset_PipeFittingTypeCommon` (on Revit's 42 fittings and 4 more) leave the values Revit's export does not hold, 48 → 2; Revit's 42 IFC2X3 diameters are counted apart on both sides, so equal values read 314 here where #829's scorer, which compared them, read 356. RE1 Mechanical: rvt-rs's 3, which Revit's export does not write, likewise (4 → 1). - `tests/fitting_nominal_diameter.rs` compares Revit's 42 diameters with rvt-rs's own set within a relative 1e-5 on corpus tier 2. `cargo fmt` is clean. No unit tests, by the repository's rule. ## Audit-honesty checklist - [x] README / docs reflect the current state after this PR - [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 ## Legal and contribution hygiene - [x] I agree this work is licensable under Apache-2.0 - [x] This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content Based on buildingSMART's IFC2X3 and IFC4 property set definitions (CLEANROOM.md source 4), Revit's own IFC exports of the RE1 models and the BIM4LCA office, and revit-ifc's `IFCCertifiedEntitiesAndPSets.json` (CLEANROOM.md source 5, read and cited). ## Breaking changes `Pset_PipeFittingTypeCommon.NominalDiameter` is no longer written; a fitting's nominal diameter is `RvtElementRecordGeometry.NominalDiameter`, one length rather than a list of one. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Breaking IFC export contract for consumers that read `Pset_PipeFittingTypeCommon.NominalDiameter`; behavior is localized to pipe fitting property emission and validation tooling. > > **Overview** > **Pipe fitting nominal diameter** no longer lands in `Pset_PipeFittingTypeCommon` (IFC4 has no `NominalDiameter` there). Export now writes the same measured value as a **single length** `NominalDiameter` on rvt-rs’s `RvtElementRecordGeometry` set, alongside other record geometry properties. > > Corpus and tooling follow that split: `tests/fitting_nominal_diameter.rs` compares Revit’s IFC2X3 reference from the old set, asserts rvt-rs does not emit the legacy property, and checks values in the own set; `tools/re/psets_vs_ifc.py` excludes this IFC2X3-only property from the IFC4 property-set score. Docs and CHANGELOG note the breaking export shape (list of one → one length, new location). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1080604. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
DrunkOnJava
added a commit
that referenced
this pull request
Oct 19, 2026
…al port is SOURCEANDSINK (#828) (RE-197) (#832) ## Summary Closes #828. Each port's `PredefinedType` is its connector's domain (`DUCT`, `CABLE`, `PIPE`), as Revit's IFC4 export types it, and a connector of a domain Revit's exporter gives no direction, every one but HVAC and piping, is `SOURCEANDSINK`. RE-197 records the measurement and the negatives: an HVAC or piping connector's direction and a port's `SystemType` are not in what rvt-rs reads, and Revit's IFC4 Reference View export writes no port property set. ## Motivation rvt-rs wrote every port with `FlowDirection` `.NOTDEFINED.` and no `PredefinedType`. Revit's IFC4 export of the BIM4LCA office writes all 67 of its ports `SOURCEANDSINK`, 43 `CABLE` / `ELECTRICAL` and 24 `PIPE` / `HEATING`. A port's `PredefinedType` also decides which IFC4 port property sets apply to it. ## Changes - `src/native_connectors.rs`: `symbol_port_indices` returns each connector's domain with its index; `port_type_of_domain` maps HVAC to `DUCT`, electrical to `CABLE`, piping to `PIPE` and an undefined domain to `NOTDEFINED` (a cable tray or conduit connector has no port, RE-169); `port_flow_direction_of_domain` gives `SOURCEANDSINK` for every domain but HVAC and piping, as revit-ifc's `ConnectorExporter` does. - `src/ifc/entities.rs`, `export_content.rs`, `mod.rs`, `step_writer.rs`: `IfcEntity::Port` carries `predefined_type` and `flow_direction`; a duct's or pipe's two ports are `DUCT` or `PIPE`, with no direction; the writer fills `FlowDirection` and `PredefinedType`, `NOTDEFINED` and `$` where nothing is read. - `examples/probe_re197_connector_directions.rs`: tallies every field of a family's `ConnectorDataCell`, and of the `FamilyParams` object its `m_oRelevantParams` points to, against the direction of the port in Revit's export. - `tools/re/ports_vs_ifc.py`: compares `FlowDirection`, `PredefinedType` and `SystemType` on the ports both exports hold, only those the schema of Revit's export gives a port (an IFC2X3 port has `FlowDirection` only). - RE-197 report; the ports row of the support matrix, which also drops what B83, B84 and RE-169 made stale (proxies have ports, every port is nested, 73 of 73 and 126 of 126 connections); README; CHANGELOG. ## Testing Measure A/B against `main` (cdac7e6), run [39261416282](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39261416282), at f5a2216, both sides scored with this PR's `ports_vs_ifc`: | | `PredefinedType` equal | `FlowDirection` equal | |---|---:|---:| | BIM4LCA office, as built (67 ports) | 0 → 67 | 0 → 43 | | BIM4LCA office, building permit (67 ports) | 0 → 67 | 0 → 43 | | RE1 Electrical (53 ports, IFC2X3) | not in the schema | 0 → 53 | | RE1 Mechanical (150 ports, IFC2X3) | not in the schema | 0 → 1 | | RE1 Plumbing (260 ports, IFC2X3) | not in the schema | 0 → 1 | - No port takes a direction Revit's export does not give it, on any of the five models. - Left as before: the office's 24 pipe ends (`SOURCEANDSINK` in Revit's export, `NOTDEFINED` here) and RE1's HVAC and piping ports, whose direction is not read; `SystemType` on all 67 office ports. - Ports and connections are unchanged: Mechanical 73 of 73 connections and 150 of 150 ports, Plumbing 126 of 126 with 2 not in Revit's export, every port tied to its element. - 29 of the 89 exports change, every one with ports. IfcOpenShell finds nothing on any of the 89. - The probe (runs [39253573356](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39253573356), [39255994320](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39255994320), [39256707456](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39256707456)): no field of the connector cell or its `FamilyParams` object separates In from Out ports; every electrical connector's port is `SOURCEANDSINK`, 98 of 98. Final A/B on `main` after #829 (7d8e8fd), run [39267434693](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39267434693), at a2a8897: every port figure above is the same, the same 29 exports change, IfcOpenShell finds nothing on any of the 89, and no port takes a direction Revit's export does not give it. The review fixes after it (0070b76: port values only from IFC4's enumerations, and the unread electrical description override stated) change no export, as every value the exporter writes is in those enumerations, and #833, merged since, changes no port. `cargo fmt` is clean. No unit tests, by the repository's rule. ## Audit-honesty checklist - [x] README / docs reflect the current state after this PR - [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 ## Legal and contribution hygiene - [x] I agree this work is licensable under Apache-2.0 - [x] This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content Based on byte observations of the RE1 models and the BIM4LCA office against Revit's own IFC exports of them, and revit-ifc's `ConnectorExporter`, `ElementFilteringUtil` and `IFCCertifiedEntitiesAndPSets.json` (CLEANROOM.md source 5, read and cited, no code copied). ## Breaking changes `ifc::entities::IfcEntity::Port` gains the fields `predefined_type` and `flow_direction`, so code constructing it names both; `native_connectors::symbol_port_indices` returns `(index, domain)` pairs. An export's ports now carry `PredefinedType` and, where the domain gives one, `FlowDirection` `SOURCEANDSINK`. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes IFC MEP port semantics and a public `IfcEntity::Port` shape; behavior is bounded to match Revit on measured models but HVAC/piping directions remain intentionally incomplete. > > **Overview** > **IFC `IfcDistributionPort` export now follows Revit's connector-domain rules (RE-197 / #828).** Each port gets a **`PredefinedType`** from its connector domain (`DUCT`, `CABLE`, `PIPE`, or `NOTDEFINED`), and **`FlowDirection` `SOURCEANDSINK`** for every domain except HVAC and piping, where direction stays **`NOTDEFINED`** because the family connector setting is not read. Duct and pipe end ports are typed **`DUCT`** / **`PIPE`** accordingly. > > `IfcEntity::Port` carries `predefined_type` and `flow_direction`; `native_connectors` adds `port_type_of_domain` / `port_flow_direction_of_domain` and returns connector **domains** with symbol port indices. The STEP writer emits those attributes on `IFCDISTRIBUTIONPORT` instead of always `.NOTDEFINED.` and `$`. > > **Measurement and docs:** `tools/re/ports_vs_ifc.py` scores **`FlowDirection`**, **`PredefinedType`**, and **`SystemType`** against Revit's export; a new probe and RE-197 report document the rule and limits (`SystemType` and HVAC/piping direction still unset). Changelog, README, and the support matrix are updated with BIM4LCA / RE1 Electrical parity numbers. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit a2a8897. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
6 tasks done
DrunkOnJava
added a commit
that referenced
this pull request
Oct 19, 2026
## Summary Prepare v0.6.0. Merging this is not the release: the release is the signed `v0.6.0` tag on the merged commit, after the maintainer's go-ahead. This stays a draft until then. ## Motivation Since 0.5.1, `main` has: - **IFC4's own property sets (#822):** the IFC2X3 sets 0.5 took from Revit's exports of the RE1 models are gone or moved to where IFC4 and Revit's own IFC4 export put them (#825, #829, #833), and Measure checks every export's standard property sets against buildingSMART's published IFC4 property set definitions (#826). That is rvt-rs's own check: buildingSMART's Validation Service has not been run on the exports, and quantity sets are not checked. - **More of what Revit's exporter writes:** parameters named for an IFC4 property set's property (RE-194, #815, #817/#821), each element's `IsExternal` (RE-193, #814), a type's Fire Rating (#830), a door's overall size (#788), Revit 2024 Areas as spaces (#811), port types and electrical flow directions (#832), rooms with no number (#818), pieces' property sets (#819), a room's floor finish in IFC4's set (#820). - **Older and newer releases, experimentally:** Revit 2015 to 2022 (#742) and 2027 (#740) element records. - **Fixes:** Export to IFC As on fixtures, stairs, doors, curtain walls and wall sweeps (#796, #804, #812, #813), the latest copy of an element's or type's data (#803, #809), declared ElementIds (#797), diagnostics naming the file, not its folders (#785), the browser viewer's wasm32 string-length panic (#835), and `rvt-inspect`, `rvt-corpus doctor` and the viewer's File Status taking Revit 2015 and 2027 as releases rvt-rs reads (#838). - **CI and release:** IfcOpenShell 0.9.0.post1 (#795), Rust installed with rustup (#793), a tag publishes nothing until the maintainer approves it (#786, #787), and Measure's office, R2025, paired-probe and per-sample hashing (#790, #799, #805, #806). ## Changes - **Versions 0.5.1 → 0.6.0** in the nine files that carry them: `rvt`, `rvt-py` and its pin, `rvt-wasm`, the `stream_evidence` pin, `CITATION.cff` (with `date-released`), `.release-please-manifest.json`, `viewer/package.json` and both lockfiles' workspace entries. - **CHANGELOG:** `[0.6.0] — 2026-10-19`, with an introduction, **Upgrading from 0.5** (the property sets that moved, the public API changes, the releases that now export elements) and the outside contributors credited: puzzbobb (#740, #742, #798), Erry91 (#788) and MadsHolten (#835). The section's headings were already single; its 41 entries are all kept, with #835's and #838's added. Its introduction says the property sets match buildingSMART's published IFC4 definitions by rvt-rs's own check, as does the README's release summary. - **README:** "Release 0.6.0 and main" names v0.6.0 and summarises what it added. The lines that said `main` reads Revit 2015 to 2022 and 2027 now say experimental (since 0.6.0). The opening and "Not yet" lines name those releases, and so does the capability table. The bullet list of what 0.5.0 added is gone; #832 had put 0.6.0's port types in it. As Codex found, the IFC4 export row, the viewer paragraph and the decoder-work paragraph also said 2022 and earlier export only the scaffold, and the by-input table skipped 2014; they name 2015 to 2022, 2026 and 2027 now. - **Witnesses:** the IFC header carries the version, so both Core Interior `rvt-rs.json` observations and their verdicts are refreshed from this pull request's CI run. ## Testing - CI on this pull request, the witness replays included. - Measure on `main` at 23a9d76, which is everything in this release but #835's wasm32-only fix and #838's CLI and viewer version range, neither of which changes an export: run [39273188597](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39273188597). All 89 exports (the reference models, both BIM4LCA office files, Autodesk's 58 sample projects and the 23 R2025 models) have no finding in Measure's IFC4 property set check (#826, against buildingSMART's published definitions), and IfcOpenShell's schema validation finds nothing on any of the 89; none was too large to validate. - Witnesses: both Core Interior observations and verdicts are taken from this pull request's CI run 39275014518; only `witness_version` and the verdict hashes differ, and CI's replay on b82c0c3 passes. ## Audit-honesty checklist - [x] README / docs reflect the current state after this PR - [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 ## Legal and contribution hygiene - [x] I agree this work is licensable under Apache-2.0 - [x] This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content ## Breaking changes See **Upgrading from 0.5** in the CHANGELOG: standard property sets moved to IFC4's, and five public API changes. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Version and documentation-only release prep with no runtime code changes in this PR. > > **Overview** > **Bumps the workspace from 0.5.1 to 0.6.0** across `Cargo.toml`, `rvt-py` / `rvt-wasm` / `stream_evidence` pins, lockfiles, `viewer/package.json`, `.release-please-manifest.json`, and `CITATION.cff` (release date 2026-10-19). > > **Documents the release:** adds the `[0.6.0]` section to `CHANGELOG.md` (IFC4 property sets, broader Revit export parity, experimental 2015–2022/2027 element export, wasm viewer fix, and **Upgrading from 0.5** breaking notes). **README** now treats v0.6.0 as the current release—updates the support matrix and “Release 0.6.0 and main” to describe shipped capabilities instead of the old 0.5.1 bullet list. > > No application or library source changes in this diff; it packages and narrates work already on `main`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c8826b82982270fd4f47b8da656f2e3e6021c76b. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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
Part 2 of #822. A pipe's or duct's length is now written in IFC4's base quantities (
Qto_PipeSegmentBaseQuantities,Qto_DuctSegmentBaseQuantities, anIfcElementQuantity) and a pipe's invert inPset_PipeSegmentOccurrence, instead of IFC2X3's flow-segment sets, on an element written as a pipe or duct segment. A proxy's Serial Number is no longer also written inPset_PrecastConcreteElementGeneral.Motivation
RE-131, RE-134 and RE-157 followed Revit's exports of the RE1 models, which are IFC2X3. IFC4 has no
Pset_FlowSegmentPipeSegmentorPset_FlowSegmentDuctSegment, itsPset_DuctSegmentTypeCommonhas noLength, and itsPset_PrecastConcreteElementGeneralnoSerialNumber(buildingSMART's IFC2X3 and IFC4 definitions). Revit's IFC4 export of the BIM4LCA office writes a pipe's length inQto_PipeSegmentBaseQuantitiesand its invert inPset_PipeSegmentOccurrence. Measure's IFC4 property set check (#826) finds these four on main: 2,421 values in each flow-segment set and 1,441 duct type-set lengths on 4 exports, and 19 precast serial numbers on RE1 Electrical.Changes
src/ifc/step_writer.rs,entities.rs: aPropertySetnamedQto_is written as anIfcElementQuantitywhose values are IFC4 simple quantities (PropertyValue::quantity:IfcQuantityLengthin metres, and areas, volumes, counts, weights and times likewise); a quantity set with no quantity is not written.src/ifc/export_content.rs: a pipe getsQto_PipeSegmentBaseQuantities.LengthandPset_PipeSegmentOccurrence.InvertElevation, a ductQto_DuctSegmentBaseQuantities.Length, and itsPset_DuctSegmentTypeCommonkeepsShape. They are chosen by the entity the element is written as, after its Export to IFC As, so a pipe or duct written as another entity gets none.pipe_inverts_above_storeystakes the storey's elevation off only the inverts rvt-rs works out in model height (TypedProductionAppend::computed_inverts), so a pipe's parameter namedPset_PipeSegmentOccurrence.InvertElevation(RE-194) is written as it is. A Serial Number is inPset_ManufacturerOccurrenceonly.tests/segment_length.rs,invert_elevation.rs,duct_fields.rs,duct_segment_type_common.rs,serial_number.rs) read RE1's values from Revit's IFC2X3 sets only and rvt-rs's from the IFC4 quantities and sets only, and check that rvt-rs writes none in the IFC2X3 sets.tools/re/psets_vs_ifc.pycompares an IFC2X3 reference's invert withPset_PipeSegmentOccurrenceand counts two kinds of value apart: its lengths, which IFC4 holds in quantities the scorer does not read, and its precast Serial Numbers, which IFC4 keeps inPset_ManufacturerOccurrence, where they are scored.Testing
Measure A/B against
main(cdac7e6), run 39259646397, at c220943, both sides scored with this PR'spsets_vs_ifcbefore e88b9c7 (which changes scoring only):InvertElevationis Revit's inPset_PipeSegmentOccurrence: 6 of 6 on Mechanical, 63 of 63 on Plumbing. Their 93 and 126 IFC2X3 lengths are counted apart;tests/segment_length.rs,duct_fields.rsandduct_segment_type_common.rscheck them in the quantity sets against Revit's within 0.1 mm, and pass on corpus tier 2.Pset_ManufacturerOccurrence, equal on both sides (31 of 31). e88b9c7 counts them apart; a smoke run of the scorer on Revit's own file sets those 19 aside and scores the 31.Pset_DuctSegmentTypeCommon.Length(1,441) and the precastSerialNumber(19) are gone. What is left is the fittings'Pset_PipeFittingTypeCommon.NominalDiameteron 11 exports (5,469 values), which a follow-up takes out.IfcElementQuantitysets included.cargo fmtis clean. No unit tests, by the repository's rule.Audit-honesty checklist
Legal and contribution hygiene
Based on buildingSMART's IFC2X3 and IFC4 property set definitions (CLEANROOM.md source 4) and Revit's own IFC exports of the RE1 models and the BIM4LCA office.
Breaking changes
A consumer reading a pipe's or duct's
Lengthor a pipe'sInvertElevationfrom the flow-segment sets finds them in the base quantities andPset_PipeSegmentOccurrence; a proxy's Serial Number is inPset_ManufacturerOccurrenceonly.pipe_inverts_above_storeysis crate-internal;TypedProductionAppendgains the public fieldcomputed_inverts.Note
Medium Risk
Changes where MEP length, invert, and serial data appear in exported IFC4 (breaking for consumers of the old property sets), though behavior is covered by corpus tests and explicit IFC4 alignment.
Overview
Aligns IFC4 export with buildingSMART and Revit IFC4: pipe and duct segment lengths move out of IFC2X3-only flow-segment and duct type
Lengthproperties intoQto_PipeSegmentBaseQuantities/Qto_DuctSegmentBaseQuantitiesasIfcElementQuantityentries. Pipe invert moves fromPset_FlowSegmentPipeSegmenttoPset_PipeSegmentOccurrence, with storey-relative adjustment updated to follow that set.The STEP writer now treats any
PropertySetwhose name starts withQto_as an element quantity, mapping supportedPropertyValuetypes via newPropertyValue::quantity()to IFC4 simple quantities (SI units in STEP). Empty quantity sets are skipped.Serial numbers are emitted only in
Pset_ManufacturerOccurrence; the duplicatePset_PrecastConcreteElementGeneral.SerialNumberon proxies is dropped for IFC4. DuctPset_DuctSegmentTypeCommonkeepsShapeonly (no length there).Corpus tests and
tools/re/psets_vs_ifc.pywere updated to compare Revit IFC2X3 reference values against these IFC4 locations (including parsingIfcElementQuantity). CHANGELOG and RE-157 notes document the schema split.Reviewed by Cursor Bugbot for commit f09359cdc6b13526b45f8cec874af0ee6f8eb2a6. Configure here.