Skip to content

network: the pipe network, worked out from pipes' ends and pipe connectors (on top of #269) - #288

Merged
IPedrax merged 4 commits into
IPedrax:mainfrom
ffishman:pipe-network
Nov 9, 2026
Merged

IPedrax merged 4 commits into
IPedrax:mainfrom
ffishman:pipe-network

Conversation

@ffishman

@ffishman ffishman commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Rodrigo · project thread

Stacked on #269. The branch carries #269's three commits underneath, so the diff against main holds both until #269 merges. The new commits are the last three:

  • d504013 network: the pipe network, worked out from pipes' ends and pipe connectors
  • 0953a15 network: a stack standing upright joins the drain at its foot
  • 36ea0b9 translation catalogs

This is the second piece you gave me on #222, built on #269's connectors with a place.

What

network {system?, level?, tolerance?} is a query, never stored. It works the pipe network out of the model each time it is asked:

  • Nodes. Pipes' centre-line ends and the families' pipe connectors that lie within tolerance of each other (1 mm by default, 50 at most) are one node. An end or a connector that lies on another pipe's length is a node too: that pipe is split into two edges there, and the element stays whole.
  • Through and not through. A fitting's or a valve's connectors are joined through the component. A fixture's are not, since its waste and its water are networks of their own.
  • What it replies: the nodes, the edges, the groups of joined elements with their systems and domains, and the open ends.
  • Warnings, never a refusal of the model: two pipe systems in one network, two connector domains in one network, a pipe met along its length with no fitting there, and a drain that narrows downstream.
  • Filters. system keeps the networks that system's pipes are in, and level (a name, an id or a GUID) keeps one level's.

Why

#222's step 3. Fittings placed where runs meet, and sizing over a system, need to know what joins what. Until now nothing in the model said where a pipe ends. Because it is a query, it can't go stale: there is no stored graph to keep in step with the pipes, and the file format doesn't change.

Tests

crates/core/src/network_tests.rs: pipes end to end as one network with two open ends; a fixture's connector as a node, and one with no pipe left open; a fitting joining the pipes at its ends through it; a fixture's waste and water not joined through it; two systems, and a waste and a cold water connector, in one network warned of and not refused; a pipe met along its length split there and warned of; a drain narrowing downstream; the tolerance and the level filter; a stack standing upright joining the drain at its foot; what it can't use refused, changing nothing.

cargo fmt --check and cargo clippy --workspace --all-targets -- -D warnings pass, as do the core's 1538 tests and the desktop's 833, on Linux, on main at 323afba.

🤖 Generated with Claude Code

…ctors

A query, never stored: pipes' centre-line ends and the components' pipe connectors within
a tolerance (1 mm by default) are one node; a node on another pipe's length splits that pipe
into two edges, the element staying whole; a fitting's or a valve's connectors are joined
through it, a fixture's are not. It replies the nodes, the edges, the groups of joined
elements with their systems and domains, the open ends, and warnings that never refuse the
model: two pipe systems in one network, two connector domains in one, a pipe met along its
length with no fitting, and a drain narrowing downstream.

Piece 3 of IPedrax#169, on top of the connectors with a place (IPedrax#269).
IPedrax added a commit that referenced this pull request Nov 9, 2026
network: the pipe network, worked out from pipes' ends and pipe connectors (on top of #269)
@IPedrax
IPedrax merged commit d1040c0 into IPedrax:main Nov 9, 2026
5 checks passed
emilianocapasso added a commit to acpvarchitects/BIMCraft that referenced this pull request Nov 9, 2026
…ents, pipe networks, title blocks, joins

Upstream's 92 commits: IPedrax#280 (the room of each component), IPedrax#288 (pipe networks), IPedrax#287, IPedrax#304 (editable title blocks), IPedrax#293,
IPedrax#305, IPedrax#294, IPedrax#273, a dry_run for script commands, and alignment guides on F8 only.

Rooms: one rule. IPedrax#280's `Rooms::room_at` and this branch's were the same rule (the walls' centre lines, 3d9ce13); ours stays,
with its `Rc` cache (`regions`), and IPedrax#280's duplicate (`room_at`, `centre_of`, `centre`) goes. Every caller now asks
`Rooms::component` (the family's room calculation point, else the insertion point, in the room's plan at the centre lines
and between its bottom and top): `element_json_with` (so `elements`, `inspect`'s palette JSON and schedules' Room Number and
Room Name), `load_points`' count of outlets and luminaires, and IFC's IfcRelReferencedInSpatialStructure. `elements` no
longer overrides `room` itself: a component outside every room leaves `room` out, as IPedrax#280 has it, rather than null.
IPedrax#280's test of an outlet on the bottom wall's north face turns it to face north (angle 180): the Outlet's room calculation
point stands 150 mm in front of it, toward -y, and at angle 0 it fell inside the wall, south of its centre line, as
docs/areas/families.md says it should.

Conflicts:
- model.rs: FORMAT stays 19. Upstream is at 18, title blocks included (IPedrax#304's merge: "Title blocks stay in the file format
  18"), so our Family Editor step stays 18 to 19; the 18 paragraph and the 17-to-18 comment are upstream's (title blocks,
  `join: false`, `across`), and our step's note says it leaves all of 18 alone.
- views-and-graphics.md: both sections (Doors > Opening; sheet sizes). The title-block paragraph's "FORMAT 19" is 18.
- commands.rs: upstream's arms_at, same_way and host_line, and ours' face_hosted and side_mirrored; relocate's doc comment
  back on relocate (it had drifted onto face_hosted), with upstream's "one wall or one run".
- render.rs: `part` pub(crate) beside our `sub`; a section's wall cut finds its solids either side of a butt interface
  (upstream) and keeps our door and window voids' shape.
- view3d.rs: upstream's tube end cuts, with our `vis: 0`.
- schedule.rs: components get Room Number and Room Name beside our Elevation from Level, Work Plane, Offset from Host, Host.
- tests.rs (core): both sides' hostile values, ours' nested families and upstream's strip-footing grips.
- properties.rs: element_json_with, and our Group import. ui-egui tests.rs: both tests.
- CLAUDE.md: ours, with upstream's titleblock.rs (2841 words).
- Docs: schedules.md, structure-and-mep.md and families.md name `Rooms::component` as the one rule.
- Catalogs (ui and project): ours, `cargo i18n update`, then each msgstr from either parent filled in by a 3-way merge on
  (msgctxt, msgid) with the base; nothing translated was lost where its msgid still exists.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NVBR7rAfyvMsaXhi1B3YLr
@dronov-dmitry dronov-dmitry moved this to Done in BIMCraft Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants