Adapter: The Sliced Cake
Audits pre-modeled 1-floor-high Breps. Extracts base contours and heights, heals small modeling gaps using a tolerance, and outputs the Universal Data Format for the MP Engine.
Overview
Audits pre-modeled 1-floor-high Breps. Extracts base contours and heights, heals small modeling gaps using a tolerance, and outputs the Universal Data Format for the MP Engine.
Inputs (5)
- FloorBreps (Brep): Individual floor volumes. (MUST BE FLATTENED)
- Programs (Text): Program assigned to each Brep.
- TowerIDs (Text): Tower tags for stacking logic.
- BuildingNames (Text): Building grouping tags.
- SnapTolerance (Number): Distance to heal gaps (e.g., 0.15m).
Outputs (2)
- JSON_Payload (Text): Universal Data Format payload
- Info (Text): Method, assumptions, simplifications and references.
Method, assumptions and simplifications
The same notes appear in the component's Info output.
Method
- Each FloorBreps item is one floor volume. Its bounding box gives the bottom (MinZ) and top (MaxZ); the Brep is cut by a horizontal plane 0.01 m above MinZ and the largest closed section curve is taken as the floor outline (moved back down to MinZ).
- Floors are grouped by BuildingNames, then by TowerIDs, and each tower is sorted bottom to top.
- Gap healing: when the base of a floor is within SnapTolerance (default 0.15 m) of the top of the floor below, above or below it, but more than 1 mm off, its base is snapped to that top. Floor height = MaxZ minus the healed base.
- The building base (true_base_elevation) is the lowest healed base in the building; every floor gets base_z = healed base minus building base, rounded to 1 mm.
- The outline is written as line, arc or polyline segments: the curve is first converted to arcs and lines (0.05 tolerance), then segments that are linear or arcs within 0.001 are stored exactly and anything else is polylined (0.01 tolerance). Coordinates are rounded to 4 decimals.
- Output: one JSON block per floor (floors = 1, floor_height, base_z, program, tower_id, boundary_segments), grouped per building. Block names are Floor_relative Z rounded to 1 m_TowerID; when two floors of a building would get the same name, the later one gets a suffix _2, _3 and so on.
Assumptions
- Every Brep is exactly one storey and the list is flat; Programs, TowerIDs and BuildingNames match it item by item (missing items default to Mixed_Use, Main_Mass and Building_01).
- Floors of a tower are vertical extrusions, so the outline 0.01 m above the base represents the whole floor.
- Model units are metres (the 0.01 slice offset and the 0.15 m default tolerance are absolute).
Simplifications and limits
- Only the largest closed section is kept: courtyards, holes and second pieces of the same floor are dropped.
- Floors whose slice gives no curve are skipped and listed by item index in a warning.
- Healing changes base_z and floor_height only; the outline geometry keeps its original absolute coordinates, including Z.
Workflow
- Floor-by-floor massing Breps from Rhino -> AD_CAKE -> JSON payload for the Masterplan Engine.
- Use AD_LEGO instead when each Brep is a multi-storey block.