- Escribir el programa de diseño
Before any modelling, turn the request into bim/design-brief.md: the checklist this model is held to, and the review checks it. Read everything the person gave: the run note, their messages, a floor plan, attached reference images.
Sections, each item a checklist line ("- [ ] ..."), with sizes in metres where they matter:
1. Program: storeys, and every room with its rough size and what is in it (furnished rooms list their furniture).
2. Style and palette: the look in a few words, and named colours for walls, trim, roof, doors.
3. Key features: each one the person named or showed (say, a bay window, a round-topped door, a garage with its own gable, a chimney, a treehouse), with where it goes.
4. Must-haves and nice-to-haves: every key feature is a must-have unless the person said otherwise. Level of detail is a must-have too: if they asked for a richly detailed or lived-in model, say what that means here (furniture in every room, trim, fixtures).
5. Assumptions: what you had to decide yourself.
Reference images are for intent: layout, mood, level of detail. If the person asks to copy a copyrighted design (a show's house, a game's building, an architect's work), say so in one line in the brief and keep the design original unless they insist.
Restate the brief in your answer, short, so the person can confirm or change it.- Modelar la arquitectura y compararla con el programa
Model from bim/design-brief.md (read it again: the person may have edited it) and, if there is one, the floor plan. A DXF plan is best: read its layers (walls, doors, windows, grid) with ezdxf, and its scale from $INSUNITS. An image or a PDF page works too if the note gives one known dimension (say "the south wall is 15 m"): measure everything from that, and say how sure you are. Turn a PDF page into a PNG first (pdftoppm or sips).
Work in a bim/ folder in this tab. Use IfcOpenShell (in a venv if it is not installed). Call cad_kit first and build with its cocobox_bim.py blocks (walls with openings, roofs, bay windows, stairs, chimney, porch, furniture kits) rather than hand-made boxes. Write a script, not a one-off: a change is a rerun.
1. bim/architecture.ifc: the brief's must-haves first, then its nice-to-haves. One storey per level, GlobalIds derived from element names, so a rerun keeps them.
2. bim/project.bim.json, the federation file every discipline aligns to: name; units "m"; grid {x, y: [{name, at}]} from the plan's grid (or from the structural walls if it has none); levels [{name, elevation}] (ground floor, ceiling, beam soffit, roof structure, foundation); underlay {path, scale, origin, elevation} pointing at the plan if there is one (scale in metres per drawing unit or pixel); models: one entry per discipline (Architecture, Structure, Plumbing, Electrical, HVAC) with path architecture.ifc, structure.ifc and so on. Leave tab off Architecture: a comment on it then comes to the tab the person is in, normally this one.
3. Look at it: cad_render bim/architecture.ifc with views iso, front, back, left, right and a cutaway per storey (cutaway:<height>, 1.5 m over each floor; or render bim/project.bim.json with cutaway:<storey name>). Then go through bim/design-brief.md item by item and mark each met (- [x]), partial (- [~]) or missing (- [ ]), naming the image that shows it. Fix what is partial or missing and render again, up to two rounds. Anything you still leave out or simplify, say so and flag it: never drop a brief item silently.
4. Answer with the checklist and the rendered images embedded (), and bim/project.bim.json embedded so the person can orbit it and pin comments.- Una pestaña por disciplina
Open four tabs with open_tabs, one each for Structure, Plumbing, Electrical and HVAC, with permissions "bypass" if the person allows it. Each tab works only in its own worktree: it writes its file there, never in this folder. Give each, standing alone (they do not see this chat):
- the full path of bim/project.bim.json to read (never to change), and to use its grid and levels as they are, with one IfcBuildingStorey per level, the same names and elevations;
- to write bim/structure.ifc, bim/plumbing.ifc, bim/electrical.ifc or bim/hvac.ifc inside its own worktree, with an IfcOpenShell script kept there, GlobalIds derived from element names;
- its scope. Structure: pad footings, columns, beams and the ground slab on the grid. Plumbing: fixtures, cold and hot supply, drains. Electrical: panel, outlets, switches, lights and cable runs. HVAC: the unit(s) and ducts, with air terminals;
- to keep services in the ceiling zone between the Ceiling and Beam soffit levels where they fit, and say where they do not;
- to end its report with the absolute path of its file, and to say its model is a draft for a licensed professional to check;
- that a review comment may come later naming this project's copy of its file: it changes its own file and reports the path again;
- to render its file with cad_render (iso and a cutaway per storey) and check it before reporting, and to say plainly anything it left out or simplified;
- to end its turn after it reports, and never wait, sleep or poll for an answer: a message sent to a tab while its turn runs is queued until that turn ends, so waiting only delays it.
Write each tab's agent name into the federation file as that discipline's tab, so a comment pinned on its file goes to it. Answer their questions. End your turn while they work: their reports come back here. As each report arrives, copy the file it names into bim/ (overwrite). When all four are in, cad_render bim/project.bim.json (iso and a cutaway per storey), embed it and the images, and mark this step done.
- Detección de interferencias
Write bim/clash.py with IfcOpenShell and run it: every element's bounding box in world coordinates (ifcopenshell.geom, use-world-coords), every pair from two different discipline files compared, Architecture against Structure skipped (columns sit in walls by design), overlaps under 10 mm ignored. An overlap that runs right through a wall's or slab's thickness is a penetration to sleeve, not a clash: count those apart. Write bim/clashes.json.
Report: how many clashes, each with the two elements (discipline, name, GlobalId), where (grid reference and level) and the likely fix; the penetrations as a count. Embed bim/project.bim.json so the person can pin a comment on a clash: a pin on a discipline's element goes to that discipline's tab. Say plainly that the structural, plumbing, electrical and HVAC models are drafts that a licensed professional must check before anything is built.
- Corregir y volver a comprobar
Send each clash to the tab that should move its element (message_tab; ducts and pipes usually move, structure usually stays), with the two GlobalIds, the point and your suggested fix. As their reports come back, copy each file they name into bim/ again, then rerun bim/clash.py and report what is left.
End with the final report: bim/design-brief.md's checklist (each item met, partial or missing, with what is left to do), the cad_render images of the federated model (iso, front and a cutaway per storey) embedded, and bim/project.bim.json embedded again.