Repository navigation
feat(ifc): a pipe's InvertElevation, from its inner diameter (B26, #35) - #613
Merged
Merged
Conversation
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.
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.
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).
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
InvertElevationonPset_FlowSegmentPipeSegmentfor pipes, aligned with Revit’s IFC4 behavior.Partition scanning now reads each pipe’s inner/outer diameter from verified
RbsPipeCurvedata objects (scan_pipe_diameters) and attachesm_pipe_inner_diameteron 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, thenpipe_inverts_above_storeyssubtracts the bound storey elevation so the value is height above the storey.verified_data_objectis factored out of room-parameter parsing for reuse by the diameter scanner. A corpus integration testinvert_elevationcompares RE1 Mechanical/Plumbing exports to reference IFC within 0.1 mm.Reviewed by Cursor Bugbot for commit 3c22e81. Configure here.