Before you start
You have a session from Start a building.Write the slab
This slab goes below the room from Draw a wall. The path of a wall is its centre line, and those walls are 0.2 metres thick. Thus the slab outline is 0.1 metres outside the wall path, at the outer face of the walls. The slab is 0.2 metres thick. Its top is at the storey elevation, so its bottom is 0.2 metres below.Add it to the storey
A slab is an entry in theslabs list of its storey.
add-element command adds the slab to the list, and the session builds it. You keep the session and its undo history. The command rejects an id that the list has.
Rules
outerRingis a list of[x, z]points in metres. Do not repeat the first point.- A wall path is the centre line of the wall. To put the edge of a slab at the outer face of a wall, move the outline half of the wall thickness out from the path.
baseOffsetis the distance from the storey elevation to the bottom of the slab.rolecan be'slab','floor'or'ceiling'. The role does not change the shape, but it changes what is built and how the plan draws it:'slab'builds a structuralSlab(ogTypeSLAB). The plan draws it with a 0.35 mm pen and a solid fill where the cut passes through it.'floor'builds a floor finish: aSlabwithfinish: true(ogTypeFLOOR). The plan draws it with a 0.25 mm pen.'ceiling'builds aCeiling(ogTypeCEILING). ItsbaseOffsetis the underside. The plan draws it with a 0.18 mm phantom pen.
- The role also decides the floor area of the storey: see Read the floor area.
- A slab below the cut of a storey plan draws only the edges that show: a change of floor level or an edge that no wall stands on. The edges draw with the 0.25 mm pen of lines below the cut. Two slabs of one storey that meet at the same top height draw no line between them, and a lower slab draws no edge under a higher one.
- For a hole, such as a stair opening, add a ring to
profile.holes.
Give the edge a profile
A slab edge can have a profile, such as a rounded nose or a downstand. The profile is a closed ring of[out, up] points in metres. out is the distance out from the outline edge, and up is the height above the top of the slab. The profile is swept along the outline edges.
edgesare indices of the outline edges. Edgeigoes from pointito the next point. Withoutedges, the profile goes along the whole outline.- Every point must be outside the edge (
outof 0 or more), or every point must be under the slab (upof-thicknessor less). - A rounded nose is a ring of short lines. The kernel does not sweep an arc in a profile yet.
- The kernel refuses a sweep where two edges that are not neighbours come closer than twice the distance from the top edge to the farthest profile point. Thus an outline with many short edges, such as a curve in chords, cannot have a profile yet.
materialis the top face,edgeMaterialis the edge andsoffitMaterialis the underside. Each takes a value of the material list of the role. A ceiling has none of the three fields.- The profile is drawn in sections and elevations. It is not part of the floor area of the storey.
- The IFC export uses the evaluated slab and its edge profile.
Give the outline a curved edge
An outline edge can be a circular arc, as a wall segment can.arcs.outerRing has one entry for each edge of the outline. { through: [x, z] } makes edge i an arc from point i through that point to the next point, and null keeps the edge straight. arcs.holes does the same for each hole.
- Give one entry for each edge, and do not repeat a point of the outline.
- The
throughpoint must not be on the straight line between the two ends of the edge. An arc must not cross another edge of the outline. - The slab is built with true curved faces. The plan draws each arc as one arc.
- The floor area of the storey counts each arc exactly.
- An edge profile runs along straight edges only. List its
edges, and leave out the arcs. - A ceiling takes straight edges only. A roof takes arcs when it is
FLATand itsoverhangis 0. - A section or an elevation draws a slab with arcs or rounded corners as true curves.
- A move or a turn of the slab moves the
throughpoints with the outline. The editors have no grip on an arc yet.
Round a corner
GivecornerRadii.outerRing (or cornerRadii.holes[i]) one entry for each corner of profile, in metres, and null for a sharp corner. Each rounded corner becomes a tangent arc, so the area, the plan, the 3D body and the IFC export follow the curve.
- Two corners at the ends of one edge can share it. On a 4 metre end, both at 2 metres make a half-round end.
- A radius that does not fit is refused with
corner-radius-too-big. The message names the corner and the largest radius that fits. - A corner beside an arc edge takes no radius.
set-corner-radius { list, elementId, ring: 'outer', corners: [2], radius: 1 }rounds in one undo step, andradius: nullmakes the corners sharp.- A dragged corner keeps its radius and shrinks to fit if it must.
- Flat roofs with an overhang of 0 take radii. Ceilings and slabs with an edge profile do not yet.
Edit in an editor
- The panel fields of a slab, floor or ceiling (role, thickness, elevation, material, colour, label) save in place as one undo step.
- A hole has a grip on each corner in the plan and 3D editors. A drag reshapes the hole in one undo step.
Move the slab
A slab that is in the model has a move command:Read the floor area
storeyFloorAreas measures each storey from its structural slabs: a slab with the role 'slab', or with no role. A 'floor' finish and a 'ceiling' never count. Each result names the slabs it summed in slabIds.
slabIds is ['ground-floor'].
- A storey with no slab that counts is measured inside the outer ring of its wall centre lines:
measuredFromis'walls'andslabIdsis empty. So a storey whose plate is saved as a'floor'reads the area of its walls, not of that plate. - A slab with the phase
'demolished'does not count. - A terrace or a deck saved as a
'slab'counts in the area of its storey. Give it the role'floor'when it must not. - For the area to the outer face of the walls, whatever the slab roles, use
buildingFootprint(Measure the footprint).
Next
Add a roof
Close the building at the top.
Slab API
See each option of a slab.