Skip to content

feat(ifc): RE-138 ports and port-to-port connections for ducts and pipes (#528) - #550

Merged
DrunkOnJava merged 9 commits into
mainfrom
re/re138-connector-pairs
Oct 1, 2026
Merged

DrunkOnJava merged 9 commits into
mainfrom
re/re138-connector-pairs

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Reads which element each end of a duct or pipe is joined to, from the lists in the curve's own object after its RbsCurveConnectorManager anchor (RE-134), and writes them as ports and port-to-port connections (#528).

  • The lists. A join is written in two blocks, the earlier with the curve's own connector index inverted. A list in the later block is read as stored; one in the earlier block is read inverted when no later list gives the same join. 94.3 per cent (50 of 53) of Revit's connections that involve a duct or pipe on RE1 Mechanical and 94.4 per cent (102 of 108) on Plumbing are read.
  • The export. IfcDistributionPort for each connector, IfcRelConnectsPortToElement for each port and IfcRelConnectsPorts for each join whose two elements are exported as distribution elements: 53 of 59 (89.8 per cent) of Revit's connections that involve a duct or pipe on Mechanical and 112 of 118 (94.9 per cent) on Plumbing. Every port is tied to the element its name gives, and IfcOpenShell's IFC4 schema validation of both files finds nothing; before the distribution-element rule it found three errors, ports on equipment written as an IfcBuildingElementProxy. Core Interior's export is byte-identical and no other scorer changes.
  • What it does not do. The ports have no flow direction (Revit's follows the system's flow, which the lists do not carry), so they are named Port_<ElementId>_<index>. Fitting-to-fitting and equipment connections are not read.

Measure runs 36872401031 (against main) and 36874925630; scorers tools/re/connector_pairs_vs_ifc.py and tools/re/ports_vs_ifc.py. A support-matrix entry, the changelog and reports/element-framing/RE-138-connector-pairs.md are included.

Refs #528, #96.


Note

Medium Risk
Changes IFC export with new MEP connectivity entities and partition binary parsing; behavior is gated to distribution elements and Revit 2025–measured layouts, but incorrect joins could misrepresent MEP topology in exported IFC.

Overview
Adds RE-138: decode duct and pipe connector joins from partition data after the RbsCurveConnectorManager anchor, surface them on decoded elements, and emit IFC4 distribution topology (IfcDistributionPort, IfcRelConnectsPortToElement, IfcRelConnectsPorts).

Parsing walks two duplicate list blocks and normalizes inverted curve connector indices in the earlier block. Joins are exported only when both connected elements are written as distribution types (skipping equipment exported as IfcBuildingElementProxy to stay IFC4-valid). Ports are named Port_<ElementId>_<index> with no flow direction (.NOTDEFINED.).

Adds partition_connector_pairs, schema attachment, probe/scorers (connector_pairs_vs_ifc.py, ports_vs_ifc.py), CI measure hook, support-matrix entry, and framing report. Coverage is partial vs Revit’s export on RE1 Mechanical/Plumbing (~90–95% of duct/pipe-involved connections); fitting-only joins are not read.

Reviewed by Cursor Bugbot for commit e5d12ec. Configure here.

…ed to (RE-138) (#528)

A duct's or pipe's object lists its connectors' joins after its RbsCurveConnectorManager anchor, each written twice with the curve's own index inverted in the earlier copy. partition_connector_pairs reads them as pairs of (ElementId, connector index); the probe prints them and tools/re/connector_pairs_vs_ifc.py scores them against the IfcRelConnectsPorts of Revit's own export. Nothing is exported yet.
@cursor

cursor Bot commented Oct 1, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_34678f11-ea4a-4019-9f9b-61f9239a9a94)

…-138) (#528)

A list is read as stored in the later block after a curve's anchor and inverted in the earlier block, which brings the connector pairs to 94 per cent of Revit's connections that involve a duct or pipe on RE1 Mechanical and Plumbing in a first measurement. The pairs are attached to each duct and pipe as fields, resolved to entities once both elements are exported, and written as IfcDistributionPort, IfcRelConnectsPortToElement and IfcRelConnectsPorts with no flow direction. tools/re/ports_vs_ifc.py scores the export against Revit's.
…e port scorer validates the schema (#528)

RE1 Mechanical: 56 of the 59 connections of Revit's export that involve a duct or pipe are written; Plumbing: 112 of 118. The ports have no flow direction. The scorer now also runs IfcOpenShell's schema validation on the port entities.
@DrunkOnJava DrunkOnJava changed the title feat(elements): RE-138 which element each end of a duct or pipe is joined to (#528) feat(ifc): RE-138 ports and port-to-port connections for ducts and pipes (#528) Oct 1, 2026
IFC4's IfcRelConnectsPortToElement relates a port to an IfcDistributionElement, and RE1 Mechanical's equipment is written as an IfcBuildingElementProxy: IfcOpenShell's validation found three relationships to it. A join is now written only when both elements are distribution elements.
…ion elements (#528)

RE1 Mechanical 53 of 59 (89.8 per cent), Plumbing 112 of 118 (94.9 per cent); IfcOpenShell's IFC4 schema validation of both exports finds nothing. Measure run 36874925630.
@DrunkOnJava
DrunkOnJava marked this pull request as ready for review October 1, 2026 14:19
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 1, 2026 14:20
@cursor

cursor Bot commented Oct 1, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_df706702-87e2-485d-8850-55cdb7a357fe)

@DrunkOnJava
DrunkOnJava merged commit 39a1bcc into main Oct 1, 2026
26 checks passed
@DrunkOnJava
DrunkOnJava deleted the re/re138-connector-pairs branch October 1, 2026 15:05
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