Skip to content

feat(ifc): a pipe's InvertElevation, from its inner diameter (B26, #35) - #613

Merged
DrunkOnJava merged 3 commits into
mainfrom
feat/b26-invert
Oct 3, 2026
Merged

DrunkOnJava merged 3 commits into
mainfrom
feat/b26-invert

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

RE-157 (#611) found each pipe's inner and outer diameters in its own RbsPipeCurve data object, 549 bytes after the header. Revit's InvertElevation is a horizontal pipe's axis less half its inner diameter, or a vertical pipe's lower end, above the pipe's storey (69 pipes on RE1).

  • partition_room_parameters: verified_data_object; enclosing_data_object uses it.
  • partition_curve_fields: scan_pipe_diameters (pipe id and RbsPipeCurve tag in the header, 0 < inner < outer).
  • partition_schema_mvp: m_pipe_inner_diameter.
  • export_content: InvertElevation (IfcLengthMeasure) in Pset_FlowSegmentPipeSegment, in model height; a sloped pipe gets none.
  • ifc/mod.rs: pipe_inverts_above_storeys takes the storey elevation off once storeys are bound.

Test: tests/invert_elevation.rs (real target). Red on main: draft #612, run 37143783049, 6 of 6 Mechanical pipes missing; the output is in the test commit's message. Core Interior has no pipes, so no pinned count moves.


Note

Medium Risk
Changes IFC property emission and partition binary parsing for pipes; incorrect invert math or storey adjustment would affect downstream MEP workflows, but scope is limited to pipe property sets and new validation tests.

Overview
Adds RE-157 support so IFC exports include InvertElevation on Pset_FlowSegmentPipeSegment for pipes, aligned with Revit’s IFC4 behavior.

Partition scanning now reads each pipe’s inner/outer diameter from verified RbsPipeCurve data objects (scan_pipe_diameters) and attaches m_pipe_inner_diameter on pipe elements. Invert is computed in model height (vertical pipe: lower end; horizontal: axis minus half inner diameter; sloped or missing diameter: omitted), emitted alongside segment Length, then pipe_inverts_above_storeys subtracts the bound storey elevation so the value is height above the storey.

verified_data_object is factored out of room-parameter parsing for reuse by the diameter scanner. A corpus integration test invert_elevation compares RE1 Mechanical/Plumbing exports to reference IFC within 0.1 mm.

Reviewed by Cursor Bugbot for commit 3c22e81. Configure here.

tests/invert_elevation.rs: on RE1 Mechanical and Plumbing, every pipe
rvt-rs writes with Revit's Tag must carry Revit's
Pset_FlowSegmentPipeSegment.InvertElevation within 0.1 mm.

Red on main (draft #612, run 37143783049, Corpus health tier 2):

---- re1_pipe_invert_elevations_are_revits stdout ----
thread 're1_pipe_invert_elevations_are_revits' panicked at tests/invert_elevation.rs:194:9:
RE1 Mechanical: 6 of the InvertElevations of the 6 pipes both exports hold
are not Revit's (tag, set, Revit's m, rvt-rs's m); first:
[("441731", "Pset_FlowSegmentPipeSegment", 3.023134999999999, None),
 ("441849", "Pset_FlowSegmentPipeSegment", 3.0296649999999987, None),
 ("441892", "Pset_FlowSegmentPipeSegment", 3.027635199999999, None),
 ("442026", "Pset_FlowSegmentPipeSegment", 2.889535199999994, ...
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.63s
RE-157 found each pipe's inner and outer diameters in its own RbsPipeCurve
data object, 549 bytes after the header. Revit's InvertElevation is a
horizontal pipe's axis less half its inner diameter, or a vertical pipe's
lower end, above the pipe's storey.

- partition_room_parameters: verified_data_object (a DataObject at a known
  header offset); enclosing_data_object uses it.
- partition_curve_fields: scan_pipe_diameters, by the pipe's id and
  RbsPipeCurve's tag in the object header, 0 < inner < outer.
- partition_schema_mvp: m_pipe_inner_diameter on each pipe read.
- export_content: InvertElevation (IfcLengthMeasure) in
  Pset_FlowSegmentPipeSegment, in model height; a sloped pipe gets none.
- ifc/mod.rs: pipe_inverts_above_storeys takes the storey's elevation off
  once storeys are bound. A pipe on no storey keeps its height above zero.
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 3, 2026 18:31
@DrunkOnJava
DrunkOnJava merged commit d54097d into main Oct 3, 2026
23 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/b26-invert branch October 3, 2026 18:34
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