Part of the architecture notes indexed in AGENTS.md. Keep each topic in its bullet here; AGENTS.md only lists the topics.
cc_core::curtain: a wall type whose TypeData::Wall::curtain holds a CurtainSystem (vertical and horizontal CurtainGrids: layout, spacing, count, justification; the default CurtainPanel: glass, solid, empty or a component type; interior and border Mullions) has no layers (ElementType::layers is empty, thickness is the deepest mullion or panel). Each Wall keeps curtain: CurtainEdits (its own lines, removed GridSegments and PanelSwaps, by position: u along the body centerline, heights above the base; reverse under a mirror), and curtain::layout works out the grid (cells merged across removed segments, panels between the mullions, mullion pieces), bounded by MAX_LINES. cc_geom::curtain places it over the wall’s inner range (flat panels on the chords of an arc wall, component panels resolved with Width/Height and WallThickness) in WallGeom::curtain, with solids per material; a straight curtain wall inside a parallel straight wall (wall::embedded_in) joins nothing and opens its host like a door. Plans draw mullions and panel lines (plan::draw_curtain); schedules have PanelCount, GlazedArea, MullionLength. Commands in cc_engine::commands::curtain (curtain_type_create, curtain_get, curtain_grid_set, curtain_panel_set). IFC export writes an IfcCurtainWall (axis only) aggregating an IfcPlate per panel and an IfcMember (MULLION) per mullion piece, typed per curtain type and kind, and the grid in CURTAIN_PSET (ConstructCAD_Curtain: System and Edits as curtain::to_text, Height, Bulge); an embedded curtain wall’s host only gets an opening. Import rebuilds from that set, else from the parts when they make a plain straight grid (Importer::curtain_from_parts: one plate per cell, mullions sized by the members, the lines kept as the wall’s own); otherwise the parts come in one by one. Component panels come back as the type’s glass. In the app (curtain_ui.rs): the wall tool’s type list makes a curtain type when the project has none (new_curtain_type), the type’s grid, panel and mullion sections in Type Properties, the grid rows of a selected wall in the palette, and the Curtain Grid tool (Tool::CurtainGrid, options in AppState::curtain), which picks a wall and a point on it in plans (at the cut height) and in elevations and sections (through View::projection) and runs curtain_grid_set or curtain_panel_set.cc_core::wall_profile: Wall::profile (Option<WallProfile>, format 31; 30 belongs to another change) is the outline of the wall’s face in its elevation frame (u along the drawn location line from its start, the same u as doors and the body centerline of a straight wall; z above Project::wall_base_z), CCW outline points plus an optional Sketch of the curves it was drawn with (dropped when it no longer makes the outline, drop_stale_sketch). It is one simple loop, monotone along the wall (Chains: a bottom and a top chain by increasing u, vertical ends and steps allowed; ProfileError with the point and an i18n key otherwise), no holes, within [0, length] and MAX_BELOW/MAX_ABOVE; holds tests a door’s rectangle, area is exact along the sketch’s curves, reversed mirrors it, and refit(old_length, shift, new_length) keeps it where it was along the wall, cuts it at the ends (curves cut on their own geometry, else the outline clipped and the sketch dropped) and moves the points of an end it reached when the wall grows there. Only straight walls that are not curtain walls take one: EditCtx::finish → sync_wall_profiles refits it when a wall’s length changes (a start moved along the wall’s own line shifts it; a plain move or turn leaves it) and drops it when the wall becomes an arc or a curtain wall; Element::transform reverses it under a mirror and wall_ops::split gives the second part its share; repair drops a bad one, cuts one past the end and drops attach_top of a profiled wall (the profile wins). The height, top constraint and top_z stay the nominal box. cc_geom: build_walls lifts the chains to absolute heights; an end the profile stops short of (END_REACH) joins nothing and is capped square at the profile’s end (start_ext/end_ext); the walls’ height overlap for joins uses the profile’s range; openings and niches not holds inside it are left out (not cut or drawn); WallGeom::set_elevation (after set_openings) splits the columns at the chains’ points and stores bottom_profile/top_profile segments and profile (is_profiled); intervals_at takes the lowest interval’s bottom and the highest’s top from the chains where they are not an opening’s; to_solid slopes the base faces and the sides (face_pieces with a bottom line), volume evaluates the heights at each column footprint’s centroid (exact for planes); cut_columns(z) splits columns where the chains cross a level plane (plans draw a profiled wall cut only there, seen below or not drawn above per the usual column states), solid_at(u, z), and profile_outline (the outline carried on to mitered ends’ corners). Wall bars use them (horizontal bars stop where the body ends at their height, vertical bars between the chains with the cover at the base); attach_wall_tops skips profiled walls. Schedules’ wall Area is the profile’s less the doors inside it. Commands in cc_engine::commands::wall_profile: wall_profile_set (curves or points), wall_profile_slope (top_start, top_end, base_start, base_end), wall_profile_remove; sketch_get/sketch_set take walls (frame: "wall_elevation", the nominal rectangle with profile: false when none), wall_create takes profile curves, element_get derived.profile (area, min_z, max_z, start, end); arc, curtain, attached and framed walls are refused, wall_attach and wall_framing_create refuse profiled walls. IFC export sweeps the outline across the wall (IfcExtrudedAreaSolid in the axis plane, clipped by IfcHalfSpaceSolids at mitered ends, Exporter::clip_end, representation Clipping), quantities from the profile, and WALL_PROFILE_PSET (ConstructCAD_WallProfile: Profile as curtain::to_text, Height, Width), which Importer::profiled_wall reads back. The app (wall_profile_ui.rs): Edit Wall Profile and Reset Wall Profile (Modify tab and the wall palette’s Profile section, UiCommand::EditWallProfile/ResetWallProfile) open the profile in profile_sketch’s canvas as sketch_mode::Target::WallProfile (lines and arcs; reference lines at the ends, base, top and nearby levels, hosted openings drawn faintly), finish with sketch_set and warn when hosted elements no longer fit (misfits). Per-layer extents (cc_core::layer_extent): each Layer of a wall type takes base_offset (from the wall’s bottom at each point: base, profile chain or attached top) and height: Option<f64> (from its own bottom, clamped to the wall’s top; None to the top), serde defaults skipped when default (bounds MAX_OFFSET, MIN_HEIGHT/MAX_HEIGHT; repair resets bad ones and clears floors’ and roofs’; type_set checks them, check_layer_extents). cc_geom::wall_layers (a child of wall): WallGeom::layer_extents (empty when all are default: the plain path, bit for bit) groups layers into Bands of one extent; within a column every height is a Lin along the wall and split_bands (after set_elevation/set_top_profile) splits columns where any two cross, so extent_lines(c, extent) (decided at the column’s middle; openings cut every band they cross) holds across it (not in a mitered end’s stretch). intervals_at/c.solid are the bands’ union (joins, rooms, bars; the join height filter reaches the lowest layer), layer_intervals/intervals_at_v one layer’s, banded_solid steps tops, bottoms, the faces between bands and the caps per band, layer_volumes (strip area times heights at the strip’s centroid, less recess shares; a banded wall’s volume is their sum), volumes_by_material, layer_range, layer_outlines (elevation polygons, openings left in). Plans draw each band cut, seen below or not (plan::draw_banded_wall; T cleanup as if the layers stood at the cut); section cuts keep one cut material over the stepped outline. element_get derived.layers (material, thickness, volume, base, top above the base). IFC export writes one body item per layer in its material (layer_bodies: strips extruded, or profile outlines swept and every item clipped when one is) and WALL_LAYERS_PSET (ConstructCAD_WallLayers: Extents in the type’s HasPropertySets, Height/Width on each wall), which Importer::layered_wall/layer_extents read back.cc_core::wall_spline: Wall::spline (Option<WallSpline { control }>, format 32) is the wall’s location line as the control points of a chain of cubic Béziers (the form of cc_core::spline; WallSpline::through interpolates fit points); the wall then has no bulge and start/end are the curve’s ends (EditCtx::finish → sync_wall_splines: the curve wins; ends moved while the curve stayed take it along, whole when both moved alike, else each end’s knot and handle, move_end). WallSpline::path flattens it into a WallPath (stations with the curve’s true unit normals and signed curvature; chords at most SAGITTA 0.5 mm off the curve and MAX_TURN 6° apart, MAX_CHORDS, tolerances loosened past it; u is the distance along the chords): at(u, v) lies between the stations’ points v along their normals, so a line at a constant v is the polyline through the stations’ exact offsets, straight past the ends; locate is its exact inverse (a quadratic per chord); offset, tangent, line, face_near, min_radius, face_radius. WallSpline::check(left, right) (faces as signed offsets of the location line, Project::wall_faces; Project::check_wall_spline) gives the path or a SplineError (Points, Short: open and MIN_LENGTH long, Corner: a kink past MAX_KINK_DEG where segments join, Tight: the face inside a bend keeps less than MIN_FACE_RADIUS, Crossing: a face crosses itself or the other; key() i18n wall-spline-*, point()); repair_wall_splines (before the element loop) drops a curve that fails it or stands on a curtain type (the wall stays straight between its ends), puts the ends on the curve and clears bulge, profile and attached top, and the element loop removes doors, windows, niches, bar sets and framings hosted by a spline wall. Wall::arc() is None for one; is_curved, spline_path, length, at, project, tangent_at follow the curve; Project::wall_path is the body centerline (the location line’s offset), wall_axis its ends. Element::translate/transform move the control points (a mirror reverses them); wall_ops: is_spline, path_of gives none and path EditError::Spline (trim, extend, align refuse: msg-spline-wall), split splits the curve (WallSpline::split), offset_copy offsets it (spline::offset, approximate; checked), move_endpoint works through the sync. cc_geom: WallLine::path and WallGeom::spline hold the centerline path (Arc<WallPath>; is_curved); world, local, tangent, frame_at, path take it, WallGeom::steps meshes a column at every station of either face (fractions; arcs and lines as before, bit for bit), facet_normal gives a spline’s side facets their own normals (so Solid::volume is the chords’ exactly), areas are the chords’ polygons (outline_area, strip_area), faces are Face::smooth. Joins: a spline wall’s face is Curve::Poly, its chords within FACE_REACH of the joint carried on straight past its ends, met exactly with lines, circles and other polylines, so its ends miter and butt like any wall’s and walls end on its curved side (face_gaps, layer cleanup included); it never embeds or is embedded. Bands (layer extents) work as they are. Plans, projected views, rooms, tags, dimensions (dim_refs reads is_curved) and schedules come from those. No openings, recesses, attached tops, profiles, curtain grids, bars or framing on a spline wall (build_walls and rebar skip them). Commands (cc_engine::commands::wall_spline, helpers only): wall_create through (the points between start and end) or control (all of them, from start to end), check_wall (also from element_set, which patches params.spline), refuse in hosted_at, wall_attach, wall_profile, wall_rebar_create, rebar_copy, framing, strip_footings_under_walls (skipped), element_align; element_get derived.spline { segments, min_radius, face_radius, knots }. IFC export writes an IfcWall NOTDEFINED with a Brep body (the capped solid, faces wound outward) in the storey’s frame, no axis and no layer set usage (the type carries the layer set); import brings it back as a component by the fallback. In the app the wall tool’s Spline mode (tools::WallMode, spline_wall_tool) takes the points clicked (Enter, Esc through tools::spline_wall_escape as it ends a chain of straight walls, a click on the last point or a double-click makes the wall with wall_create through; Backspace takes a point back) over a preview checked by Project::check_wall_spline (faces from wall_faces; a failure is drawn in the warning color at SplineError::point, its key() shown and the wall refused), the Select tool gives a selected spline wall a grip per inner knot (Drag::Knot: sketch_mode::spline_moved keeps the handles, written through engine_edit::element) and previews its end grips on the curve, the door, window and niche tools answer msg-spline-wall-hosts, and the palette leaves out the arc angle and the profile section. Notes for the next stages: docs/superpowers/specs/2026-11-17-spline-walls-notes.md.ComponentKind::Niche definitions whose HostOpening::depth is an expression (openings::niche_def: Width, Height, Depth and Sill parameters, no pieces; ComponentDef::opening_depth, ElementType::opening_depth) make types of Category::Niche, and ElementKind::Niche(Hosted) elements (as_hosted covers them, so they move, copy, phase and go with their wall like doors; flip_facing puts them in the wall’s right face). cc_geom::wall::Recess (WallGeom::recesses, set_recesses after set_openings: kept inside the faces and height, no deeper than leaves RECESS_MIN_BACK, left out when it overlaps an opening or an earlier recess) does not split the wall into columns, so joins, rooms, bars and framing see the wall whole (wall_framing and the wall’s net area skip niches); to_solid opens the face in pieces (face_pieces) and adds the recess’s back, sides, bottom and top, volume subtracts recess_volume (exact along arcs), and ModelGeometry::volume of a niche is what it takes out. Plans (plan::draw_recesses) cover the wall’s fill where a cut niche is and draw its sides and back, as primitives of the niche (hidden with its category), with a projection line along the face for its sill when the wall stands under it; one wholly below the cut is hidden, one wholly above hidden with a LinePattern::Dash pen (ceiling plans: both hidden), and face_segments_at opens the cut face; elevations pick a niche by an OpeningSymbol outline off its face. cc_engine::commands::niche: niche_type_create, niche_create (makes the default type in the same undo step when the project has none; new projects carry it, Defaults::niche, added last by from_template_system); element_get derived has width, height, depth, face and volume. IFC export writes an IfcOpeningElement RECESS with NICHE_PSET (ConstructCAD_Niche); import does not read it back yet. The app reuses Tool::Hosted (Category::Niche, Architecture → Build → Niche, Icon::Niche); its options bar has the sill of windows and niches placed next (AppState::hosted_sill, tools::hosted_sill; cleared by set_tool and a type change).cc_core::wall_flip: swaps a wall’s exterior and interior sides with its location line kept in place. Wall::reversed walks the same line the other way (ends and join_start/join_end swapped, bulge negated, WallSpline::reversed, WallProfile::reversed), so the layers (listed from the left face) mirror about the location line: a wall on a finish or core line keeps that line and its body changes side. EditCtx::flip_walls (checked first by Project::check_wall_flip: FlipError::TooTight when an arc’s face on the other side would pass its center, FlipError::Spline when the reversed spline fails check_wall_spline with the body on the other side; nothing changes then) also reverses along the wall what is measured on the body centerline: CurtainEdits::remap and hosted offsets (reverse_along: L - u, scaled by the new centerline length on an arc wall whose centerline moves), toggles flip_facing and flip_hand of its doors, windows and niches (a half turn of their frame: they stay put, facing the same way), moves its WallHorizontal/WallVertical bar sets to WallSide::other (the bars stay on the face that looks the same way in the world) and points dimension references at the same points (Line: from_end toggled, across negated; Hosted on its openings: both negated). What only the derived geometry knows the engine sets in the same edit (modify::flip_keep, before the flip): a vertical set’s offset from cc_geom::flipped_vertical_offset (what is left after its last station before the cover at the face’s end after joins, snapped to the nanometer, so its stations map to L - u and flipping twice gives the offset back), and, for a curtain wall laid out by its type’s vertical grid whose lines counted from the other end differ (fixed distance justified at the start or the end; centered, fixed number and maximum spacing are symmetric), the wall’s own CurtainEdits::vertical lines at the mapped positions (Project::flipped_along), so mullions stay put; the wall then no longer follows that type’s vertical grid (the type is not changed). Paints are world-anchored and stay. Not kept in place: the studs of a wall framing, regenerated from the new start by sync_member_hosts (the framing has no setting to count from the end); ties, which follow every every_vertical-th station of the face now exterior from the new start (they stay only when both faces’ stations match and the count fits); the lap stagger of spliced vertical bars, alternating by station index (it swaps when a set has an even number of bars); and anything along an arc wall whose centerline moves (its body moves anyway). Commands (cc_engine::commands::modify): wall_flip { walls } (one undo step, tx-wall-flip; pinned walls skipped, a wall that cannot flip fails the whole command) and elements_turn (Space on a selection), which flips the selected walls in the same step as it turns the rest, leaving out the doors and windows of a flipped wall (they go with it) and reporting not_flipped. The app: Space with the Select tool runs elements_turn (tools::rotate_selection, status msg-walls-flipped or msg-rotated), Flip Walls (UiCommand::FlipWalls, Modify → Geometry, shortcut shown as Space) runs wall_flip (modify::flip_walls), and in the wall tool Space toggles Interaction::wall_flip (msg-wall-side-flipped): the preview draws the body on the other side of the line (center negated) and create_wall makes the wall from the second point to the first (bulge negated; a spline’s fit points reversed, spline_fit).