Part of the architecture notes indexed in AGENTS.md. Keep each topic in its bullet here; AGENTS.md only lists the topics.
cc_core::pile: ElementKind::Pile(Pile) (category Pile, TypeData::Pile { section: PileSection (Round/Square), kind: PileKind, material }, a round 40 cm concrete type made with the first pile) stands at position (and rotation_deg) from cut_off (its head) down to toe, offsets from its level (the length is derived; commands take toe or length), with an embedment into the cap above and an optional cap: PileCapRef { cap, index }. A pile cap is a foundation placed as a FoundationShape::Pad (position, rotation) whose type is FoundationKind::PileCap with TypeData::Foundation::pile_cap: Some(PileCap) (layout: single, pair, triangle, square, Line { count }, Circle { count, radius, ring_width }; spacing, edge distance, pile type, length, embedment; thickness is the cap’s, width/length the outline’s size); PileCap::positions and outline (CapOutline: polygon, disk or ring, exact area) are in the cap’s frame (u along its rotation). EditCtx::finish → sync_piles (before phases and options) keeps every cap’s piles in step (Project::pile_sync): missing indices added (next mark), extra ones and those of no cap removed, the others put where the layout and the cap’s placement say (head at the cap’s bottom plus the embedment, its level and type), and cap types’ width and length; so a type change adds or removes piles in its undo step, a cap’s piles move, turn and change with it and go back when moved alone. They are deleted (remove_element, Project::piles_of) and copied with the cap (copy_set; a pile copied alone is free), follow its phases and design option (phase_host); repair drops piles whose cap is gone or no cap, outside the layout or doubled, and fixes values out of the module’s limits (MAX_PILES, MIN_/MAX_*). cc_geom::pile: ModelGeometry::piles (PileGeom: axis, section, z_range), round piles and round caps as cylinders of smooth facets, ring caps as annuli, FoundationGeom::cap (CapGeom: frame, outline, pile positions) and holes, exact volumes (curved_volumes for piles, FoundationGeom::drawn_area for caps); build_structure feeds caps (not rings) to the column joins, so beams stop at their outlines (element_get: {"pile_cap": id}). Plans draw caps as foundations and piles dashed with a center mark; schedules have CutOff, Toe, PileKind and, for foundations, PileCount. cc_engine::commands::piles: pile_create, pile_type_create, pile_cap_type_create, pile_cap_create, pile_caps_under_columns (rotation: column, an angle or radial about center), tie_beams_create (ordinary beams, straight or arcs about center); element_set refuses a cap’s pile and takes a free pile’s length; elements_delete keeps a cap’s piles deleted alone (cap_piles_skipped). IFC export writes IfcPile (with IfcPileType; kind as predefined and construction types, export::pile_ifc) and IfcFooting PILE_CAP (true circles), with PILE_PSET (ConstructCAD_Pile) and PILE_CAP_PSET (ConstructCAD_PileCap); import restores caps and links their piles by the cap’s GlobalId (Importer::link_piles), and any IfcPile that is a plain vertical extrusion of a circle or a square becomes a free pile; another program’s PILE_CAP (a rectangle, disk or ring) becomes a native cap, its free piles linked, when they stand where one of its layouts puts them (Importer::foreign_cap, #370, see interop.md). Caps and piles are reinforced by pile_cap_rebar_create and pile_rebar_create (#343): their sets are laid out from the cap’s layout when the model is built, so they follow a type change, and a pile the sync adds takes copies of the sets of the cap’s first reinforced pile (see Pile caps and piles in reinforcement.md).cc_core::structural_profile: ProfileDef (id, Uid, unique name, ProfileMaterial steel/cold-formed/timber/concrete, ProfileShape, optional CatalogRef, description) lives in Project::profiles (tracked as settings; format 27). A ProfileShape is a parametric standard shape (I, asymmetric I, channel, T, angle, cold-formed lipped U/Z/hat, rectangular and round tubes, rectangle, circle, concrete T/L, and AnnularSector: the piece of a ring between r_in and r_out turning sweep degrees, symmetric about Y with its outer face up, an even number of chords, its exact area, sector_center; Project::type_sector gives a type’s ring as placed) or a ParamSketch (parameters and expression ProfilePoints, with openings); outline() turns either into a SectionOutline (outer loop and holes, arcs split every ARC_STEP; bounded by the module’s MAX_*, errors as ProfileError values; repair drops bad shapes), and area() the exact area (outlines of 8 and 16 chords per quarter turn, extrapolated), which column and beam volumes (ModelGeometry::curved_volumes) and IFC quantities of parametric profiles use. cc_core::section_props computes area, inertias, moduli, radii and torsion constant from an outline, and cc_core::profile_catalog reads the built-in catalogs from the CSV assets in crates/cc_core/assets/profiles (W, HEA/HEB/IPE/HP, CHS/RHS/SHS, NBR 6355 cold-formed, sawn timber, glulam). TypeData::Column/Beam hold profile: Option<ProfileId> plus profile_rotation_deg and profile_mirror; Project::type_section gives a type’s outline and properties (legacy fixed sections are converted to profiles on load, convert_sections_to_profiles, and type_set refuses profile: null), and sync_profiles (run by EditCtx::finish) keeps each type’s width/height bounding-box cache in step with its profile inside the same transaction, so a profile edit resizes its types in one undo step (loading rewrites the same box, resync_profile_boxes); readers that need the shape (round rebar, tags, schedules, legends) ask Project::section_is_round/type_profile_def, not the legacy fields. cc_geom::section::detailed builds the cut outline at a detail level (Fine keeps the arcs, Medium squares their corners, Coarse is the bounding box); beams are swept from it along their axes and frame into the convex hull of the placed column outline; plans and sections hatch it in the type’s material, tags show a steel or cold-formed profile’s name, and schedules have Profile and LinearMass (kg/m from the material density; the template’s steel is 7850 kg/m³). element_get gives derived.section; analytical export (format 2) writes each member’s section { profile, area, ix, iy, j, width, height }; format 3 adds a curved member’s arc { bulge, center, radius, sweep } (degrees) with the arc’s length, omitted for straight members, and analytical_model/analytical_export take arc_segments to write arcs as that many straight members. IFC export writes the parametric IfcIShapeProfileDef/UShape/TShape/LShape/CShape/RectangleHollow/CircleHollow/Rectangle/Circle where one matches and IfcArbitraryClosedProfileDef/WithVoids for the rest (cold Z, asymmetric I, other cold shapes, concrete T/L, sketches, mirrored types), with an IfcMaterialProfileSet and IfcMaterialProfileSetUsage per type; import makes native profiles and types only when it holds the geometry exactly (reusing a profile whose shape matches within 1e-6 m; cold-formed sections marked by the material profile Category ColdFormed), else components; sketched profiles that cross themselves or whose openings cross or overlap are refused. cc_engine::commands::profiles: profiles_list, profile_get, profile_create, profile_set, profile_duplicate, profile_delete (replace_with), profile_catalog, profile_import, profile_type_create; type_set takes profile by name. The app: profiles_dialog.rs (the Profile Manager, Structure → Profiles and Manage → Profiles) with profile_sketch.rs (Edit sketch opens sketch_mode::Target::Section { profile } with reference planes and keeps the dialog’s dialog::session alive through Dialogs::profiles_resume), and the Profile picker of Type Properties in type_dialog.rs.cc_core::structural_material: StructuralMaterial (concrete, steel, timber; code, from_code, key) and Project::structural_material/types_of_material (a column or beam type’s material comes from its profile’s ProfileMaterial, else its material class). cc_engine::commands::structure_material holds structural_type_for (the first type of a material, else a default from the catalog in one undo step: W200x26,6, MLC 9x32, concrete 20x40) and cc_engine::commands::grid_frame grid_frame_create (columns on every storey of a level range and beams on the upper levels over the grids, secondary beams per bay, MAX_MEMBERS, one undo step). The app: the Structure tab’s Material selector (ribbon::structure_tab, Preferences::structure_material), Tool::Column/Beam::material filtering tools::tool_types, and grid_frame_ui.rs (the Grid Frame dialog, which frames the selected grids, else all).cc_core::steel_building: ElementKind::SteelBuilding(SteelBuilding) (category SteelBuilding, a TypeData::SteelBuilding {} type created with the first one) is a parametric host with no geometry of its own: origin, rotation_deg, span, eave_height, slope_percent, FrameRoof (gable or mono), bays and bay_spacing, the column_type and rafter_type, and optional purlins and girts (Secondary: type and spacing), with bounds and defaults as constants (repair_member_hosts resets out-of-range values). layout works out the portal frames’ columns, rafters, purlins and girts, each member keyed by a MemberRole (RoleKind), at most MAX_MEMBERS; the members (FrameMember) are ordinary columns and beams. EditCtx::finish → sync_member_hosts (cc_core::member_host, shared with trusses; right after sync_profiles, from element_changes/changed_types): deleted members, and members whose kind, type or level changed while the building did not, are detached (SteelBuilding::detached: that role is not made again); changed or added buildings, and buildings whose types changed, regenerate their members in place keeping ids, and a copy gets its own; remove_element takes the members along (Project::host_members_of) and copy_set leaves them out; repair_member_hosts; SteelBuilding implements MemberHost. cc_engine::commands::steel_building holds steel_building_create (types default through structure_material::catalog_type with FRAME_DEFAULT/SECONDARY_DEFAULT, one undo step); element_get shows derived.members and detached, and element_set patches the parameters and refuses a changed members. Plans draw the footprint dashed (plan::draw_steel_buildings); the host builds no geometry, and IFC export leaves it out (its members are written as columns and beams). The app’s steel_building_ui.rs: the dialog (Structure → Framing → Steel Building), the palette rows and Reset Members.cc_core::member_host: MemberHost (member types, layout, member list and detached roles as RoleKeys whose order is the typed roles’, role_fits, check_parameters, repair_parameters, inputs: the elements whose change, type edit or departing hosted element regenerates the host, and member_level), Project::member_host_of, ElementKind::member_host/member_host_mut, and the generic sync_member_hosts, repair_member_hosts and host_members_of. cc_core::truss: ElementKind::Truss(Truss) (category Truss, a TypeData::Truss {} type created with the first one) holds the start/end span line, base_offset of the bottom chord’s axis, a TrussShape (flat, mono, gable) with rise, height, a TrussPattern (Pratt, Howe, Warren, king post, queen post, Fink; pattern_used falls back to Pratt where a pattern does not fit), panels 2 to 64 (even on a gable), the top chord, bottom chord, web and post types, and copies at spacing to the left of the span line; layout(&Sections) makes one continuous chord beam per straight run (a gable’s top chord is two; joins off, so they pass their posts), diagonals between panel points (BeamVertical::Center) and post columns (a flat truss has posts at both supports), keyed by TrussRole/TrussRoleKind, skipping verticals under MIN_VERTICAL; Sections::of reads the member types’ sections: the posts are turned so the side nearest the chords’ width lies across the truss and stand where they seat on each chord (its face, or inside a channel open toward the web; under a sloped chord, its underside), and where the truss ends on a post the chords run on to its far face and the far post is turned 180°, closing the ends; an older file’s per-panel chords are replaced when the truss regenerates; check refuses a truss whose layout (all copies, members_per_copy) would pass MAX_MEMBERS; a mirror maps the copies. cc_engine::commands::framing holds truss_create (material steel or timber, truss_rows through structure_material::catalog_type/type_or_row, the steel rows’ channels laid on their sides with catalog_type_placed: bottom chord open upward, top chord and diagonals mirrored; one undo step, returns {id, members}; element_get shows derived.members, detached and pattern_used). Plans draw each copy’s span line dashed (plan::draw_trusses); IFC export leaves the host out. The app: Tool::Truss { material } (in the steel and timber framing groups, TrussOptions, truss_command), truss_ui.rs (options bar, palette rows) and member_host_ui.rs (member counts and Reset Members, shared with steel_building_ui.rs).cc_core::bracing: ElementKind::Bracing(Bracing) (category Bracing, a TypeData::Bracing {} type created with the first one) is a member host of the braces of one bay of a frame: the bay line start/end (two column axes), base_offset, the storey height, stories 1 to 100, a BracingPattern (V, Chevron, Diagonal, X, K: braces from the mid-height of each column to the middle of the bay at the top and bottom of the storey; per_story), flip and alternate (diagonals only) and the brace_type (a beam type); layout makes the braces as sloped beams (BeamVertical::Center, end_offset), keyed by BracingRole { story, index }. cc_engine::commands::bracing holds bracing_create (start/end, or two columns whose level, base and common height it takes; brace_row through type_or_row: steel SHS 100x100x4, timber Peça 6x12, concrete needs a type; one undo step, returns {id, members}; element_get shows derived.members, detached, length, total_height); the older brace_create and braces_between_columns still make loose beams. Plans draw the bay line dashed (plan::draw_trusses); IFC export leaves the host out. The app: UiCommand::Bracing in the steel and timber Structure groups (bracing_ui::start: two selected columns are braced at once, else Tool::Bracing { material }, BracingOptions, bracing_command), and bracing_ui.rs (options bar, palette rows).cc_core::wall_framing: ElementKind::WallFraming(WallFraming) (category WallFraming, a TypeData::WallFraming {} type created with the first one) is a member host of one straight wall: the wall, a FramingSystem (light steel or wood), the stud (column), track (beam) and header (beam) types, spacing 0.2 to 1.2 m, double_top (wood only; ignored for light steel) and blocking. layout(&Project) works in the wall’s frame on its body centerline u: end studs flush with the wall ends (END_STUD), studs every k·spacing dropped where an opening’s framing stands, king and jack studs, a header, a sill (windows) and cripples (2k above, 2k + 1 below) per opening, and blocking keyed by its left stud, as FramingRole/FramingRoleKind (pieces under MIN_PIECE skipped, MAX_MEMBERS bounds it); studs turn with the wall so their depth runs across it, and the beams have joins off. Its inputs are the wall and its doors and windows, and member_level keeps the members on the wall’s level. Removing a wall removes its framing (framings_of in remove_element), copying a wall copies its framing (a framing alone is skipped), and repair_wall_framings keeps one per wall. cc_engine::commands::wall_framing: wall_framing_create (framing_rows through type_or_row/catalog_type; curved and already framed walls refused before any edit, one undo step, {framings: [{id, wall, members}]}), element_get derived, and element_set refusing a new wall. Plans draw only the members (nothing for the host) and IFC export leaves the host out. The app: the Light Steel Frame (Steel) and Wood Frame (Timber) buttons in the Structure tab’s framing groups, wall_framing_ui.rs (the dialog, which frames the selected walls or the active level’s; the palette rows with Reset Members; and the Framing row of a member) and Icon::WallFraming.cc_core::connection: ElementKind::Connection(Connection { member, end: MemberEnd (Base, Start, End), kind: ConnectionKind (BasePlate, EndPlate, FinPlate, TimberBolts, Hanger), params: ConnectionParams }), category Connection, a TypeData::Connection {} type created with the first one; lengths LENGTH 1 mm to 2 m, a plate’s width/length 0 = from the section plus edge; rows and columns COUNT 1 to 10; refused by commands, reset by repair_connections, which keeps one connection per member end, the lowest id; removed with its member (remove_element → Project::connections_of), following its phases and option (phase::phase_host), never copied (copy_set), no placement of its own. cc_geom::connection (built after the beams into ModelGeometry::connections: ConnectionGeom with Plates of oriented Blocks and Bolts of Rods with washers, plate volume and mass at 7850 kg/m³, bolt count and length; suits: end plates and bolted joints at BeamEnd::Column, fin plates at columns or beams, hangers at beams; a ConnectionWarning and no parts otherwise; one steel solid per connection of category Connection, in the project’s first metal); plans draw it where its member stands (plan::draw_connections). cc_engine::commands::connection: connections_create (kind, members or the level’s, partial params; skips ends that have one; one undo step; {created, skipped}), element_set refuses a new member, end or kind, and element_get derived has plate_volume, plate_mass, bolt_count, bolt_diameter, bolt_length and warning; schedule fields ConnectionKind, PlateMass, BoltCount, BoltDiameter. IFC export writes an IfcElementAssembly USERDEFINED with the kind’s code as ObjectType, aggregating an IfcPlate per plate and an IfcMechanicalFastener per bolt (ANCHORBOLT under base plates, else BOLT), typed per connection type, with an IfcRelConnectsElements from the member; import keeps the parts by the existing fallback. The app: Structure → Connections (steel Base Plate, End Plate, Fin Plate; timber Bolted Joint, Hanger), UiCommand::Connection(kind), connection_ui::place (the selected members, else the active level’s) and connection_ui::props, and the shared Icon::Connection.