@mark1russell7/room-view 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +15 -1
  2. package/build/anchors-BEnxNnSV.d.ts +75 -0
  3. package/build/anchors-BEnxNnSV.d.ts.map +1 -0
  4. package/build/frames-BYMK5ZId.d.ts +39 -0
  5. package/build/frames-BYMK5ZId.d.ts.map +1 -0
  6. package/build/index.d.ts +7 -211
  7. package/build/index.d.ts.map +1 -1
  8. package/build/index.js +6 -613
  9. package/build/index.js.map +1 -1
  10. package/build/joins-2p01wnr_.d.ts +39 -0
  11. package/build/joins-2p01wnr_.d.ts.map +1 -0
  12. package/build/layers-CKx0dcM0.d.ts +143 -0
  13. package/build/layers-CKx0dcM0.d.ts.map +1 -0
  14. package/build/layers-bgJ3OTId.js +630 -0
  15. package/build/layers-bgJ3OTId.js.map +1 -0
  16. package/build/{level-Cu8vgrwN.js → level-5Nb9rq5L.js} +3 -28
  17. package/build/level-5Nb9rq5L.js.map +1 -0
  18. package/build/{loads-C3Nrj3Gd.d.ts → loads-CriZuwcu.d.ts} +4 -73
  19. package/build/loads-CriZuwcu.d.ts.map +1 -0
  20. package/build/loads-CtHa4EHo.js +103 -0
  21. package/build/loads-CtHa4EHo.js.map +1 -0
  22. package/build/marks.d.ts +29 -0
  23. package/build/marks.d.ts.map +1 -0
  24. package/build/marks.js +34 -0
  25. package/build/marks.js.map +1 -0
  26. package/build/room-DrXMmX_h.js +29 -0
  27. package/build/room-DrXMmX_h.js.map +1 -0
  28. package/build/schema.d.ts +6 -0
  29. package/build/schema.d.ts.map +1 -1
  30. package/build/schema.js +37 -2
  31. package/build/schema.js.map +1 -1
  32. package/build/{loads-Br73kIsQ.js → solids-BKb-izIP.js} +2 -102
  33. package/build/solids-BKb-izIP.js.map +1 -0
  34. package/build/three.d.ts +1 -1
  35. package/build/three.js +2 -1
  36. package/build/three.js.map +1 -1
  37. package/package.json +7 -1
  38. package/build/level-Cu8vgrwN.js.map +0 -1
  39. package/build/loads-Br73kIsQ.js.map +0 -1
  40. package/build/loads-C3Nrj3Gd.d.ts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"loads-Br73kIsQ.js","names":[],"sources":["../src/frames.ts","../src/joins.ts","../src/solids.ts","../src/loads.ts"],"sourcesContent":["import { rotationAbout, type Point, type Transform3 } from \"@mark1russell7/layout-contract\";\nimport type { Room, Wall } from \"./room.ts\";\nimport { lengthsInRange, metersPer } from \"./units.ts\";\n\n/**\n * The frame of a wall, in meters. A point of the wall has a distance along the line and a distance across it.\n * The distance across is positive to the left, for a person who looks from the start to the end.\n */\nexport interface WallFrame {\n /** The `id` of the wall. */\n readonly id: string;\n readonly start: Point;\n readonly end: Point;\n /** The unit vector from the start to the end. A wall with the length 0, or with a length that is not finite, has the vector (1, 0). */\n readonly along: Point;\n /** The unit vector to the left of `along`. */\n readonly left: Point;\n readonly length: number;\n readonly thickness: number;\n readonly height: number;\n /** The distance across of the left face. It is 0 or more. */\n readonly leftOffset: number;\n /** The distance across of the right face. It is 0 or less. */\n readonly rightOffset: number;\n}\n\n/** This function gives the frame of one wall. `scale` is the length of the unit of the room in meters. */\nfunction frameOf(room: Room, wall: Wall, scale: number): WallFrame {\n const start = { x: wall.from[0] * scale, y: wall.from[1] * scale };\n const end = { x: wall.to[0] * scale, y: wall.to[1] * scale };\n const length = Math.hypot(end.x - start.x, end.y - start.y);\n const along = length > 0 && Number.isFinite(length) ? { x: (end.x - start.x) / length, y: (end.y - start.y) / length } : { x: 1, y: 0 };\n const thickness = (wall.thickness ?? room.wallThickness) * scale;\n const side = wall.side ?? \"center\";\n const leftOffset = side === \"left\" ? thickness : side === \"right\" ? 0 : thickness / 2;\n return {\n id: wall.id,\n start,\n end,\n along,\n left: { x: 0 - along.y, y: along.x },\n length,\n thickness,\n height: (wall.height ?? room.height) * scale,\n leftOffset,\n rightOffset: leftOffset - thickness,\n };\n}\n\n/** This function gives the frame of each wall of a room, in the sequence of the walls. */\nexport function wallFrames(room: Room): readonly WallFrame[] {\n const scale = metersPer(room.unit);\n return room.walls.map((wall) => frameOf(room, wall, scale));\n}\n\n/**\n * This function tells if a wall has an outline in the plan. Its ends and its thickness must be lengths in the range of the model,\n * and its length and its thickness must be above 0. Only such a wall makes a corner, and the model makes only such a wall.\n */\nexport function wallHasOutline(frame: WallFrame): boolean {\n return lengthsInRange(frame.start.x, frame.start.y, frame.end.x, frame.end.y, frame.thickness) && frame.length > 0 && frame.thickness > 0;\n}\n\n/** This function gives the point of the plan at a distance along a wall and a distance across it, in meters. */\nexport function wallPoint(frame: WallFrame, along: number, across: number): Point {\n return {\n x: frame.start.x + frame.along.x * along + frame.left.x * across,\n y: frame.start.y + frame.along.y * along + frame.left.y * across,\n };\n}\n\n/**\n * This function gives the transform from the frame of a wall to the room.\n * In the frame of a wall, x is the distance along the wall and y is the distance across it. The height above the floor is z.\n */\nexport function wallTransform(frame: WallFrame): Transform3 {\n return {\n position: { x: frame.start.x, y: frame.start.y, z: 0 },\n rotation: rotationAbout({ x: 0, y: 0, z: 1 }, Math.atan2(frame.along.y, frame.along.x)),\n };\n}\n","import { clipRing, type Point, type Ring } from \"@mark1russell7/layout-contract\";\nimport { wallHasOutline, wallPoint, type WallFrame } from \"./frames.ts\";\n\n/** The outline of one wall in the plan, after its corners with the other walls. */\nexport interface WallFootprint {\n /** The `id` of the wall. */\n readonly wall: string;\n /** The outline in meters, counter-clockwise and convex. It is empty for a wall with no outline (`wallHasOutline`) and for a wall that its corners remove. */\n readonly ring: Ring;\n /**\n * The part of the wall that has its full thickness: two distances along the wall, in meters.\n * An opening must be in this part. A wall with no such part has the two distances 0.\n */\n readonly clear: readonly [number, number];\n}\n\n/** The options of the corners of the walls. */\nexport interface JoinOptions {\n /** Two ends of walls at this distance or less make one corner. The unit is the meter, and the default is 1e-6. A value that is not finite gives the default. */\n readonly tolerance?: number | undefined;\n /**\n * The limit of a sharp corner. The faces of two walls meet at a point. When that point is farther from the corner\n * than this number of thicknesses, the two walls get square ends. The default is 4. A value that is not finite gives the default.\n */\n readonly miterLimit?: number | undefined;\n}\n\n/** The default distance in meters at which two ends of walls make one corner. */\nexport const JOIN_TOLERANCE = 1e-6;\n\n/** The default limit of a sharp corner, in thicknesses. */\nexport const MITER_LIMIT = 4;\n\n/** Two unit vectors with a cross product below this value are parallel. */\nconst PARALLEL = 1e-9;\n\n/** A corner of an outline with a turn of this value or less is flat, so the outline does not need it. */\nconst FLAT = 1e-12;\n\n/** Two points at this distance or less are one point. A point at this distance or less from a face of a wall is on the face. */\nconst SAME = 1e-9;\n\n/**\n * One end of a wall, as a person at the end sees it who looks along the wall.\n * `high` and `low` are the distances of the two faces along `normal`, the unit vector to the left of `out`.\n */\ninterface End {\n readonly point: Point;\n readonly out: Point;\n readonly normal: Point;\n readonly high: number;\n readonly low: number;\n readonly thickness: number;\n /** The points of the two faces at this end. The corners of the walls replace the square points. */\n highPoint: Point;\n lowPoint: Point;\n /** This value tells if the end makes a corner with a different end. */\n joined: boolean;\n}\n\n/** This function gives an option, or its default when the option has no value or a value that is not finite. */\nfunction finiteOr(value: number | undefined, fallback: number): number {\n return value !== undefined && Number.isFinite(value) ? value : fallback;\n}\n\n/** This function gives the point at a distance across from the point of an end. */\nfunction across(end: End, distance: number): Point {\n return { x: end.point.x + end.normal.x * distance, y: end.point.y + end.normal.y * distance };\n}\n\n/** This function makes the two ends of a wall, with square points. */\nfunction endsOf(frame: WallFrame): readonly [End, End] {\n const back = { x: 0 - frame.along.x, y: 0 - frame.along.y };\n const right = { x: 0 - frame.left.x, y: 0 - frame.left.y };\n const make = (point: Point, out: Point, normal: Point, high: number, low: number): End => {\n const end: End = { point, out, normal, high, low, thickness: frame.thickness, highPoint: point, lowPoint: point, joined: false };\n end.highPoint = across(end, high);\n end.lowPoint = across(end, low);\n return end;\n };\n return [\n make(frame.start, frame.along, frame.left, frame.leftOffset, frame.rightOffset),\n make(frame.end, back, right, 0 - frame.rightOffset, 0 - frame.leftOffset),\n ];\n}\n\n/** This function gives the point where two lines meet, or `undefined` for parallel lines. Each line has a point and a unit direction. */\nfunction meet(p: Point, d: Point, q: Point, e: Point): Point | undefined {\n const cross = d.x * e.y - d.y * e.x;\n if (Math.abs(cross) < PARALLEL) return undefined;\n const t = ((q.x - p.x) * e.y - (q.y - p.y) * e.x) / cross;\n return { x: p.x + d.x * t, y: p.y + d.y * t };\n}\n\n/**\n * This function makes the corner of the ends at one point. The ends are in sequence counter-clockwise.\n * The left face of each end meets the right face of the next end.\n */\nfunction joinEnds(ends: readonly End[], miterLimit: number): void {\n if (ends.length < 2) return;\n for (let i = 0; i < ends.length; i++) {\n const end = ends[i]!;\n const next = ends[(i + 1) % ends.length]!;\n end.joined = true;\n const corner = meet(across(end, end.high), end.out, across(next, next.low), next.out);\n if (corner === undefined) continue;\n const reach = Math.hypot(corner.x - end.point.x, corner.y - end.point.y);\n if (reach > miterLimit * Math.max(end.thickness, next.thickness)) continue;\n end.highPoint = corner;\n next.lowPoint = corner;\n }\n}\n\n/** This function gives the part of a ring to the left of the line from `p` to `q`. Two points at one position give the full ring. */\nfunction leftOf(ring: Ring, p: Point, q: Point): Ring {\n const length = Math.hypot(q.x - p.x, q.y - p.y);\n if (length <= SAME) return ring;\n const dx = (q.x - p.x) / length;\n const dy = (q.y - p.y) / length;\n return clipRing(ring, dy, 0 - dx, dy * p.x - dx * p.y);\n}\n\n/**\n * This function cuts the outline of a wall at one end. An end with no corner gets a square cut.\n * An end with a corner keeps the part between the two lines from the point of the corner to the points of the two faces.\n */\nfunction cut(ring: Ring, end: End): Ring {\n if (!end.joined) return leftOf(ring, end.highPoint, end.lowPoint);\n return leftOf(leftOf(ring, end.highPoint, end.point), end.point, end.lowPoint);\n}\n\n/** This function removes each corner of a convex outline that is flat or that is a copy of the corner before it. Fewer than 3 corners give an empty outline. */\nfunction withoutFlat(points: Ring): Ring {\n const ring = [...points];\n let changed = true;\n while (changed && ring.length >= 3) {\n changed = false;\n for (let i = 0; i < ring.length && ring.length >= 3; i++) {\n const [ax, ay] = ring[(i + ring.length - 1) % ring.length]!;\n const [bx, by] = ring[i]!;\n const [cx, cy] = ring[(i + 1) % ring.length]!;\n if ((bx - ax) * (cy - by) - (by - ay) * (cx - bx) > FLAT) continue;\n ring.splice(i, 1);\n changed = true;\n i--;\n }\n }\n return ring.length >= 3 ? ring : [];\n}\n\n/** This function gives the range of the distances along a wall of the corners of an outline that are on one face. */\nfunction faceRange(frame: WallFrame, ring: Ring, offset: number): readonly [number, number] {\n let from = Infinity;\n let to = -Infinity;\n for (const [x, y] of ring) {\n const dx = x - frame.start.x;\n const dy = y - frame.start.y;\n if (Math.abs(dx * frame.left.x + dy * frame.left.y - offset) > SAME) continue;\n const along = dx * frame.along.x + dy * frame.along.y;\n from = Math.min(from, along);\n to = Math.max(to, along);\n }\n return [from, to];\n}\n\n/**\n * This function gives the outline of each wall in the plan, in the sequence of the frames.\n *\n * Two or more ends of walls at one point make a corner. At a corner, the faces of the walls that are adjacent meet at a point.\n * Each wall ends at the lines from the corner to those points. Thus two walls make a miter, and the walls of a corner do not overlap.\n * An end with no other end at its point is square. An end on the face of a different wall is also square: the two walls touch.\n * A wall with no outline (`wallHasOutline`) gets an empty outline, and it makes no corner.\n */\nexport function wallFootprints(frames: readonly WallFrame[], options: JoinOptions = {}): readonly WallFootprint[] {\n const tolerance = finiteOr(options.tolerance, JOIN_TOLERANCE);\n const miterLimit = Math.max(finiteOr(options.miterLimit, MITER_LIMIT), 0);\n const pairs = frames.map((frame) => (wallHasOutline(frame) ? endsOf(frame) : undefined));\n const corners: End[][] = [];\n for (const pair of pairs) {\n for (const end of pair ?? []) {\n const corner = corners.find((ends) => Math.hypot(ends[0]!.point.x - end.point.x, ends[0]!.point.y - end.point.y) <= tolerance);\n if (corner === undefined) corners.push([end]);\n else corner.push(end);\n }\n }\n for (const ends of corners) {\n ends.sort((a, b) => Math.atan2(a.out.y, a.out.x) - Math.atan2(b.out.y, b.out.x));\n joinEnds(ends, miterLimit);\n }\n const thickest = frames.reduce((most, frame, index) => (pairs[index] === undefined ? most : Math.max(most, frame.thickness)), 0);\n const reach = (miterLimit + 1) * thickest;\n return frames.map((frame, index): WallFootprint => {\n const pair = pairs[index];\n if (pair === undefined) return { wall: frame.id, ring: [], clear: [0, 0] };\n const strip = [\n wallPoint(frame, 0 - reach, frame.rightOffset),\n wallPoint(frame, frame.length + reach, frame.rightOffset),\n wallPoint(frame, frame.length + reach, frame.leftOffset),\n wallPoint(frame, 0 - reach, frame.leftOffset),\n ].map((point) => [point.x, point.y] as const);\n const ring = withoutFlat(cut(cut(strip, pair[0]), pair[1]));\n // A very large limit of a sharp corner can make numbers that are not finite. Such an outline is no outline.\n if (!ring.every(([x, y]) => Number.isFinite(x) && Number.isFinite(y))) return { wall: frame.id, ring: [], clear: [0, 0] };\n const leftFace = faceRange(frame, ring, frame.leftOffset);\n const rightFace = faceRange(frame, ring, frame.rightOffset);\n const from = Math.max(leftFace[0], rightFace[0]);\n const to = Math.min(leftFace[1], rightFace[1]);\n return { wall: frame.id, ring, clear: from < to ? [from, to] : [0, 0] };\n });\n}\n","import {\n boundsOf3,\n box3Corners,\n box3Volume,\n clipRing,\n composeTransforms3,\n regionArea,\n rotationAbout,\n transformPoint3,\n type Box3,\n type Point3,\n type Ring,\n type Transform3,\n} from \"@mark1russell7/layout-contract\";\nimport { wallFrames, wallHasOutline, wallTransform, type WallFrame } from \"./frames.ts\";\nimport { wallFootprints, type JoinOptions, type WallFootprint } from \"./joins.ts\";\nimport type { OpeningKind, PlacedObject, Room, Scene } from \"./room.ts\";\nimport { LARGEST_LENGTH, lengthsInRange, metersPer } from \"./units.ts\";\n\n/** These are the kinds of a solid. */\nexport const SOLID_KINDS: readonly [\"floor\", \"wall\", \"glass\", \"outlet\", \"object\"] = [\"floor\", \"wall\", \"glass\", \"outlet\", \"object\"];\n\n/** A kind of solid. */\nexport type SolidKind = (typeof SOLID_KINDS)[number];\n\n/** A prism: an outline in the plan, from the height `z` up by `d`. The unit is the meter. */\nexport interface Prism {\n readonly kind: \"prism\";\n readonly ring: Ring;\n readonly z: number;\n readonly d: number;\n}\n\n/** A placed box: a box in its own frame, and the transform from that frame to the room. The unit is the meter. */\nexport interface PlacedBox {\n readonly kind: \"box\";\n readonly box: Box3;\n readonly transform: Transform3;\n}\n\n/** The shape of a solid. */\nexport type SolidShape = Prism | PlacedBox;\n\n/**\n * A solid: one part of the 3D model of a room. The x and y axes are the axes of the plan, and the z axis points up.\n * The floor is at the height 0, and each length is in meters. Each number of a solid is finite, and its volume is above 0.\n */\nexport interface Solid {\n /** The name of the solid. Each solid of a model has a different name. */\n readonly id: string;\n readonly kind: SolidKind;\n /** The `id` of the record that the solid comes from: a wall, a floor, an opening, an outlet or a placed object. */\n readonly source: string;\n readonly shape: SolidShape;\n}\n\n/** The options of the model of a room. */\nexport interface SolidOptions {\n /** The depth of the floor below the height 0, in meters. The walls go down by the same depth. The default is 0.1. A value that is not finite gives the default. */\n readonly floorDepth?: number | undefined;\n /** The options of the corners of the walls. */\n readonly joins?: JoinOptions | undefined;\n}\n\n/** The default depth of the floor, in meters. */\nexport const FLOOR_DEPTH = 0.1;\n\n/** The thickness of the glass of a window, in meters. */\nexport const GLASS_THICKNESS = 0.02;\n\n/** The size of the plate of an outlet, in meters. The plate of a duplex outlet in North America is 70 mm by 115 mm. */\nexport const OUTLET_PLATE: { readonly width: number; readonly height: number; readonly depth: number } = { width: 0.07, height: 0.115, depth: 0.012 };\n\n/**\n * The transform from the room, where the z axis points up, to a space where the y axis points up.\n * The glTF format and three.js have the y axis up. The x axis stays, and the y axis of the plan becomes the negative z axis.\n */\nexport const TO_Y_UP: Transform3 = { position: { x: 0, y: 0, z: 0 }, rotation: { x: -Math.SQRT1_2, y: 0, z: 0, w: Math.SQRT1_2 } };\n\n/** A length in meters at this value or less is empty: the model does not make a part of this size. */\nconst EMPTY = 1e-9;\n\n/** An area in square meters at this value or less is empty. */\nconst EMPTY_AREA = 1e-12;\n\n/** This function gives an outline, or an empty ring when the outline has no area or a number that is not finite. */\nfunction solidRing(ring: Ring): Ring {\n if (ring.length < 3 || !ring.every(([x, y]) => Number.isFinite(x) && Number.isFinite(y))) return [];\n return regionArea({ kind: \"polygon\", points: ring }) > EMPTY_AREA ? ring : [];\n}\n\n/** This function tells if the model makes a wall. Such a wall has an outline in the plan, and its height is above 0 and in the range of the model. */\nfunction isMade(frame: WallFrame): boolean {\n return wallHasOutline(frame) && frame.height > 0 && lengthsInRange(frame.height);\n}\n\n/** An opening of a wall, in meters, in the frame of the wall. */\ninterface Hole {\n readonly id: string;\n readonly kind: OpeningKind;\n readonly from: number;\n readonly to: number;\n readonly sill: number;\n readonly top: number;\n}\n\n/**\n * This function gives the openings of one wall that the model can make, in sequence along the wall.\n * It skips an opening with no size and an opening out of the straight part of the wall. It also skips an opening that overlaps the opening before it.\n */\nfunction holesOf(room: Room, frame: WallFrame, footprint: WallFootprint, scale: number): readonly Hole[] {\n const [clearFrom, clearTo] = footprint.clear;\n const holes = (room.openings ?? [])\n .filter((opening) => opening.wall === frame.id)\n .map((opening): Hole => {\n const sill = (opening.sill ?? 0) * scale;\n return {\n id: opening.id,\n kind: opening.kind,\n from: opening.offset * scale,\n to: (opening.offset + opening.width) * scale,\n sill,\n top: Math.min(sill + opening.height * scale, frame.height),\n };\n })\n .filter((hole) => hole.to - hole.from > EMPTY && hole.sill >= 0 && hole.top - hole.sill > EMPTY && hole.from >= clearFrom - EMPTY && hole.to <= clearTo + EMPTY)\n .sort((a, b) => a.from - b.from);\n const kept: Hole[] = [];\n let cursor = -Infinity;\n for (const hole of holes) {\n if (hole.from < cursor - EMPTY) continue;\n kept.push(hole);\n cursor = hole.to;\n }\n return kept;\n}\n\n/** This function removes each corner of a ring that is at the position of the corner before it. */\nfunction withoutRepeats(ring: Ring): Ring {\n return ring.filter(([x, y], index) => {\n const [px, py] = ring[(index + ring.length - 1) % ring.length]!;\n return ring.length === 1 || Math.hypot(x - px, y - py) > EMPTY;\n });\n}\n\n/** This function gives the part of the outline of a wall between two distances along the wall. An empty part gives an empty ring. */\nfunction slice(frame: WallFrame, ring: Ring, from: number, to: number): Ring {\n const base = frame.start.x * frame.along.x + frame.start.y * frame.along.y;\n let part = ring;\n if (Number.isFinite(from)) part = clipRing(part, 0 - frame.along.x, 0 - frame.along.y, 0 - (base + from));\n if (Number.isFinite(to)) part = clipRing(part, frame.along.x, frame.along.y, base + to);\n return solidRing(withoutRepeats(part));\n}\n\n/** This function gives the solids of one wall: the parts between, below and above its openings, and the glass of each window. */\nfunction wallSolids(room: Room, frame: WallFrame, footprint: WallFootprint, scale: number, depth: number): readonly Solid[] {\n if (footprint.ring.length < 3 || !isMade(frame)) return [];\n const walls: Solid[] = [];\n const glass: Solid[] = [];\n const add = (ring: Ring, z: number, top: number): void => {\n if (ring.length < 3 || top - z <= EMPTY) return;\n walls.push({ id: `wall:${frame.id}:${String(walls.length)}`, kind: \"wall\", source: frame.id, shape: { kind: \"prism\", ring, z, d: top - z } });\n };\n let cursor = -Infinity;\n for (const hole of holesOf(room, frame, footprint, scale)) {\n add(slice(frame, footprint.ring, cursor, hole.from), 0 - depth, frame.height);\n const part = slice(frame, footprint.ring, hole.from, hole.to);\n add(part, 0 - depth, hole.sill);\n add(part, hole.top, frame.height);\n cursor = hole.to;\n if (hole.kind !== \"window\") continue;\n glass.push({\n id: `glass:${hole.id}`,\n kind: \"glass\",\n source: hole.id,\n shape: {\n kind: \"box\",\n box: {\n x: hole.from,\n y: (frame.leftOffset + frame.rightOffset - GLASS_THICKNESS) / 2,\n z: hole.sill,\n w: hole.to - hole.from,\n h: GLASS_THICKNESS,\n d: hole.top - hole.sill,\n },\n transform: wallTransform(frame),\n },\n });\n }\n add(slice(frame, footprint.ring, cursor, Infinity), 0 - depth, frame.height);\n return [...walls, ...glass];\n}\n\n/**\n * This function gives the 3D model of a room as a list of solids.\n * The solids are the floors, the walls with their openings, the glass of the windows and the outlets.\n *\n * The function does not stop for a record with a fault. It skips each part that it cannot make.\n * One example is a wall with no length. A second example is an opening on a wall that the room does not have.\n * A third example is a part with a number that is not finite or not in the range of the model (`LARGEST_LENGTH`). `checkRoom` tells each fault.\n */\nexport function roomSolids(room: Room, options: SolidOptions = {}): readonly Solid[] {\n const scale = metersPer(room.unit);\n const given = options.floorDepth ?? FLOOR_DEPTH;\n const depth = Number.isFinite(given) ? Math.min(Math.max(given, 0), LARGEST_LENGTH) : FLOOR_DEPTH;\n const frames = wallFrames(room);\n const footprints = wallFootprints(frames, options.joins);\n const solids: Solid[] = [];\n for (const floor of room.floors ?? []) {\n const ring = solidRing(floor.ring.map(([x, y]) => [x * scale, y * scale] as const));\n if (ring.length < 3 || depth <= EMPTY || !ring.every(([x, y]) => lengthsInRange(x, y))) continue;\n solids.push({ id: `floor:${floor.id}`, kind: \"floor\", source: floor.id, shape: { kind: \"prism\", ring, z: 0 - depth, d: depth } });\n }\n frames.forEach((frame, index) => {\n solids.push(...wallSolids(room, frame, footprints[index]!, scale, depth));\n });\n const byId = new Map(frames.map((frame) => [frame.id, frame] as const));\n for (const outlet of room.outlets ?? []) {\n const frame = byId.get(outlet.wall);\n if (frame === undefined || !isMade(frame)) continue;\n const along = outlet.offset * scale;\n const height = outlet.height * scale;\n if (!lengthsInRange(along, height)) continue;\n solids.push({\n id: `outlet:${outlet.id}`,\n kind: \"outlet\",\n source: outlet.id,\n shape: {\n kind: \"box\",\n box: {\n x: along - OUTLET_PLATE.width / 2,\n y: outlet.face === \"left\" ? frame.leftOffset : frame.rightOffset - OUTLET_PLATE.depth,\n z: height - OUTLET_PLATE.height / 2,\n w: OUTLET_PLATE.width,\n h: OUTLET_PLATE.depth,\n d: OUTLET_PLATE.height,\n },\n transform: wallTransform(frame),\n },\n });\n }\n return solids;\n}\n\n/**\n * This function gives the transform of each placed object of a scene, from the frame of the object to the room, in meters.\n * The origin of the frame of an object is the center of its bottom. An object with a parent gets the transform of the parent first.\n * An object has no transform when a parent is not in the scene, or when its parents make a loop.\n * An object also has no transform when one value of its place is not finite or not in the range of the model.\n */\nexport function objectTransforms(scene: Scene): ReadonlyMap<string, Transform3> {\n const scale = metersPer(scene.room.unit);\n const objects = new Map((scene.objects ?? []).map((object) => [object.id, object] as const));\n const done = new Map<string, Transform3>();\n const open = new Set<string>();\n const resolve = (object: PlacedObject): Transform3 | undefined => {\n const known = done.get(object.id);\n if (known !== undefined) return known;\n if (open.has(object.id)) return undefined;\n const turn = object.turn ?? 0;\n const position = { x: object.at[0] * scale, y: object.at[1] * scale, z: (object.lift ?? 0) * scale };\n if (!Number.isFinite(turn) || !lengthsInRange(position.x, position.y, position.z)) return undefined;\n // The remainder is exact. Thus a very large turn does not make an angle that is not finite.\n const local: Transform3 = { position, rotation: rotationAbout({ x: 0, y: 0, z: 1 }, ((turn % 360) * Math.PI) / 180) };\n let world: Transform3 | undefined = local;\n if (object.parent !== undefined) {\n open.add(object.id);\n const parent = objects.get(object.parent);\n const outer = parent === undefined ? undefined : resolve(parent);\n world = outer === undefined ? undefined : composeTransforms3(outer, local);\n open.delete(object.id);\n }\n if (world !== undefined) done.set(object.id, world);\n return world;\n };\n for (const object of scene.objects ?? []) resolve(object);\n return done;\n}\n\n/**\n * This function gives the 3D model of a scene: the solids of its room, then one box for each placed object.\n * It skips an object that has no transform, no size, or a size that is not in the range of the model. `checkScene` tells each fault.\n */\nexport function sceneSolids(scene: Scene, options: SolidOptions = {}): readonly Solid[] {\n const scale = metersPer(scene.room.unit);\n const transforms = objectTransforms(scene);\n const solids: Solid[] = [...roomSolids(scene.room, options)];\n for (const object of scene.objects ?? []) {\n const transform = transforms.get(object.id);\n const w = object.size[0] * scale;\n const h = object.size[1] * scale;\n const d = object.size[2] * scale;\n if (transform === undefined || ![w, h, d].every((size) => size > EMPTY && size <= LARGEST_LENGTH)) continue;\n solids.push({\n id: `object:${object.id}`,\n kind: \"object\",\n source: object.id,\n shape: { kind: \"box\", box: { x: 0 - w / 2, y: 0 - h / 2, z: 0, w, h, d }, transform },\n });\n }\n return solids;\n}\n\n/** This function gives the corners of a solid in the room. A box has 8, and a prism has 2 for each corner of its outline. */\nexport function solidCorners(solid: Solid): readonly Point3[] {\n const shape = solid.shape;\n if (shape.kind === \"box\") return box3Corners(shape.box).map((corner) => transformPoint3(shape.transform, corner));\n return shape.ring.flatMap(([x, y]) => [\n { x, y, z: shape.z },\n { x, y, z: shape.z + shape.d },\n ]);\n}\n\n/** This function gives the smallest box along the axes that holds each solid, or `undefined` for no solids. */\nexport function boundsOfSolids(solids: readonly Solid[]): Box3 | undefined {\n return boundsOf3(solids.flatMap((solid) => solidCorners(solid)));\n}\n\n/** This function gives the volume of a solid in cubic meters. */\nexport function solidVolume(solid: Solid): number {\n const shape = solid.shape;\n return shape.kind === \"box\" ? box3Volume(shape.box) : regionArea({ kind: \"polygon\", points: shape.ring }) * shape.d;\n}\n","import type { Ring } from \"@mark1russell7/layout-contract\";\nimport type { Scene } from \"./room.ts\";\n\n/** These are the levels of the load of a circuit. */\nexport const LOAD_LEVELS: readonly [\"unknown\", \"ok\", \"near\", \"over\"] = [\"unknown\", \"ok\", \"near\", \"over\"];\n\n/** A level of the load of a circuit. A viewer gives each level a color. */\nexport type LoadLevel = (typeof LOAD_LEVELS)[number];\n\n/** The state of one circuit of a scene. */\nexport interface CircuitState {\n /** The `id` of the circuit. */\n readonly circuit: string;\n /** The sum of the loads of the circuit, in watts. */\n readonly watts: number;\n /** The limit of the circuit, in watts. */\n readonly limit: number;\n /** The load as a part of the limit. It is 0 for a limit that is not above 0. */\n readonly ratio: number;\n readonly level: LoadLevel;\n /** The `id` of each outlet of the circuit. */\n readonly outlets: readonly string[];\n /** The `id` of each placed object with an outlet of the circuit. */\n readonly objects: readonly string[];\n}\n\n/** The options of the levels. */\nexport interface LoadOptions {\n /** A circuit with this part of its limit, or more, has the level `near`. The default is 0.8. */\n readonly near?: number | undefined;\n}\n\n/** The default part of the limit at which a circuit has the level `near`. */\nexport const NEAR_LIMIT = 0.8;\n\n/**\n * This function gives the state of each circuit of a scene, in the sequence of the circuits.\n *\n * The loads are input data: a calculation or a meter gives them. A circuit that no load record names has the level `unknown`,\n * and so has a circuit with a limit that is not above 0. A load above the limit has the level `over`.\n */\nexport function circuitStates(scene: Scene, options: LoadOptions = {}): readonly CircuitState[] {\n const near = options.near ?? NEAR_LIMIT;\n const outlets = scene.room.outlets ?? [];\n return (scene.room.circuits ?? []).map((circuit): CircuitState => {\n const loads = (scene.loads ?? []).filter((load) => load.circuit === circuit.id);\n const watts = loads.reduce((sum, load) => sum + load.watts, 0);\n const known = loads.length > 0 && circuit.limit > 0 && Number.isFinite(watts);\n const ratio = known ? watts / circuit.limit : 0;\n const mine = outlets.filter((outlet) => outlet.circuit === circuit.id).map((outlet) => outlet.id);\n return {\n circuit: circuit.id,\n watts,\n limit: circuit.limit,\n ratio,\n level: !known ? \"unknown\" : ratio > 1 ? \"over\" : ratio >= near ? \"near\" : \"ok\",\n outlets: mine,\n objects: (scene.objects ?? []).filter((object) => object.outlet !== undefined && mine.includes(object.outlet)).map((object) => object.id),\n };\n });\n}\n\n/**\n * This function gives the level of each outlet of a scene: the level of its circuit. The key is the `id` of the outlet.\n * An outlet with no circuit of the room has no level, and the map does not have it.\n */\nexport function outletLevels(scene: Scene, options: LoadOptions = {}): ReadonlyMap<string, LoadLevel> {\n const levels = new Map<string, LoadLevel>();\n for (const state of circuitStates(scene, options)) {\n for (const outlet of state.outlets) levels.set(outlet, state.level);\n }\n return levels;\n}\n\n/** These are the shapes of the sign of a level. */\nexport const LEVEL_SHAPES: readonly [\"ring\", \"disc\", \"triangle\", \"square\"] = [\"ring\", \"disc\", \"triangle\", \"square\"];\n\n/** A shape of the sign of a level. A person who does not see a color reads the level from the shape. */\nexport type LevelShape = (typeof LEVEL_SHAPES)[number];\n\n/**\n * This function gives the shape of the sign of a level: a disc for `ok`, a triangle for `near` and a square for `over`.\n * The level `unknown` has a ring, and so has an outlet with no level.\n */\nexport function levelShape(level: LoadLevel | undefined): LevelShape {\n return level === \"ok\" ? \"disc\" : level === \"near\" ? \"triangle\" : level === \"over\" ? \"square\" : \"ring\";\n}\n\n/** The outline of the sign of a shape, as a regular polygon. A circle is a polygon with 40 sides. */\nexport interface ShapeOutline {\n /** The radius of the circle through the corners, for a disc with the radius 1. */\n readonly radius: number;\n /** The number of the sides. */\n readonly sides: number;\n /** The angle of the first corner, in radians, counter-clockwise from the x axis. */\n readonly start: number;\n /** The radius of the hole of the sign, for a disc with the radius 1. A sign with no hole has 0. */\n readonly hole: number;\n}\n\n/**\n * The outline of the sign of each shape. Each viewer draws the signs from these values, so each viewer shows the same signs.\n * A triangle and a square with the radius of the disc look small, so they are larger.\n */\nexport const SHAPE_OUTLINES: Readonly<Record<LevelShape, ShapeOutline>> = {\n ring: { radius: 1, sides: 40, start: 0, hole: 0.52 },\n disc: { radius: 1, sides: 40, start: 0, hole: 0 },\n triangle: { radius: 1.3, sides: 3, start: Math.PI / 2, hole: 0 },\n square: { radius: 1.25, sides: 4, start: Math.PI / 4, hole: 0 },\n};\n\n/**\n * This function gives the corners of the outline of a sign, counter-clockwise, with the y axis up.\n * The center of the sign is the origin, and `radius` is the radius of a disc.\n */\nexport function shapeRing(shape: LevelShape, radius: number = 1): Ring {\n const outline = SHAPE_OUTLINES[shape];\n return Array.from({ length: outline.sides }, (_, index): readonly [number, number] => {\n const angle = outline.start + (index * 2 * Math.PI) / outline.sides;\n return [radius * outline.radius * Math.cos(angle), radius * outline.radius * Math.sin(angle)];\n });\n}\n"],"mappings":";;;;AA2BA,SAAS,QAAQ,MAAY,MAAY,OAA0B;CACjE,MAAM,QAAQ;EAAE,GAAG,KAAK,KAAK,KAAK;EAAO,GAAG,KAAK,KAAK,KAAK;CAAM;CACjE,MAAM,MAAM;EAAE,GAAG,KAAK,GAAG,KAAK;EAAO,GAAG,KAAK,GAAG,KAAK;CAAM;CAC3D,MAAM,SAAS,KAAK,MAAM,IAAI,IAAI,MAAM,GAAG,IAAI,IAAI,MAAM,CAAC;CAC1D,MAAM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