Skip to content

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
mainfrom
feat/b54-curve-end-ports
Closed

DrunkOnJava wants to merge 1 commit into
mainfrom
feat/b54-curve-end-ports

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

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 an IfcDistributionPort named Port_<ElementId>_<index> and linked to that segment’s Tag via IfcRelConnectsPortToElement.

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 when RVT_PROJECT_CORPUS_DIR is set and skips missing models.

CI registers duct_and_pipe_ports under real in tools/ci/test-targets.txt so the gate runs it with the other corpus checks.

Reviewed by Cursor Bugbot for commit 6f8184b. Configure here.

@DrunkOnJava

Copy link
Copy Markdown
Owner Author

Red draft for B54; its run (37226726028) is recorded in the test commit of the rebuilt PR.

@DrunkOnJava DrunkOnJava closed this Oct 4, 2026
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 -->
@DrunkOnJava
DrunkOnJava deleted the feat/b54-curve-end-ports branch October 18, 2026 09:36
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