Skip to content

Rooms: the room a component stands in, in schedules and inspect, and load_points counting what is drawn - #280

Merged
IPedrax merged 3 commits into
IPedrax:mainfrom
ffishman:claude/project-thread-r0kizs
Nov 9, 2026
Merged

IPedrax merged 3 commits into
IPedrax:mainfrom
ffishman:claude/project-thread-r0kizs

Conversation

@ffishman

@ffishman ffishman commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Requested by Rodrigo · project thread

What

A component now knows the room it stands in, as Revit's Room parameter of a family instance does, and load_points uses it to count what the model draws.

  • The room of a component (Rooms::room_at, Model::room_of): the room on the component's level whose boundary at the walls' centre lines holds its point. It uses the centre lines whatever room_area says, so an outlet or a switch on a wall's face lands in the room on that side, not in the wall.
  • Derived, never stored. It is worked out where it is read, so it can't go stale when a wall moves or a room is deleted, and the file format doesn't change.
  • element_json gives a component room (the room's GUID), room_number and room_name; a component outside every room has none.
  • Schedules of components gain Room Number and Room Name (as Revit's Room: Number and Room: Name), not shown unless chosen. Translated in pt and es; cargo i18n update run.
  • load_points, when it reads the model, counts the power outlets and the luminaires standing in each room (last phase, primary design options). A room drawn with fewer outlets than it needs, or with no luminaire, is not ok. Where the model has no outlet, or no luminaire, at all, it takes the least as before, so existing models and the existing tests are unchanged; a new counted field says which it counted.

Why

This is a first step of #222's "sizing that reads the model". Until now load_points from the model only worked out the least each room needs and assumed it was there. Knowing the room of an element is also what a residual-current check by room, or any other per-room rule, will need, whatever the standard. Nothing here is specific to one country: the room is plain geometry, and the counting feeds the command that already exists.

It adds no field to rooms, in line with "no occupancy parameter on rooms for now" on #260. @renanem, this touches load_points's model path only; the rooms input and its numbers are unchanged.

Not covered

  • Every power outlet counts, specific-use ones too, since a family doesn't say yet whether an outlet is general or specific use. The command's doc says so.
  • Only components. Doors (Revit's From Room / To Room) are left for later.
  • A component whose point sits exactly on a boundary between two rooms goes to the first by id. If that turns out to matter, the fix would be what Revit does: a room calculation point on the family.

Tests

crates/core/src/room_of_tests.rs: a component in each of two rooms and one outside; outlets on a wall's face land in the room on their side, at either room measure; a component on another level is in neither; the schedule's two columns; load_points counting what is drawn, taking the least where nothing is drawn, and leaving out a demolished outlet.

cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings and cargo test --workspace pass on Linux. One GPU test in ui-egui (a_view_being_made_keeps_the_last_picture_quietly...) failed once and passed on the next run, without this change touching the interface.

🤖 Generated with Claude Code

@ffishman
ffishman force-pushed the claude/project-thread-r0kizs branch from 474ac63 to 5a5a0b5 Compare November 6, 2026 17:56
…load_points counting what is drawn

A component now knows the room it stands in, as Revit's Room parameter of a family
instance: the room on its level whose boundary at the walls' centre lines holds its
point (Rooms::room_at, Model::room_of). The centre lines whatever the project measures
rooms at, so an outlet or a switch on a wall's face is in the room on that side and not
in the wall. It is found where it is read and never stored, so it can't go stale when a
wall moves, and the file format doesn't change.

- element_json gives a component `room` (the room's GUID), `room_number` and
  `room_name`; one outside every room has none.
- Schedules of components gain Room Number and Room Name (not shown unless chosen).
- load_points, reading the model, counts the power outlets and the luminaires standing
  in each room (last phase, primary design options): a room drawn with too few outlets,
  or with no luminaire, is not ok. Where the model has no outlet, or no luminaire, at
  all, it takes the least as before; `counted` says which it counted.

Tests (room_of_tests.rs): a component in each of two rooms and one outside; outlets on
a wall's face in the room on their side, at either room measure; a component on another
level in none; the schedule's columns; load_points counting what is drawn, taking the
least where nothing is, and leaving out a demolished outlet.
@ffishman
ffishman force-pushed the claude/project-thread-r0kizs branch from 7965b9b to a650c3b Compare November 9, 2026 12:45
IPedrax added a commit that referenced this pull request Nov 9, 2026
Rooms: the room a component stands in, in schedules and inspect, and load_points counting what is drawn
@IPedrax
IPedrax merged commit 6d0ae12 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
IPedrax pushed a commit that referenced this pull request Nov 12, 2026
… and work planes

Part 1 of #311, replayed onto main from its history up to acdd352:

- F9: sections cut a family's forms in their own shape, holes left open.
- T2: family parameters of new kinds (text, whole numbers, areas, volumes, URLs, family types), grouped, shared by GUID,
  reporting, and Edit Parameter.
- T3: the shared parameters file, read and written in its usual tab-separated layout and loaded into families by GUID.
- T27 and T22: Doors > Opening and Windows > Opening, the swing's and opening lines' own subcategory; a hosted family's
  voids cut its wall in their own shape.
- F2, T1, T18: reference planes and reference lines in a family, and a host plane for each form.
- T5a: the family's options (Family Category and Parameters), its room calculation point and OmniClass number; IFC keeps
  components in their storey and references them in their room.
- T4, T13: Edit Work Plane, the project's reference planes, work plane-based components and Always Vertical.

Main's changes since 0.11 are kept where they meet: the rooms of components (#280) stay at the walls' centre lines and
take the family's room calculation point, the opening's rectangle comes from `walls::hole` (#378), and connectors with a
place (#269) are untouched. The file format changes go into 18, which everything since 0.11 shares.
IPedrax pushed a commit that referenced this pull request Nov 12, 2026
…nd Align

Part 6 of #311, the rest of its history (bb5ad33 to c93c4ba), merged into main:

- F10: the Family Editor's exit test, a parametric window drawn from blank, placed, flexed, scheduled and exported to
  IFC, with its CLI twin `ci/family-window.txt` in CI's IFC job, and the bugs it found; F10a to F10d: Pick Lines' Lock and
  Trim/Extend to Corner, a window's forms below the cut in plan, a Sill plane with Tab between coincident planes, a void's
  Cuts option.
- The file format's steps 18 to 32 collapsed into one.
- The review of #311: a component's room by its volume, at the walls' centre lines (one implementation with #280's), the
  starter wall devices' room calculation points, the shared parameters file's source.
- The desktop's review: New and Open Family on the start page and in File, Edit Family on the contextual tab's Mode panel,
  Properties showing the selection, forms and symbols in the Project Browser.
- Connectors (#269) placed, listed, edited, drawn and picked in the family document; face voids that cut both cut the face
  they stand on wherever they are listed; one definition of a shared nested family within the family loaded.
- The family's {3D} on the project's Orbit (triad, ViewCube, 3D mouse), family documents as tabs beside the project's,
  their plans and elevations painted as vectors, async completions finishing in the document that started them.
- T26: a door's leaf with Always Vertical off swings to the hand-drawn 45° and exports the same IFC.
- IFC tests compare two exports from DATA on.
- Align takes any form's edge and turns a plane, a reference line or a sketch line onto a reference that isn't parallel.
- Save, Save As and Ctrl+S save the family document, never the project; Find lists and runs the family document's
  commands.
- The translations of the review's strings, and Italian's famiglia.

Its own FORMAT 19 step and the rest of what changed on the way in are the next commit.
@dronov-dmitry dronov-dmitry moved this to Done in BIMCraft Nov 14, 2026
ffishman added a commit to ffishman/BIMCraft that referenced this pull request Nov 20, 2026
Each fails under a deliberate break that the tests let through before: a range from 0 holds 0, and each row answers at its
own upper end (and its demand's), in every utility's table and by every method (IPedrax#484, IPedrax#474); each building method at its
least number of dwellings and not one fewer (IPedrax#483); an outdoor rule asks it of outlets only, whatever kinds a code lists
(IPedrax#359); a room with its outlets and no light point is short, and enough once its light is drawn (IPedrax#280); a 3D file over the
limit refused by its size, before it is read (IPedrax#393); only a common property set has the status the export writes (IPedrax#291); a
beam at the view range's top is seen, and hidden by a ceiling there (IPedrax#153); Run Script says a single warning (IPedrax#391).
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