Repository navigation
feat(ifc): every duct and pipe has a port at each end, as Revit's export writes them (B54) - #672
Closed
DrunkOnJava wants to merge 1 commit into
Closed
DrunkOnJava wants to merge 1 commit into
DrunkOnJava wants to merge 1 commit into
Conversation
…s (B54) Red output follows once CI has run.
Owner
Author
|
Red draft for B54; its run (37226726028) is recorded in the test commit of the rebuilt PR. |
DrunkOnJava
added a commit
that referenced
this pull request
Oct 4, 2026
…(B54) (#673) #528. rvt-rs wrote a port only for a connector in a join it reads (RE-138). Revit's export writes connectors 0 and 1 of 92 of RE1's 94 ducts and pipes, joined or not (Measure run 37226275460; the other two carry only port 1, one of them joined to the tank Revit leaves out, B38). Each duct and pipe exported as a distribution element now has both end ports. Red on draft #672 (run 37226726028): Mechanical 54 of 62, Plumbing 110 of 122; the output is in the test commit. Expected after: all 62 and 122, plus one port Revit does not write (port 0 of the pipe joined to the tank). Left on B54: Electrical's 53 ports (connectors of lights, devices and panels, 30 of them on elements written as proxies, which IFC4 does not let a port be tied to), the open ports of fittings and terminals, and the 13 connections whose lists are not read. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes MEP port emission in IFC export (connectivity metadata), but logic is scoped to ducts/pipes and skips ports already created from joins. > > **Overview** > **Previously**, IFC export only created `IfcDistributionPort` entities for duct/pipe connectors that appeared in a read join (RE-138). **This change** matches Revit’s behavior by also emitting ports at connector indices **0 and 1** on every exported duct and pipe, whether or not anything is connected there. > > The export pipeline records each `Duct` / `Pipe` during the production walk, filters to distribution elements, and appends two new `IfcEntity::Port` records per segment. The STEP writer still builds ports from `PortConnection` first; a second pass emits `IFCDISTRIBUTIONPORT` plus `IFCRELCONNECTSPORTTOELEMENT` only for `(ElementId, index)` pairs not already created by a join, avoiding duplicates on connected ends. > > A corpus integration test (`duct_and_pipe_ports`) compares exported STEP against Revit reference IFC for RE1 Mechanical and Plumbing, and CI registers the new `real` target. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c866493. 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.
Red run first; implementation follows. #528: Revit writes connectors 0 and 1 of 92 of RE1's 94 ducts and pipes as ports whether or not anything is connected; rvt-rs writes a port only for a join it reads.
Note
Low Risk
Only adds a corpus comparison test and CI wiring; no production exporter logic in this diff (may fail until port export is implemented).
Overview
Adds a real-file integration test (
duct_and_pipe_ports) that encodes B54 / #528: for RE1 Mechanical and Plumbing, every duct and pipe that Revit exports with two end connectors (indices 0 and 1) must appear in rvt-rs IFC as anIfcDistributionPortnamedPort_<ElementId>_<index>and linked to that segment’sTagviaIfcRelConnectsPortToElement.The test parses reference Revit IFC and the exporter output, builds the set of required
(element id, connector index)pairs from segments with both ends in Revit’s export, and fails if any are missing or not tied to the right element. It runs whenRVT_PROJECT_CORPUS_DIRis set and skips missing models.CI registers
duct_and_pipe_portsunderrealintools/ci/test-targets.txtso the gate runs it with the other corpus checks.Reviewed by Cursor Bugbot for commit 6f8184b. Configure here.