Repository navigation
feat(ifc): a pipe's ports are placed at the end their connector entry keys name, along the pipe (#847) - #865
Merged
Merged
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8db14a6930
ℹ️ 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".
… keys name (#847) partition_pipe_axes::scan_pipe_end_keys reads, in one pass over each pipe partition, the keys (element, connector index) of the connector entries at each end of each pipe, and attach_pipe_axes stores them as m_pipe_start_keys / m_pipe_end_keys. A pipe's port index is at the one end whose keys name it: the pipe itself with that index, or the element and connector the pipe's index is joined to in its or the other element's join list (RE-138). IfcEntity::Port gains location_feet, and the STEP writer gives such a port an IfcLocalPlacement in its pipe's frame; a port no end names keeps none. On the RE1 models every pipe end with a port in Revit's export is named by its keys (Measure run 39370306743: 57 of 57 self keys, 168 of 168 joined keys).
…ports rvt-rs places at the same point (#847)
…o it for a SINK port, as Revit's export writes them (#847) Revit's ports on the RE1 pipes point their Z axis into the pipe for an In port (66 of 66), out of it for an Out port (65 of 65) and out of it for a port with no flow direction (19 of 19), Measure run 39370944258. rvt-rs reads no flow direction for a pipe's ports yet (#834), so they point out of the pipe. The scorer now compares each placed port's Z axis with Revit's.
…n, so a Z axis along -X has an X axis (#847) IFC's default reference direction is +X, which leaves no X axis for a port pointing along -X; IfcOpenShell's placement divided by zero on RE1's ports (Measure run 39371440417). A port now takes up as its reference direction, or +X where it points up or down.
DrunkOnJava
force-pushed
the
fix/847-pipe-port-places
branch
from
October 20, 2026 04:53
7e9c54b to
4a6e5af
Compare
DrunkOnJava
enabled auto-merge (squash)
October 20, 2026 04:55
This was referenced Oct 20, 2026
DrunkOnJava
added a commit
that referenced
this pull request
Oct 20, 2026
…, which its connector entry keys name (#847) (#868) ## Summary Follows #865 for ducts (#847). A duct along one of the model's axes has a record box that is its section by its length (RE-134: 25 of 25 RE1 ducts). Its two ends are the centres of the box's faces across its length. - `attach_duct_end_keys` gives each such duct those ends (`m_duct_start_*`, `m_duct_end_*`). It then reads the keys of the connector entries there through `scan_pipe_end_keys` (`m_duct_start_keys`, `m_duct_end_keys`). A duct whose box leaves no single length axis gets neither. - Its ports are placed as #865 places a pipe's: at the one end whose keys name the connector, with the Z axis out of the duct. - `pipe_end_keys_from_fields` and the new `duct_end_keys_from_fields` share one reader. The pipe pass and the duct pass write their keys through one helper. ## Measured Measure A/B against main, run [39374659068](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39374659068), on the code of this branch before its rebase onto #865's merge: - **RE1 Mechanical:** all 62 of the ports Revit writes on flow segments are placed within 0.01 ft of Revit's: the 12 on pipes, as with #865, and the 50 on ducts, which #865 left unplaced. Their Z axis is Revit's on the 26 `Out` ports and the 9 with no flow direction. It is opposite on the 27 `In` ports (#834). - **RE1 Plumbing:** unchanged from #865, 124 of 124. - **Validation:** the IfcOpenShell validator and the IFC4 property set check give 0 findings. - **Other models:** only the two RE1 MEP exports change.
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
Closes #847 for pipes. rvt-rs wrote every
IfcDistributionPortwith no placement. Revit's export places each port at its connector, relative to its element's placement, with its Z axis along the pipe.partition_pipe_axes::scan_pipe_end_keysreads, in one pass over each pipe partition, the keys of the connector entries at each end of each pipe: the element at that end and its connector index (RE-131's layout).attach_pipe_axesstores them asm_pipe_start_keys/m_pipe_end_keys.iat the one end whose keys name connectori. A key names it when it is the pipe itself with indexi, or the element and connector that pipe connectoriis joined to in either element's join list (RE-138). A port that no end names, or that both ends name, keeps no placement.IfcEntity::Portgainslocation_feetanddirection. The STEP writer gives such a port anIfcLocalPlacementin its pipe's frame, with its Z axis pointing out of the pipe, or into it for aSINKport.Measured (research branch
re/847-port-places)Which end is which connector (Measure run 39370306743,
probe_847_pipe_end_keyswithpipe_end_keys_vs_ifc). Every pipe end that has a port in Revit's export is named by its keys: 124 of 126 on RE1 Plumbing and 12 of 12 on RE1 Mechanical. The other 2 have no single Revit port. Every key that names the pipe itself holds the connector Revit places there (57 of 57). Every key that names another element holds the connector Revit's export joins the pipe's port to (168 of 168).The order rvt-rs reads ends in is not the connector order (run 39369702158). On 7 of RE1 Plumbing's 63 pipes the first end is connector 1, so the keys are needed.
The axis (run 39370944258). Revit's port Z axis points into the pipe for an
Inport (66 of 66), out of it for anOutport (65 of 65), and out of it for a port with no flow direction (19 of 19). rvt-rs reads no flow direction for a pipe's ports yet (A port's SystemType (its connector's system classification) and an electrical port's Flow=Source/Sink description are not written (RE-212 follow-up) #834), so they point out of the pipe. Revit'sInports will therefore show the opposite axis until A port's SystemType (its connector's system classification) and an electrical port's Flow=Source/Sink description are not written (RE-212 follow-up) #834.The no-geometry modes write no port placement:
strip_building_element_geometryclears a port's point and axis too (Codex).A port's axis placement names its reference direction: up, or +X for a port pointing up or down. IFC's default, +X, leaves no X axis for a Z axis along -X.
Verification
Outports and the 10 with no flow direction, and opposite on the 57Inports (A port's SystemType (its connector's system classification) and an electrical port's Flow=Source/Sink description are not written (RE-212 follow-up) #834).ports_vs_ifcis unchanged.