Skip to content

feat(ifc): every duct and pipe has a port at each end, joined or not (B54) - #673

Merged
DrunkOnJava merged 2 commits into
mainfrom
feat/b54-end-ports
Oct 4, 2026
Merged

DrunkOnJava merged 2 commits into
mainfrom
feat/b54-end-ports

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

#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.


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.

Reviewed by Cursor Bugbot for commit c866493. Configure here.

…s (B54)

Revit's export of RE1 Mechanical and Plumbing writes connectors 0 and 1 of
92 of the 94 ducts and pipes as IfcDistributionPorts tied to them, joined
or not. tests/duct_and_pipe_ports.rs requires rvt-rs to write each of
those ports, Port_<ElementId>_<index>, tied to the element with that Tag.

Red on main (draft #672, run 37226726028, "Corpus health (tier 2)"):

  RE1-Mechanical.rvt: 54 of Revit's 62 duct and pipe end ports written
  RE1-Plumbing.rvt: 110 of Revit's 122 duct and pipe end ports written
  panicked at tests/duct_and_pipe_ports.rs:167:5:
  RE1-Mechanical.rvt: 8 of Revit's 62 duct and pipe end ports are not written, tied to their element; first: [(428274, 0), (438792, 0), (441731, 0), (441731, 1), (441849, 0), (441849, 1), (441892, 0), (442189, 1)]
  RE1-Plumbing.rvt: 12 of Revit's 122 duct and pipe end ports are not written, tied to their element; first: [(444657, 1), (444704, 1), (444719, 0), (445063, 1), (445078, 0), (445099, 1), (445109, 0), (445158, 1)]
…(B54)

rvt-rs wrote a port only for a connector in a join it reads (RE-138), so a
duct's or pipe's open end, or an end joined to something whose list is not
read, had none. Revit's export writes connectors 0 and 1 of 92 of RE1's 94
ducts and pipes (Measure run 37226275460; the other two have only port 1,
one of them joined to the tank Revit leaves out, B38). Each duct and pipe
exported as a distribution element now carries an IfcEntity::Port for both
ends, which the writer gives an IfcDistributionPort and an
IfcRelConnectsPortToElement where no join has.
@DrunkOnJava
DrunkOnJava merged commit c180a30 into main Oct 4, 2026
25 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/b54-end-ports branch October 4, 2026 19:33
DrunkOnJava added a commit that referenced this pull request Oct 4, 2026
…679)

BACKLOG.md: statuses for B45, B46, B54, B55, B56, B60, B64, B68, B70 and
B71; new rows B72 to B77; the afternoon's progress log (red and green
runs, Measure evidence, the B38 and B47 findings, rule notes).

CHANGELOG.md [Unreleased] stopped at #592 (B76). It now has an entry for
each user-visible change since, through #677, grouped as the file groups
them (Added, Changed, Fixed, Research).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Markdown-only updates to BACKLOG and CHANGELOG; no application, test,
or CI logic changes in this diff.
> 
> **Overview**
> **Documentation-only (B76):** brings maintainer backlog and public
release notes in line with session 3 work already merged in other PRs—no
runtime or exporter code changes.
> 
> **`BACKLOG.md`** updates the ranked table (e.g. B45–B46, B55–B56, B60,
B64, B68–B71 marked **done**; B47 **blocked** on MEP-sample evidence;
B54 **in progress** on #673). It adds backlog rows **B72–B77** (type
GlobalIds, `typed-no-geometry` gap, 2024 ordinals, changelog debt,
`--saved-meshes` gating). A new **Session 3, afternoon** progress log
records PRs, CI runs, Measure evidence, and rule notes; **Findings** are
revised (B38 phase refutation, B55 opening, B74/B77).
> 
> **`CHANGELOG.md` `[Unreleased]`** is extended from #592 through
**#676**: **Added** (wall-profile opening, native 2025/2026 + phases,
railing types, duct/pipe end ports, type GlobalIds, curtain
doors/materials, space containment, MEP systems, parameters/CLIs, etc.),
**Changed** (single export walk B71, MEP export perf B70, witness slim
step B27), **Fixed** (`--saved-meshes` scope B77, `rvt-write` B69,
diagnostics B49), and **Research** entries for RE-155–RE-168 and corpus
pins.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
5f1e5fe. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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