@mark1russell7/room-view 0.2.2 → 0.2.4

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 (51) hide show
  1. package/README.md +20 -2
  2. package/build/{anchors-J6mcUeJn.js → anchors-Ba3OUmhF.js} +57 -3
  3. package/build/anchors-Ba3OUmhF.js.map +1 -0
  4. package/build/index.d.ts +22 -11
  5. package/build/index.d.ts.map +1 -1
  6. package/build/index.js +17 -16
  7. package/build/index.js.map +1 -1
  8. package/build/layers-B5nL_lVW.js +247 -0
  9. package/build/layers-B5nL_lVW.js.map +1 -0
  10. package/build/layers-BO_MMtQJ.d.ts +294 -0
  11. package/build/layers-BO_MMtQJ.d.ts.map +1 -0
  12. package/build/{level-5Nb9rq5L.js → level-CXCIX08K.js} +125 -22
  13. package/build/level-CXCIX08K.js.map +1 -0
  14. package/build/{level-Bmz-H5iH.d.ts → level-Cjcf3u20.d.ts} +89 -6
  15. package/build/level-Cjcf3u20.d.ts.map +1 -0
  16. package/build/{loads-Bp8aH2HJ.d.ts → loads-Diy6-Ekz.d.ts} +2 -2
  17. package/build/{loads-Bp8aH2HJ.d.ts.map → loads-Diy6-Ekz.d.ts.map} +1 -1
  18. package/build/marks.d.ts +2 -3
  19. package/build/marks.d.ts.map +1 -1
  20. package/build/marks.js +2 -2
  21. package/build/sample.d.ts +2 -2
  22. package/build/schema.d.ts +3 -3
  23. package/build/schema.d.ts.map +1 -1
  24. package/build/schema.js +9 -6
  25. package/build/schema.js.map +1 -1
  26. package/build/solids-S_j17vFJ.d.ts +313 -0
  27. package/build/solids-S_j17vFJ.d.ts.map +1 -0
  28. package/build/three.d.ts +2 -3
  29. package/build/three.d.ts.map +1 -1
  30. package/build/three.js +1 -2
  31. package/build/three.js.map +1 -1
  32. package/package.json +1 -1
  33. package/build/anchors-BEnxNnSV.d.ts +0 -75
  34. package/build/anchors-BEnxNnSV.d.ts.map +0 -1
  35. package/build/anchors-J6mcUeJn.js.map +0 -1
  36. package/build/frames-BYMK5ZId.d.ts +0 -39
  37. package/build/frames-BYMK5ZId.d.ts.map +0 -1
  38. package/build/layers-CtgTEnmt.js +0 -90
  39. package/build/layers-CtgTEnmt.js.map +0 -1
  40. package/build/layers-D_HqUjYu.d.ts +0 -148
  41. package/build/layers-D_HqUjYu.d.ts.map +0 -1
  42. package/build/level-5Nb9rq5L.js.map +0 -1
  43. package/build/level-Bmz-H5iH.d.ts.map +0 -1
  44. package/build/room-DrXMmX_h.js +0 -29
  45. package/build/room-DrXMmX_h.js.map +0 -1
  46. package/build/room-NREa6vXr.d.ts +0 -163
  47. package/build/room-NREa6vXr.d.ts.map +0 -1
  48. package/build/solids-BHLnvDVu.d.ts +0 -120
  49. package/build/solids-BHLnvDVu.d.ts.map +0 -1
  50. package/build/units-BZmvVyu4.js +0 -30
  51. package/build/units-BZmvVyu4.js.map +0 -1
@@ -0,0 +1,313 @@
1
+ import { Box3, Point, Point3, Ring, Transform3 } from "@mark1russell7/layout-contract";
2
+ /** These are the units of length that a room record can use. */
3
+ declare const LENGTH_UNITS: readonly ["m", "cm", "mm", "ft", "in"];
4
+ /** A unit of length of a room record. */
5
+ type LengthUnit = (typeof LENGTH_UNITS)[number];
6
+ /** This function gives the length of one unit in meters. The factor comes from `@mark1russell7/quantity`. */
7
+ declare function metersPer(unit: LengthUnit): number;
8
+ /** This function gives the length of one unit in a different unit. For example, one foot is 12 inches. */
9
+ declare function unitsPer(unit: LengthUnit, other: LengthUnit): number;
10
+ /**
11
+ * The largest length in meters that the model can use: 1 000 km. A larger number in a room record is a mistake.
12
+ * With this limit, each calculation of the model gives a finite number.
13
+ */
14
+ declare const LARGEST_LENGTH = 1e6;
15
+ /** This function tells if the model can use each value as a length. Such a value is a finite number of meters, with a size of `LARGEST_LENGTH` or less. */
16
+ declare function lengthsInRange(...meters: readonly number[]): boolean;
17
+ /** A point of the plan: `[x, y]`. The plan is the view from above, and the z axis points up. */
18
+ type PlanPoint = readonly [number, number];
19
+ /** The name of the format of a room record. */
20
+ declare const ROOM_SCHEMA = "room/1";
21
+ /** The name of the format of a scene record. */
22
+ declare const SCENE_SCHEMA = "scene/1";
23
+ /**
24
+ * This function tells if a text is the name of a layer: a word, a slash and a version, for example `electrical/1`.
25
+ * The word has lowercase letters, digits and hyphens. Thus a layer name has no colon, and `recordName` gives each record one name.
26
+ */
27
+ declare function isLayerName(text: string): boolean;
28
+ /** These are the sides of the line of a wall that can have the wall. */
29
+ declare const WALL_SIDES: readonly ["center", "left", "right"];
30
+ /**
31
+ * The side of the line of a wall that has the wall, for a person who looks from `from` to `to`.
32
+ * With `center`, the line is the middle of the wall. With `left` or `right`, the line is one face of the wall.
33
+ */
34
+ type WallSide = (typeof WALL_SIDES)[number];
35
+ /** These are the faces of a wall, for a person who looks from `from` to `to`. */
36
+ declare const WALL_FACES: readonly ["left", "right"];
37
+ /** A face of a wall. */
38
+ type WallFace = (typeof WALL_FACES)[number];
39
+ /**
40
+ * A wall: a straight line in the plan, with a thickness and a height.
41
+ * A tape measure gives the faces of a wall, so `side` lets the line be a face. Two walls with a common end make a corner.
42
+ */
43
+ interface Wall {
44
+ readonly id: string;
45
+ readonly from: PlanPoint;
46
+ readonly to: PlanPoint;
47
+ /** The thickness of the wall. The default is `wallThickness` of the room. */
48
+ readonly thickness?: number | undefined;
49
+ /** The height of the wall. The default is `height` of the room. */
50
+ readonly height?: number | undefined;
51
+ /** The side of the line that has the wall. The default is `center`. */
52
+ readonly side?: WallSide | undefined;
53
+ }
54
+ /** These are the kinds of an opening. A window has glass. A door and a gap are empty. */
55
+ declare const OPENING_KINDS: readonly ["door", "window", "gap"];
56
+ /** A kind of opening. */
57
+ type OpeningKind = (typeof OPENING_KINDS)[number];
58
+ /** An opening: a hole through a wall. */
59
+ interface Opening {
60
+ readonly id: string;
61
+ /** The `id` of the wall. */
62
+ readonly wall: string;
63
+ readonly kind: OpeningKind;
64
+ /** The distance along the line of the wall, from `from` to the near edge of the opening. */
65
+ readonly offset: number;
66
+ readonly width: number;
67
+ /** The height of the bottom of the opening above the floor. The default is 0. */
68
+ readonly sill?: number | undefined;
69
+ readonly height: number;
70
+ }
71
+ /** A floor: one area of the plan, for example one room of an apartment. The ring is the line where the floor touches the walls. */
72
+ interface Floor {
73
+ readonly id: string;
74
+ readonly name?: string | undefined;
75
+ readonly ring: Ring;
76
+ }
77
+ /** An outlet: a point on a face of a wall. */
78
+ interface Outlet {
79
+ readonly id: string;
80
+ /** The `id` of the wall. */
81
+ readonly wall: string;
82
+ /** The face of the wall that has the outlet. */
83
+ readonly face: WallFace;
84
+ /** The distance along the line of the wall, from `from` to the center of the outlet. */
85
+ readonly offset: number;
86
+ /** The height of the center of the outlet above the floor. */
87
+ readonly height: number;
88
+ /** The `id` of the circuit of the outlet. */
89
+ readonly circuit?: string | undefined;
90
+ }
91
+ /** A circuit: it gives power to outlets, and it has a limit. */
92
+ interface Circuit {
93
+ readonly id: string;
94
+ readonly name?: string | undefined;
95
+ /** The rating of the breaker of the circuit, in amperes, for example 15. The record keeps it as a fact. The limit does not change with it. */
96
+ readonly breaker?: number | undefined;
97
+ /** The voltage of the circuit, in volts, for example 120. The record keeps it as a fact. The limit does not change with it. */
98
+ readonly voltage?: number | undefined;
99
+ /**
100
+ * The largest continuous load, in watts.
101
+ * For example, a breaker of 15 A at 120 V carries 1800 W, and 80% of that for a continuous load is 1440 W.
102
+ */
103
+ readonly limit: number;
104
+ }
105
+ /** A room: the walls, the openings, the floors, the outlets and the circuits of one room or one apartment. */
106
+ interface Room {
107
+ readonly schema: typeof ROOM_SCHEMA;
108
+ readonly name?: string | undefined;
109
+ /** The unit of each length of the record. */
110
+ readonly unit: LengthUnit;
111
+ /** The height of each wall that has no height of its own. */
112
+ readonly height: number;
113
+ /** The thickness of each wall that has no thickness of its own. */
114
+ readonly wallThickness: number;
115
+ readonly walls: readonly Wall[];
116
+ readonly openings?: readonly Opening[] | undefined;
117
+ readonly floors?: readonly Floor[] | undefined;
118
+ readonly outlets?: readonly Outlet[] | undefined;
119
+ readonly circuits?: readonly Circuit[] | undefined;
120
+ }
121
+ /**
122
+ * A placed object: a box in the room, for example a desk, a rack or a computer.
123
+ * With a `parent`, the position and the turn are relative to that object, whose origin is the center of its bottom.
124
+ */
125
+ interface PlacedObject {
126
+ readonly id: string;
127
+ /** The class of the object, for example `desk`, `rack` or `computer`. A viewer gives each class a color. */
128
+ readonly kind: string;
129
+ readonly name?: string | undefined;
130
+ /** The size before the turn: along x, along y, and the height. */
131
+ readonly size: readonly [number, number, number];
132
+ /** The point of the plan below the center of the object. */
133
+ readonly at: PlanPoint;
134
+ /** The height of the bottom of the object above the floor, or above the bottom of its parent. The default is 0. */
135
+ readonly lift?: number | undefined;
136
+ /** The turn about the vertical axis in degrees, counter-clockwise from above. The default is 0. */
137
+ readonly turn?: number | undefined;
138
+ /** The `id` of the object that holds this object. */
139
+ readonly parent?: string | undefined;
140
+ /** The `id` of the outlet that gives power to the object. */
141
+ readonly outlet?: string | undefined;
142
+ }
143
+ /** A load on a circuit, in watts. A circuit can have many loads: their sum is the load of the circuit. */
144
+ interface CircuitLoad {
145
+ /** The `id` of the circuit. */
146
+ readonly circuit: string;
147
+ readonly watts: number;
148
+ }
149
+ /** A scene: one room with its placed objects and the loads of its circuits. Two scenes of one room can be compared. */
150
+ interface Scene {
151
+ readonly schema: typeof SCENE_SCHEMA;
152
+ readonly name?: string | undefined;
153
+ readonly room: Room;
154
+ readonly objects?: readonly PlacedObject[] | undefined;
155
+ readonly loads?: readonly CircuitLoad[] | undefined;
156
+ /**
157
+ * The records of each add-on, by the name of its layer, for example `electrical/1`. `isLayerName` tells the form of a name.
158
+ * The core keeps each layer and does not read it. `checkLayers` examines the layers with a list of add-ons.
159
+ */
160
+ readonly layers?: Readonly<Record<string, unknown>> | undefined;
161
+ }
162
+ /**
163
+ * The frame of a wall, in meters. A point of the wall has a distance along the line and a distance across it.
164
+ * The distance across is positive to the left, for a person who looks from the start to the end.
165
+ */
166
+ interface WallFrame {
167
+ /** The `id` of the wall. */
168
+ readonly id: string;
169
+ readonly start: Point;
170
+ readonly end: Point;
171
+ /** 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). */
172
+ readonly along: Point;
173
+ /** The unit vector to the left of `along`. */
174
+ readonly left: Point;
175
+ readonly length: number;
176
+ readonly thickness: number;
177
+ readonly height: number;
178
+ /** The distance across of the left face. It is 0 or more. */
179
+ readonly leftOffset: number;
180
+ /** The distance across of the right face. It is 0 or less. */
181
+ readonly rightOffset: number;
182
+ }
183
+ /** This function gives the frame of each wall of a room, in the sequence of the walls. */
184
+ declare function wallFrames(room: Room): readonly WallFrame[];
185
+ /**
186
+ * 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,
187
+ * 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.
188
+ */
189
+ declare function wallHasOutline(frame: WallFrame): boolean;
190
+ /** This function gives the point of the plan at a distance along a wall and a distance across it, in meters. */
191
+ declare function wallPoint(frame: WallFrame, along: number, across: number): Point;
192
+ /**
193
+ * This function gives the transform from the frame of a wall to the room.
194
+ * 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.
195
+ */
196
+ declare function wallTransform(frame: WallFrame): Transform3;
197
+ /** The outline of one wall in the plan, after its corners with the other walls. */
198
+ interface WallFootprint {
199
+ /** The `id` of the wall. */
200
+ readonly wall: string;
201
+ /** 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. */
202
+ readonly ring: Ring;
203
+ /**
204
+ * The part of the wall that has its full thickness: two distances along the wall, in meters.
205
+ * An opening must be in this part. A wall with no such part has the two distances 0.
206
+ */
207
+ readonly clear: readonly [number, number];
208
+ }
209
+ /** The options of the corners of the walls. */
210
+ interface JoinOptions {
211
+ /** 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. */
212
+ readonly tolerance?: number | undefined;
213
+ /**
214
+ * The limit of a sharp corner. The faces of two walls meet at a point. When that point is farther from the corner
215
+ * than this number of thicknesses, the two walls get square ends. The default is 4. A value that is not finite gives the default.
216
+ */
217
+ readonly miterLimit?: number | undefined;
218
+ }
219
+ /** The default distance in meters at which two ends of walls make one corner. */
220
+ declare const JOIN_TOLERANCE = 1e-6;
221
+ /** The default limit of a sharp corner, in thicknesses. */
222
+ declare const MITER_LIMIT = 4;
223
+ /**
224
+ * This function gives the outline of each wall in the plan, in the sequence of the frames.
225
+ *
226
+ * 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.
227
+ * 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.
228
+ * 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.
229
+ * A wall with no outline (`wallHasOutline`) gets an empty outline, and it makes no corner.
230
+ */
231
+ declare function wallFootprints(frames: readonly WallFrame[], options?: JoinOptions): readonly WallFootprint[];
232
+ /** These are the kinds of a solid. */
233
+ declare const SOLID_KINDS: readonly ["floor", "wall", "glass", "outlet", "object"];
234
+ /** A kind of solid. */
235
+ type SolidKind = (typeof SOLID_KINDS)[number];
236
+ /** A prism: an outline in the plan, from the height `z` up by `d`. The unit is the meter. */
237
+ interface Prism {
238
+ readonly kind: "prism";
239
+ readonly ring: Ring;
240
+ readonly z: number;
241
+ readonly d: number;
242
+ }
243
+ /** A placed box: a box in its own frame, and the transform from that frame to the room. The unit is the meter. */
244
+ interface PlacedBox {
245
+ readonly kind: "box";
246
+ readonly box: Box3;
247
+ readonly transform: Transform3;
248
+ }
249
+ /** The shape of a solid. */
250
+ type SolidShape = Prism | PlacedBox;
251
+ /**
252
+ * 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.
253
+ * 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.
254
+ */
255
+ interface Solid {
256
+ /** The name of the solid. Each solid of a model has a different name. */
257
+ readonly id: string;
258
+ readonly kind: SolidKind;
259
+ /** The `id` of the record that the solid comes from: a wall, a floor, an opening, an outlet or a placed object. */
260
+ readonly source: string;
261
+ readonly shape: SolidShape;
262
+ }
263
+ /** The options of the model of a room. */
264
+ interface SolidOptions {
265
+ /** 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. */
266
+ readonly floorDepth?: number | undefined;
267
+ /** The options of the corners of the walls. */
268
+ readonly joins?: JoinOptions | undefined;
269
+ }
270
+ /** The default depth of the floor, in meters. */
271
+ declare const FLOOR_DEPTH = .1;
272
+ /** The thickness of the glass of a window, in meters. */
273
+ declare const GLASS_THICKNESS = .02;
274
+ /** 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. */
275
+ declare const OUTLET_PLATE: {
276
+ readonly width: number;
277
+ readonly height: number;
278
+ readonly depth: number;
279
+ };
280
+ /**
281
+ * The transform from the room, where the z axis points up, to a space where the y axis points up.
282
+ * 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.
283
+ */
284
+ declare const TO_Y_UP: Transform3;
285
+ /**
286
+ * This function gives the 3D model of a room as a list of solids.
287
+ * The solids are the floors, the walls with their openings, the glass of the windows and the outlets.
288
+ *
289
+ * The function does not stop for a record with a fault. It skips each part that it cannot make.
290
+ * One example is a wall with no length. A second example is an opening on a wall that the room does not have.
291
+ * 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.
292
+ */
293
+ declare function roomSolids(room: Room, options?: SolidOptions): readonly Solid[];
294
+ /**
295
+ * This function gives the transform of each placed object of a scene, from the frame of the object to the room, in meters.
296
+ * 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.
297
+ * An object has no transform when a parent is not in the scene, or when its parents make a loop.
298
+ * An object also has no transform when one value of its place is not finite or not in the range of the model.
299
+ */
300
+ declare function objectTransforms(scene: Scene): ReadonlyMap<string, Transform3>;
301
+ /**
302
+ * This function gives the 3D model of a scene: the solids of its room, then one box for each placed object.
303
+ * 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.
304
+ */
305
+ declare function sceneSolids(scene: Scene, options?: SolidOptions): readonly Solid[];
306
+ /** 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. */
307
+ declare function solidCorners(solid: Solid): readonly Point3[];
308
+ /** This function gives the smallest box along the axes that holds each solid, or `undefined` for no solids. */
309
+ declare function boundsOfSolids(solids: readonly Solid[]): Box3 | undefined;
310
+ /** This function gives the volume of a solid in cubic meters. */
311
+ declare function solidVolume(solid: Solid): number;
312
+ export { Floor as A, Scene as B, WallFrame as C, wallTransform as D, wallPoint as E, PlacedObject as F, WallSide as G, WALL_SIDES as H, PlanPoint as I, LENGTH_UNITS as J, isLayerName as K, ROOM_SCHEMA as L, Opening as M, OpeningKind as N, Circuit as O, Outlet as P, unitsPer as Q, Room as R, wallFootprints as S, wallHasOutline as T, Wall as U, WALL_FACES as V, WallFace as W, lengthsInRange as X, LengthUnit as Y, metersPer as Z, solidVolume as _, Prism as a, MITER_LIMIT as b, SolidKind as c, TO_Y_UP as d, boundsOfSolids as f, solidCorners as g, sceneSolids as h, PlacedBox as i, OPENING_KINDS as j, CircuitLoad as k, SolidOptions as l, roomSolids as m, GLASS_THICKNESS as n, SOLID_KINDS as o, objectTransforms as p, LARGEST_LENGTH as q, OUTLET_PLATE as r, Solid as s, FLOOR_DEPTH as t, SolidShape as u, JOIN_TOLERANCE as v, wallFrames as w, WallFootprint as x, JoinOptions as y, SCENE_SCHEMA as z };
313
+ //# sourceMappingURL=solids-S_j17vFJ.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solids-S_j17vFJ.d.ts","names":[],"sources":["../src/units.ts","../src/room.ts","../src/frames.ts","../src/joins.ts","../src/solids.ts"],"mappings":";;cAGa;;KAGD,qBAAqB;;iBAGjB,UAAU,MAAM;;iBAKhB,SAAS,MAAM,YAAY,OAAO;;;;;cAQrC;;iBAGG,kBAAkB;;KCrBtB;;cAGC;;cAG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AAyB;WAAwB;WAAyB;;;;;;cAM1E,SAAS;;;;;;;;;iBA4HN,WAAW,MAAM,MAAM,UAAS,wBAA6B;;;;;;;iBAiD7D,iBAAiB,OAAO,QAAQ,oBAAoB;;;;;iBAiCpD,YAAY,OAAO,OAAO,UAAS,wBAA6B;;iBAqBhE,aAAa,OAAO,iBAAiB;;iBAUrC,eAAe,iBAAiB,UAAU;;iBAK1C,YAAY,OAAO"}
package/build/three.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import { c as SolidKind, l as SolidOptions, s as Solid } from "./solids-BHLnvDVu.js";
2
- import { a as LoadLevel, o as LoadOptions } from "./loads-Bp8aH2HJ.js";
3
- import { p as Scene } from "./room-NREa6vXr.js";
1
+ import { B as Scene, c as SolidKind, l as SolidOptions, s as Solid } from "./solids-S_j17vFJ.js";
2
+ import { a as LoadLevel, o as LoadOptions } from "./loads-Diy6-Ekz.js";
4
3
  import { Point3, Rotation3 } from "@mark1russell7/layout-contract";
5
4
  import { BufferGeometry } from "three";
6
5
  import { MarkersOptions } from "@mark1russell7/visuals/markers";
@@ -1 +1 @@
1
- {"version":3,"file":"three.d.ts","names":[],"sources":["../src/viewer/geometry.ts","../src/viewer/theme.ts","../src/viewer/content.ts","../src/viewer/viewer.ts"],"mappings":";;;;;;;;;;;;UAQiB;;WAEN,UAAU;;WAEV,UAAU;;WAEV,UAAU;;;;;;;;wBAYL,cAAc,OAAO,QAAQ;;;;;UCpB5B;;WAEN;;WAEA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA,QAAQ,SAAS,OAAO;;WAExB;;;;;WAKA;;WAEA;;WAEA;;WAEA,SAAS,SAAS;;WAElB;;WAEA;;;qBAIE,aAAa;;qBAiBb,YAAY;;UC7CR;;WAEN,MAAM;;WAEN;;;UAIM,mBAAmB;;WAEzB;;;KCNC;;UAGK;WACN,OAAO;;WAEP,QAAQ;;WAER,SAAS;;WAET,QAAQ;;WAER,UAAU;;;;;;WAMV,iBAAiB;;WAEjB;;;;;WAKA,YAAY,MAAM,wBAAwB,OAAO;;WAEjD,aAAa,MAAM,wBAAwB,OAAO;;;UAI5C;;WAEN,QAAQ;;;;;EAKjB,SAAS,OAAO,OAAO,iBAAiB;;EAExC,SAAS,OAAO;;EAEhB,QAAQ,MAAM;;;;;EAKd,UAAU,mBAAmB;;EAE7B,OAAO,QAAQ;;;;;EAKf,UAAU,OAAO,MAAM;;EAEvB;;;;;;;;;;;;;;wBAkGc,iBAAiB,WAAW,aAAa,SAAS,oBAAoB"}
1
+ {"version":3,"file":"three.d.ts","names":[],"sources":["../src/viewer/geometry.ts","../src/viewer/theme.ts","../src/viewer/content.ts","../src/viewer/viewer.ts"],"mappings":";;;;;;;;;;;UAQiB;;WAEN,UAAU;;WAEV,UAAU;;WAEV,UAAU;;;;;;;;wBAYL,cAAc,OAAO,QAAQ;;;;;UCpB5B;;WAEN;;WAEA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA,QAAQ,SAAS,OAAO;;WAExB;;;;;WAKA;;WAEA;;WAEA;;WAEA,SAAS,SAAS;;WAElB;;WAEA;;;qBAIE,aAAa;;qBAiBb,YAAY;;UC7CR;;WAEN,MAAM;;WAEN;;;UAIM,mBAAmB;;WAEzB;;;KCNC;;UAGK;WACN,OAAO;;WAEP,QAAQ;;WAER,SAAS;;WAET,QAAQ;;WAER,UAAU;;;;;;WAMV,iBAAiB;;WAEjB;;;;;WAKA,YAAY,MAAM,wBAAwB,OAAO;;WAEjD,aAAa,MAAM,wBAAwB,OAAO;;;UAI5C;;WAEN,QAAQ;;;;;EAKjB,SAAS,OAAO,OAAO,iBAAiB;;EAExC,SAAS,OAAO;;EAEhB,QAAQ,MAAM;;;;;EAKd,UAAU,mBAAmB;;EAE7B,OAAO,QAAQ;;;;;EAKf,UAAU,OAAO,MAAM;;EAEvB;;;;;;;;;;;;;;wBAkGc,iBAAiB,WAAW,aAAa,SAAS,oBAAoB"}
package/build/three.js CHANGED
@@ -1,5 +1,4 @@
1
- import { D as wallFrames, O as wallHasOutline, S as solidCorners, _ as TO_Y_UP, d as recordName, f as solidRecord, h as OUTLET_PLATE, k as wallPoint, n as sceneSpace, v as boundsOfSolids, x as sceneSolids } from "./anchors-J6mcUeJn.js";
2
- import { i as metersPer } from "./units-BZmvVyu4.js";
1
+ import { A as wallPoint, C as solidCorners, F as metersPer, O as wallFrames, S as sceneSolids, f as recordName, g as OUTLET_PLATE, k as wallHasOutline, p as solidRecord, r as sceneSpace, v as TO_Y_UP, y as boundsOfSolids } from "./anchors-Ba3OUmhF.js";
3
2
  import { s as outletLevels } from "./loads-CtHa4EHo.js";
4
3
  import { addPoints3, pointInRing, scalePoint3, transformPoint3 } from "@mark1russell7/layout-contract";
5
4
  import { BoxGeometry, Color, EdgesGeometry, ExtrudeGeometry, Group, Mesh, MeshLambertMaterial, Shape, Vector2 } from "three";
@@ -1 +1 @@
1
- {"version":3,"file":"three.js","names":[],"sources":["../src/viewer/geometry.ts","../src/viewer/theme.ts","../src/viewer/fade.ts","../src/viewer/view.ts","../src/viewer/model.ts","../src/viewer/content.ts","../src/viewer/outlets.ts","../src/viewer/viewer.ts"],"sourcesContent":["import { transformPoint3, type Point3, type Rotation3 } from \"@mark1russell7/layout-contract\";\nimport { BoxGeometry, ExtrudeGeometry, Shape, Vector2, type BufferGeometry } from \"three\";\nimport type { Solid } from \"../solids.ts\";\n\n/**\n * The three.js geometry of a solid, and its place in the room.\n * The origin of the geometry is the center of the solid. Thus three.js puts clear solids in the correct sequence.\n */\nexport interface SolidPlacement {\n /** The geometry, in meters, around its own origin. The caller disposes it. */\n readonly geometry: BufferGeometry;\n /** The position of the origin of the geometry in the room, where the z axis points up. */\n readonly position: Point3;\n /** The rotation of the geometry in the room. */\n readonly rotation: Rotation3;\n}\n\n/** The rotation that changes no direction. */\nconst NO_ROTATION: Rotation3 = { x: 0, y: 0, z: 0, w: 1 };\n\n/**\n * This function gives the three.js geometry of a solid, with its place in the room.\n *\n * A mesh with this geometry, this position and this rotation is in the space of the room: the z axis points up.\n * Put the mesh in a group with the rotation of `TO_Y_UP`. Then three.js shows it with the y axis up.\n */\nexport function solidGeometry(solid: Solid): SolidPlacement {\n const shape = solid.shape;\n if (shape.kind === \"box\") {\n const { box, transform } = shape;\n const center = { x: box.x + box.w / 2, y: box.y + box.h / 2, z: box.z + box.d / 2 };\n return { geometry: new BoxGeometry(box.w, box.h, box.d), position: transformPoint3(transform, center), rotation: transform.rotation };\n }\n let minX = Infinity;\n let maxX = -Infinity;\n let minY = Infinity;\n let maxY = -Infinity;\n for (const [x, y] of shape.ring) {\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n }\n const centerX = (minX + maxX) / 2;\n const centerY = (minY + maxY) / 2;\n const outline = new Shape(shape.ring.map(([x, y]) => new Vector2(x - centerX, y - centerY)));\n const geometry = new ExtrudeGeometry(outline, { depth: shape.d, bevelEnabled: false, steps: 1, curveSegments: 1 });\n geometry.translate(0, 0, 0 - shape.d / 2);\n return { geometry, position: { x: centerX, y: centerY, z: shape.z + shape.d / 2 }, rotation: NO_ROTATION };\n}\n","import type { LoadLevel } from \"../loads.ts\";\n\n/**\n * The colors of a viewer. Each color is a CSS hex color, for example `#22364a`.\n * The viewer has no background: the page shows behind the model.\n */\nexport interface ViewerTheme {\n /** The color of the edges of each solid. */\n readonly edge: string;\n /** The color that marks the solids under the pointer and the selected solids. */\n readonly accent: string;\n readonly floor: string;\n readonly wall: string;\n readonly glass: string;\n /** The part of the glass that is not clear, from 0 to 1. */\n readonly glassOpacity: number;\n /** The color of an outlet with no circuit. */\n readonly outlet: string;\n /** The color of the marks of each level, and of the plates of the outlets of a circuit at each level of its load. */\n readonly levels: Readonly<Record<LoadLevel, string>>;\n /** The color of the line around the sign of a mark. It is the color of the page, so a sign is clear on each solid. */\n readonly halo: string;\n /**\n * The colors of a field mark, from the value `min` of its scale to the value `max`.\n * A theme with no such list gives a field the color of its level.\n */\n readonly field?: readonly string[] | undefined;\n /** The part of a field mark that is not clear, from 0 to 1. The default is 0.8. */\n readonly fieldOpacity?: number | undefined;\n /** The color of a placed object whose kind has no color in `objects`. */\n readonly object: string;\n /** The color of the placed objects of each kind. The key is the field `kind` of a placed object. */\n readonly objects: Readonly<Record<string, string>>;\n /** The color of the light from above. */\n readonly sky: string;\n /** The color of the light from below. */\n readonly ground: string;\n}\n\n/** The colors of a model of white card with ink edges, for a light page. */\nexport const LIGHT_THEME: ViewerTheme = {\n edge: \"#22364a\",\n accent: \"#f2b705\",\n floor: \"#dfe5ea\",\n wall: \"#fcfcfb\",\n glass: \"#8fc4e8\",\n glassOpacity: 0.35,\n outlet: \"#55677a\",\n levels: { unknown: \"#55677a\", ok: \"#1f5fa8\", near: \"#d9662f\", over: \"#c62f2f\" },\n halo: \"#ffffff\",\n object: \"#b8c0c8\",\n objects: { desk: \"#c9b596\", sofa: \"#8fa3b5\", rack: \"#3d4954\", computer: \"#5b6d7e\", display: \"#2c3640\" },\n sky: \"#ffffff\",\n ground: \"#b9c3cd\",\n};\n\n/** The colors of a blueprint, for a dark page. */\nexport const DARK_THEME: ViewerTheme = {\n edge: \"#cfe6ff\",\n accent: \"#ffd24a\",\n floor: \"#17395a\",\n wall: \"#1f4a73\",\n glass: \"#9fd0ff\",\n glassOpacity: 0.25,\n outlet: \"#a9bfd4\",\n levels: { unknown: \"#a9bfd4\", ok: \"#6fb3f2\", near: \"#f5a962\", over: \"#f0625f\" },\n halo: \"#0e2740\",\n object: \"#2a5580\",\n objects: { desk: \"#2a5a8a\", sofa: \"#28527c\", rack: \"#16324e\", computer: \"#3a74ad\", display: \"#122a42\" },\n sky: \"#ffffff\",\n ground: \"#7f9bb8\",\n};\n","import { pointInRing, type Point, type Point3, type Ring } from \"@mark1russell7/layout-contract\";\nimport { wallFrames, wallHasOutline, wallPoint, type WallFrame } from \"../frames.ts\";\nimport type { Room } from \"../room.ts\";\nimport { metersPer } from \"../units.ts\";\n\n/** The side of a wall that looks at the room. A wall between two parts of a room has the value `both`. */\nexport type InnerSide = \"left\" | \"right\" | \"both\";\n\n/** A wall, and the side of it that looks at the room. */\nexport interface WallShade {\n readonly frame: WallFrame;\n readonly inner: InnerSide;\n}\n\n/** The distance from a face of a wall to the points that find the floor, in meters. */\nconst PROBE = 0.05;\n\n/** A wall hides the room when it hides a strip of the floor that is deeper than this, in meters. */\nexport const HIDDEN_LIMIT = 0.3;\n\n/** This function gives the distance of a point of the plan across a wall. It is positive to the left of the line of the wall. */\nfunction across(frame: WallFrame, point: Point): number {\n return (point.x - frame.start.x) * frame.left.x + (point.y - frame.start.y) * frame.left.y;\n}\n\n/** This function tells if a floor is next to one face of a wall. `offset` is the distance across of points near that face. */\nfunction hasFloor(frame: WallFrame, offset: number, floors: readonly Ring[]): boolean {\n return [0.25, 0.5, 0.75].some((part) => {\n const point = wallPoint(frame, frame.length * part, offset);\n return floors.some((ring) => pointInRing(point.x, point.y, ring));\n });\n}\n\n/**\n * This function gives each wall that the model makes, with the side that looks at the room.\n *\n * A side looks at the room when a floor is next to it. For a wall with no floor on each side, the side is the side of `center`,\n * a point of the plan in meters. Without a center, such a wall has the value `both`.\n */\nexport function wallShades(room: Room, center?: Point): readonly WallShade[] {\n const scale = metersPer(room.unit);\n const floors = (room.floors ?? []).map((floor): Ring => floor.ring.map(([x, y]) => [x * scale, y * scale] as const));\n return wallFrames(room)\n .filter((frame) => wallHasOutline(frame))\n .map((frame): WallShade => {\n const left = hasFloor(frame, frame.leftOffset + PROBE, floors);\n const right = hasFloor(frame, frame.rightOffset - PROBE, floors);\n if (left !== right) return { frame, inner: left ? \"left\" : \"right\" };\n if (left || center === undefined) return { frame, inner: \"both\" };\n const side = across(frame, center);\n return { frame, inner: side > frame.leftOffset ? \"left\" : side < frame.rightOffset ? \"right\" : \"both\" };\n });\n}\n\n/**\n * This function gives the depth of the strip of the floor that a wall hides from a camera, in meters.\n *\n * `camera` is a point of the room in meters, with the z axis up. A camera above the wall, between its two faces, hides no strip.\n * A camera that is not above the top of the wall hides all of the floor behind the wall, and the depth is `Infinity`.\n */\nexport function hiddenDepth(frame: WallFrame, camera: Point3): number {\n const side = across(frame, camera);\n const gap = side > frame.leftOffset ? side - frame.leftOffset : side < frame.rightOffset ? frame.rightOffset - side : 0;\n if (!(gap > 0)) return 0;\n return camera.z > frame.height ? (frame.height * gap) / (camera.z - frame.height) : Infinity;\n}\n\n/**\n * This function gives the `id` of each wall that hides the room from a camera. A viewer makes these walls almost clear.\n *\n * A wall with one side to the room hides the room when the camera is on its other side.\n * A wall between two parts of a room hides the part behind it from each side.\n * `limit` is the depth of the hidden strip of the floor, in meters, above which a wall hides the room.\n */\nexport function hidingWalls(shades: readonly WallShade[], camera: Point3, limit: number = HIDDEN_LIMIT): ReadonlySet<string> {\n const hiding = new Set<string>();\n for (const { frame, inner } of shades) {\n const side = across(frame, camera);\n const cameraSide = side > frame.leftOffset ? \"left\" : side < frame.rightOffset ? \"right\" : undefined;\n if (cameraSide === undefined || cameraSide === inner) continue;\n if (hiddenDepth(frame, camera) > limit) hiding.add(frame.id);\n }\n return hiding;\n}\n","import type { Point3 } from \"@mark1russell7/layout-contract\";\nimport type { ViewAngles } from \"@mark1russell7/visuals\";\n\n// The space of the viewer has the y axis up. The x axis is the x axis of the plan, and the negative z axis is the y axis of the plan.\n// At an azimuth of 0, the camera is south of the room and it looks north. At a polar angle of 0, it looks down from above.\n\n/** The view of a dollhouse: from the south-east, 38 degrees above the floor. */\nexport const HOME_VIEW: ViewAngles = { polar: (52 * Math.PI) / 180, azimuth: (35 * Math.PI) / 180 };\n\n/** The view of a plan: from above, with north at the top. */\nexport const TOP_VIEW: ViewAngles = { polar: 0, azimuth: 0 };\n\n/** This function gives a point of the room in the space of the viewer: the z axis of the room becomes the y axis. */\nexport function toViewer(point: Point3): Point3 {\n return { x: point.x, y: point.z, z: 0 - point.y };\n}\n\n/** This function gives a point of the viewer in the space of the room: the y axis of the viewer becomes the z axis. */\nexport function toRoom(point: Point3): Point3 {\n return { x: point.x, y: 0 - point.z, z: point.y };\n}\n","import type { Point3 } from \"@mark1russell7/layout-contract\";\nimport type { Highlight } from \"@mark1russell7/visuals\";\nimport { Color, EdgesGeometry, Group, Mesh, MeshLambertMaterial, type BufferGeometry, type Material } from \"three\";\nimport { LineMaterial } from \"three/addons/lines/LineMaterial.js\";\nimport { LineSegments2 } from \"three/addons/lines/LineSegments2.js\";\nimport { LineSegmentsGeometry } from \"three/addons/lines/LineSegmentsGeometry.js\";\nimport { solidRecord } from \"../check.ts\";\nimport { outletLevels, type LoadLevel, type LoadOptions } from \"../loads.ts\";\nimport type { Scene } from \"../room.ts\";\nimport { boundsOfSolids, sceneSolids, solidCorners, TO_Y_UP, type Solid, type SolidKind, type SolidOptions } from \"../solids.ts\";\nimport { metersPer } from \"../units.ts\";\nimport { wallShades, type WallShade } from \"./fade.ts\";\nimport { solidGeometry } from \"./geometry.ts\";\nimport type { ViewerTheme } from \"./theme.ts\";\nimport { toViewer } from \"./view.ts\";\n\n/** One solid of the model as three.js objects. */\nexport interface ModelPart {\n readonly solid: Solid;\n /** The name of the record of the solid, from `solidRecord`. Each part of one wall has the same name. */\n readonly record: string;\n /** The `id` of the wall that the part fades with: the wall itself, the wall of a window or the wall of an outlet. */\n readonly wall: string | undefined;\n /** The name of the record of the object that this object is in or on. */\n readonly holder: string | undefined;\n /** This value is true for an object with other objects in it. Such an object shows as a clear box. */\n readonly holds: boolean;\n /** The level of the circuit of an outlet. An outlet with no circuit has no level, and so has each other part. */\n readonly level: LoadLevel | undefined;\n readonly mesh: Mesh<BufferGeometry, MeshLambertMaterial>;\n readonly lines: LineSegments2;\n /** The fade of the part, from 0 for a solid part to 1 for a part that hides the room. The viewer changes it. */\n fade: number;\n}\n\n/** The model of a scene as three.js objects. */\nexport interface RoomModel {\n /** The group of each part. It has the rotation from the room to the space of the viewer. */\n readonly group: Group;\n readonly parts: readonly ModelPart[];\n /** Each corner of each solid, in the space of the viewer. */\n readonly corners: readonly Point3[];\n /** The center of the model, in the space of the viewer. */\n readonly center: Point3;\n /** The walls of the room, each with the side that looks at the room. */\n readonly shades: readonly WallShade[];\n}\n\n/** The width of the edges of each kind of solid, in CSS pixels. */\nconst EDGE_WIDTH: Readonly<Record<SolidKind, number>> = { floor: 1.25, wall: 1.25, glass: 1, outlet: 1, object: 1.25 };\n\n/** The part of a clear box of objects that is not clear. */\nconst HOLDER_OPACITY = 0.14;\n\n/** A part with an opacity above this value writes its depth, as a solid part does. */\nconst SOLID_OPACITY = 0.999;\n\n/** This function gives the `id` of each placed object that has an object in its box. */\nfunction holders(scene: Scene): ReadonlySet<string> {\n const scale = metersPer(scene.room.unit);\n const objects = new Map((scene.objects ?? []).map((object) => [object.id, object] as const));\n const found = new Set<string>();\n for (const object of scene.objects ?? []) {\n const parent = object.parent === undefined ? undefined : objects.get(object.parent);\n if (parent === undefined) continue;\n const x = object.at[0] * scale;\n const y = object.at[1] * scale;\n const z = ((object.lift ?? 0) + object.size[2] / 2) * scale;\n const [w, h, d] = [parent.size[0] * scale, parent.size[1] * scale, parent.size[2] * scale];\n if (Math.abs(x) < w / 2 && Math.abs(y) < h / 2 && z > 0 && z < d) found.add(parent.id);\n }\n return found;\n}\n\n/**\n * This function makes the three.js objects of a scene: one mesh with its edges for each solid.\n * The parts have no colors until `paintPart` gives them. The caller disposes the model with `disposeModel`.\n */\nexport function buildModel(scene: Scene, options: SolidOptions = {}, loads: LoadOptions = {}): RoomModel {\n const solids = sceneSolids(scene, options);\n const levels = outletLevels(scene, loads);\n const wallOfOpening = new Map((scene.room.openings ?? []).map((opening) => [opening.id, opening.wall] as const));\n const wallOfOutlet = new Map((scene.room.outlets ?? []).map((outlet) => [outlet.id, outlet.wall] as const));\n const parentOf = new Map((scene.objects ?? []).map((object) => [object.id, object.parent] as const));\n const holding = holders(scene);\n const group = new Group();\n group.quaternion.set(TO_Y_UP.rotation.x, TO_Y_UP.rotation.y, TO_Y_UP.rotation.z, TO_Y_UP.rotation.w);\n const parts = solids.map((solid): ModelPart => {\n const { geometry, position, rotation } = solidGeometry(solid);\n const mesh = new Mesh(geometry, new MeshLambertMaterial({ polygonOffset: true, polygonOffsetFactor: 1, polygonOffsetUnits: 1 }));\n mesh.position.set(position.x, position.y, position.z);\n mesh.quaternion.set(rotation.x, rotation.y, rotation.z, rotation.w);\n const edges = new EdgesGeometry(geometry, 30);\n const lines = new LineSegments2(new LineSegmentsGeometry().fromEdgesGeometry(edges), new LineMaterial({ linewidth: EDGE_WIDTH[solid.kind] }));\n edges.dispose();\n mesh.add(lines);\n group.add(mesh);\n const parent = solid.kind === \"object\" ? parentOf.get(solid.source) : undefined;\n return {\n solid,\n record: solidRecord(solid.kind, solid.source),\n wall: solid.kind === \"wall\" ? solid.source : solid.kind === \"glass\" ? wallOfOpening.get(solid.source) : solid.kind === \"outlet\" ? wallOfOutlet.get(solid.source) : undefined,\n holder: parent === undefined ? undefined : solidRecord(\"object\", parent),\n holds: solid.kind === \"object\" && holding.has(solid.source),\n level: solid.kind === \"outlet\" ? levels.get(solid.source) : undefined,\n mesh,\n lines,\n fade: 0,\n };\n });\n // A pick uses the place of each mesh in the world before the first picture.\n group.updateMatrixWorld(true);\n const bounds = boundsOfSolids(solids);\n const middle = bounds === undefined ? { x: 0, y: 0, z: 0 } : { x: bounds.x + bounds.w / 2, y: bounds.y + bounds.h / 2, z: bounds.z + bounds.d / 2 };\n return {\n group,\n parts,\n corners: solids.flatMap((solid) => solidCorners(solid).map((corner) => toViewer(corner))),\n center: toViewer(middle),\n shades: wallShades(scene.room, bounds === undefined ? undefined : middle),\n };\n}\n\n/** This function sets the opacity of a material. A material that is not solid does not write its depth. */\nfunction setOpacity(material: Material, opacity: number): void {\n const clear = opacity < SOLID_OPACITY;\n if (material.transparent !== clear) {\n material.transparent = clear;\n material.depthWrite = !clear;\n material.needsUpdate = true;\n }\n material.opacity = opacity;\n}\n\n/** This function gives the color of a part in a theme, before a mark. */\nfunction baseColor(part: ModelPart, scene: Scene, theme: ViewerTheme): string {\n const kind = part.solid.kind;\n if (kind === \"outlet\") return part.level === undefined ? theme.outlet : theme.levels[part.level];\n if (kind !== \"object\") return theme[kind];\n const object = (scene.objects ?? []).find((candidate) => candidate.id === part.solid.source);\n return (object === undefined ? undefined : theme.objects[object.kind]) ?? theme.object;\n}\n\n/**\n * This function gives a part its colors: the colors of the theme, the fade of the part and its highlight.\n * A part with a highlight has some of the color `accent` of the theme, and a selected part has wide edges.\n * An outlet has the color of the level of its circuit.\n */\nexport function paintPart(part: ModelPart, scene: Scene, theme: ViewerTheme, mark: Highlight): void {\n const kind = part.solid.kind;\n const fill = part.mesh.material;\n const ink = part.lines.material;\n const color = baseColor(part, scene, theme);\n fill.color.set(color);\n if (mark !== 0) fill.color.lerp(new Color(theme.accent), mark === 2 ? 0.55 : 0.3);\n ink.color.set(theme.edge);\n ink.linewidth = EDGE_WIDTH[kind] * (mark === 2 ? 2 : 1);\n const still = 1 - part.fade;\n let opacity = kind === \"glass\" ? theme.glassOpacity : part.holds ? (mark === 0 ? HOLDER_OPACITY : 0.45) : 1;\n let edge = 1;\n if (kind === \"wall\") {\n opacity *= 0.08 + 0.92 * still;\n edge = 0.3 + 0.7 * still;\n } else if (kind === \"glass\" || kind === \"outlet\") {\n opacity *= 0.35 + 0.65 * still;\n edge = 0.35 + 0.65 * still;\n }\n setOpacity(fill, opacity);\n setOpacity(ink, edge);\n}\n\n/** This function releases the memory of the graphics card that a model uses. */\nexport function disposeModel(model: RoomModel): void {\n for (const part of model.parts) {\n part.mesh.geometry.dispose();\n part.mesh.material.dispose();\n part.lines.geometry.dispose();\n part.lines.material.dispose();\n }\n model.group.clear();\n}\n","import type { Highlight } from \"@mark1russell7/visuals\";\nimport type { StageContent, StageFrame, StagePick } from \"@mark1russell7/visuals/three\";\nimport type { Object3D, Raycaster } from \"three\";\nimport type { LoadOptions } from \"../loads.ts\";\nimport type { Scene } from \"../room.ts\";\nimport type { Solid, SolidKind, SolidOptions } from \"../solids.ts\";\nimport { hidingWalls } from \"./fade.ts\";\nimport { buildModel, disposeModel, paintPart, type ModelPart } from \"./model.ts\";\nimport type { ViewerTheme } from \"./theme.ts\";\nimport { toRoom } from \"./view.ts\";\n\n/** A record of a scene that the viewer shows: a floor, a wall, a window, an outlet or a placed object. */\nexport interface ViewerRecord {\n /** The kind of the solids of the record. A window has the kind `glass`. */\n readonly kind: SolidKind;\n /** The `id` of the record in the scene. */\n readonly source: string;\n}\n\n/** The solid under the pointer, with its record. */\nexport interface ViewerPick extends ViewerRecord {\n /** The `id` of the solid. A wall with openings has more than one solid. */\n readonly solid: string;\n}\n\n/** The content of a stage that shows the solids of a scene. The value of a pick is the solid. */\nexport interface RoomContent extends StageContent<ViewerPick, ViewerTheme> {\n /** The solids of the scene. */\n readonly solids: readonly Solid[];\n /** This function gives the first solid of a record with a name, as a pick. A name of no record of the content gives `undefined`. */\n pickOf(record: string): ViewerPick | undefined;\n}\n\n/** The time in which a wall goes most of the way to clear or to solid, in seconds. */\nexport const FADE_TIME = 0.11;\n\n/**\n * This function makes the content of a stage that shows the solids of a scene.\n * The solids are the floors, the walls, the windows, the plates of the outlets and the placed objects.\n *\n * The walls between the camera and the room become almost clear, and the pointer goes through them.\n * An object in a clear box of objects gets the pick before the box. Each pick has its distance, so a mark in front of a solid gets the pick.\n * The space of the content has the y axis up: the z axis of the scene becomes the y axis.\n */\nexport function createRoomContent(scene: Scene, solids: SolidOptions = {}, loads: LoadOptions = {}): RoomContent {\n const model = buildModel(scene, solids, loads);\n const first = new Map<string, ModelPart>();\n for (const part of model.parts) if (!first.has(part.record)) first.set(part.record, part);\n const byMesh = new Map<Object3D, ModelPart>(model.parts.map((part) => [part.mesh, part]));\n const pickOfPart = (part: ModelPart): ViewerPick => ({ solid: part.solid.id, kind: part.solid.kind, source: part.solid.source });\n\n /** The walls that hide the room from the camera of the last step. */\n let hiding: ReadonlySet<string> = new Set();\n let theme: ViewerTheme | undefined;\n let highlightOf: (record: string) => Highlight = () => 0;\n const paintOne = (part: ModelPart): void => {\n if (theme !== undefined) paintPart(part, scene, theme, highlightOf(part.record));\n };\n\n return {\n objects: [model.group],\n extent: { corners: model.corners, center: model.center },\n solids: model.parts.map((part) => part.solid),\n has: (record) => first.has(record),\n pickOf(record): ViewerPick | undefined {\n const part = first.get(record);\n return part === undefined ? undefined : pickOfPart(part);\n },\n pick(ray: Raycaster): StagePick<ViewerPick> | undefined {\n // A wall that hides the room is clear, and the pointer goes through it.\n const open = model.parts.filter((part) => part.wall === undefined || !hiding.has(part.wall)).map((part) => part.mesh);\n const hits = ray.intersectObjects(open, false);\n const nearest = hits[0];\n const found = nearest === undefined ? undefined : byMesh.get(nearest.object);\n if (nearest === undefined || found === undefined) return undefined;\n if (found.holds) {\n // A clear box of objects: the pointer selects an object in the box before the box.\n for (const hit of hits) {\n const part = byMesh.get(hit.object);\n if (part !== undefined && part.holder === found.record) return { record: part.record, value: pickOfPart(part), distance: hit.distance };\n }\n }\n return { record: found.record, value: pickOfPart(found), distance: nearest.distance };\n },\n paint(nextTheme, highlight): void {\n theme = nextTheme;\n highlightOf = highlight;\n for (const part of model.parts) paintOne(part);\n },\n step(frame: StageFrame): boolean {\n hiding = hidingWalls(model.shades, toRoom(frame.camera.position));\n // Each wall goes to its goal: clear for a wall that hides the room, solid for each other wall.\n const rate = frame.settle ? 1 : 1 - Math.exp(0 - frame.seconds / FADE_TIME);\n let active = false;\n for (const part of model.parts) {\n if (part.wall === undefined) continue;\n const goal = hiding.has(part.wall) ? 1 : 0;\n if (part.fade === goal) continue;\n const next = part.fade + (goal - part.fade) * rate;\n part.fade = Math.abs(goal - next) < 0.01 ? goal : next;\n paintOne(part);\n active = active || part.fade !== goal;\n }\n return active;\n },\n dispose(): void {\n disposeModel(model);\n },\n };\n}\n","import { addPoints3, scalePoint3, type Point3 } from \"@mark1russell7/layout-contract\";\nimport type { LinkMark, Mark, PointMark } from \"@mark1russell7/visuals/marks\";\nimport { sceneSpace } from \"../anchors.ts\";\nimport { recordName } from \"../check.ts\";\nimport { outletLevels, type LoadOptions } from \"../loads.ts\";\nimport type { Scene } from \"../room.ts\";\nimport { OUTLET_PLATE, solidCorners, type Solid } from \"../solids.ts\";\n\n/** This function gives the center of a solid, in the space of the scene: the mean of its corners. */\nfunction centerOf(solid: Solid): Point3 {\n const corners = solidCorners(solid);\n const sum = corners.reduce((total, corner) => addPoints3(total, corner), { x: 0, y: 0, z: 0 });\n return scalePoint3(sum, 1 / Math.max(corners.length, 1));\n}\n\n/**\n * This function gives the marks of the outlets of a scene, in the space of the scene: meters, with the z axis up.\n *\n * - An outlet gives a point on the front of its plate. Its level is the level of its circuit, and `unknown` for no circuit of the room.\n * - A placed object with an outlet gives a link from that outlet to the center of the object.\n *\n * The record name of a point is the name of the record of its outlet, so the sign and the plate are one record.\n * The record name of a link is the name of the record of its object: that record has the outlet.\n * `solids` are the solids of the scene. An outlet or an object with no solid gives no mark. The first record of an `id` gives the mark.\n */\nexport function outletMarks(scene: Scene, solids: readonly Solid[], loads: LoadOptions = {}): readonly Mark[] {\n const space = sceneSpace(scene);\n const levels = outletLevels(scene, loads);\n /** The first solid of each outlet and of each placed object, by the name of its record. */\n const made = new Map<string, Solid>();\n for (const solid of solids) {\n const name = recordName(solid.kind, solid.source);\n if ((solid.kind === \"outlet\" || solid.kind === \"object\") && !made.has(name)) made.set(name, solid);\n }\n const circuits = new Map((scene.room.circuits ?? []).map((circuit) => [circuit.id, circuit.name ?? circuit.id] as const));\n const marks: Mark[] = [];\n\n const fronts = new Map<string, Point3>();\n for (const outlet of scene.room.outlets ?? []) {\n if (fronts.has(outlet.id) || !made.has(recordName(\"outlet\", outlet.id))) continue;\n const frame = space.frame({ on: \"wall\", wall: outlet.wall, face: outlet.face, offset: outlet.offset, height: outlet.height });\n if (frame === undefined) continue;\n // The plate is on the face of the wall, so its front is one depth of the plate out of the wall.\n const front = addPoints3(frame.at, scalePoint3(frame.out, OUTLET_PLATE.depth));\n fronts.set(outlet.id, front);\n const level = levels.get(outlet.id);\n const circuit = level === undefined || outlet.circuit === undefined ? \"\" : `, circuit ${circuits.get(outlet.circuit) ?? outlet.circuit}`;\n const point: PointMark = {\n type: \"point\",\n record: recordName(\"outlet\", outlet.id),\n kind: \"outlet\",\n level: level ?? \"unknown\",\n label: `Outlet ${outlet.id}${circuit}`.replace(/\\s+/g, \" \").trim(),\n frame: { at: front, out: frame.out },\n };\n marks.push(point);\n }\n\n const linked = new Set<string>();\n for (const object of scene.objects ?? []) {\n const from = object.outlet === undefined ? undefined : fronts.get(object.outlet);\n const solid = made.get(recordName(\"object\", object.id));\n if (object.outlet === undefined || from === undefined || solid === undefined || linked.has(object.id)) continue;\n linked.add(object.id);\n const link: LinkMark = {\n type: \"link\",\n record: recordName(\"object\", object.id),\n kind: \"feed\",\n level: levels.get(object.outlet) ?? \"unknown\",\n label: `Outlet ${object.outlet} to ${object.name ?? object.id}`.replace(/\\s+/g, \" \").trim(),\n from: { record: recordName(\"outlet\", object.outlet), at: from },\n to: { record: recordName(\"object\", object.id), at: centerOf(solid) },\n };\n marks.push(link);\n }\n return marks;\n}\n","import { fitView } from \"@mark1russell7/visuals\";\nimport { createMarkers, type MarkersOptions, type MarkersTheme } from \"@mark1russell7/visuals/markers\";\nimport { checkMarks, transformMarks, type Mark } from \"@mark1russell7/visuals/marks\";\nimport { createStage, stackContents, type StageContent } from \"@mark1russell7/visuals/three\";\nimport { solidRecord } from \"../check.ts\";\nimport type { LoadOptions } from \"../loads.ts\";\nimport type { Scene } from \"../room.ts\";\nimport { TO_Y_UP, type SolidOptions } from \"../solids.ts\";\nimport { createRoomContent, type ViewerPick, type ViewerRecord } from \"./content.ts\";\nimport { outletMarks } from \"./outlets.ts\";\nimport { LIGHT_THEME, type ViewerTheme } from \"./theme.ts\";\nimport { HOME_VIEW, TOP_VIEW } from \"./view.ts\";\n\nexport type { ViewerPick, ViewerRecord } from \"./content.ts\";\n\n/** The name of a view: `home` looks into the room from a corner above it, and `top` shows the plan. */\nexport type ViewName = \"home\" | \"top\";\n\n/** The options of a viewer. */\nexport interface RoomViewerOptions {\n readonly scene: Scene;\n /** The colors. The default is `LIGHT_THEME`. */\n readonly theme?: ViewerTheme | undefined;\n /** The options of the model. */\n readonly solids?: SolidOptions | undefined;\n /** The options of the levels of the circuits. */\n readonly loads?: LoadOptions | undefined;\n /** The options of the picture of the marks, for example the radius of a sign. */\n readonly markers?: MarkersOptions | undefined;\n /**\n * The marks of the scene, in the space of the scene: meters, with the z axis up. `layerMarks` of the entry `/marks` gives them.\n * With no list, the viewer makes the marks of the outlets of the scene. An empty list gives a picture with no mark.\n * The viewer draws no mark with a fault. `checkMarks` of `@mark1russell7/visuals/marks` tells each fault.\n */\n readonly marks?: readonly Mark[] | undefined;\n /** The name of the picture for a screen reader. */\n readonly label?: string | undefined;\n /**\n * The viewer starts this function when the pointer goes to a different record, or to no record.\n * `mark` is the mark under the pointer. `pick` is then the first solid of the record of the mark, or `undefined` for a record with no solid.\n */\n readonly onHover?: ((pick: ViewerPick | undefined, mark?: Mark) => void) | undefined;\n /** The viewer starts this function when a person selects a record with the pointer, or selects no record. The parameters are those of `onHover`. */\n readonly onSelect?: ((pick: ViewerPick | undefined, mark?: Mark) => void) | undefined;\n}\n\n/** A viewer of one scene in a page. */\nexport interface RoomViewer {\n /** The canvas of the viewer. It is in the container. */\n readonly canvas: HTMLCanvasElement;\n /**\n * This function shows a different scene, with its marks. The view stays if a person moved it.\n * With no list of marks, the viewer makes the marks of the outlets of the scene.\n */\n setScene(scene: Scene, marks?: readonly Mark[]): void;\n /** This function changes the colors. */\n setTheme(theme: ViewerTheme): void;\n /** This function moves the camera to a view that shows all of the model. */\n setView(view: ViewName): void;\n /**\n * This function highlights records, as the pointer does. An empty list removes the highlights.\n * A record is a record of a solid, or the record name of a mark, for example `electrical/1:nook-2`.\n */\n highlight(records: readonly (ViewerRecord | string)[]): void;\n /** This function selects one record, or no record. It does not start `onSelect`. */\n select(record: ViewerRecord | string | undefined): void;\n /**\n * This function shows only the marks that a test accepts, for example the marks of one kind. The pointer does not find a mark that the picture does not show.\n * The test stays for each subsequent scene. A test that accepts each mark shows all of them again.\n */\n showMarks(test: (mark: Mark) => boolean): void;\n /** This function removes the canvas and releases the memory of the graphics card. */\n dispose(): void;\n}\n\n/** The options of the content of a viewer: the options of the model, of the levels and of the picture of the marks. */\nexport type ViewerContentOptions = Pick<RoomViewerOptions, \"solids\" | \"loads\" | \"markers\">;\n\n/** The record under the pointer for the stage: a solid of the room, or a mark. */\nexport type StageValue = ViewerPick | Mark;\n\n/** This function gives the name of a record for the stage. */\nexport function nameOf(record: ViewerRecord | string): string {\n return typeof record === \"string\" ? record : solidRecord(record.kind, record.source);\n}\n\n/**\n * This function makes a function that gives the colors of the marks of a viewer theme.\n * The marks paint each field again for a new theme object. So the function gives the same object while the viewer theme is the same.\n * A theme with no colors of a field gives a field the color of its level.\n */\nexport function marksThemes(): (theme: ViewerTheme) => MarkersTheme {\n let from: ViewerTheme | undefined;\n let to: MarkersTheme | undefined;\n return (theme) => {\n if (to === undefined || theme !== from) {\n to = { sky: theme.sky, ground: theme.ground, levels: theme.levels, halo: theme.halo, accent: theme.accent, field: theme.field ?? [], fieldOpacity: theme.fieldOpacity };\n }\n from = theme;\n return to;\n };\n}\n\n/** The content of a viewer for one scene, with the functions that use its marks. */\nexport interface ViewerContent {\n /** The solids of the scene, and its marks above them. */\n readonly content: StageContent<StageValue, ViewerTheme>;\n /** This function shows only the marks that a test accepts. The test gets each mark as the scene has it. */\n show(test: (mark: Mark) => boolean): void;\n /**\n * This function gives a record of the stage as a page gets it.\n * A mark gives the first solid of its record and the mark as the scene has it. A solid gives the solid.\n */\n told(value: StageValue | undefined): readonly [pick: ViewerPick | undefined, mark: Mark | undefined];\n}\n\n/**\n * This function makes the content of a viewer for a scene: the solids, and the marks above them.\n *\n * `marks` are in the space of the scene: meters, with the z axis up. With no list, the function makes the marks of the outlets of the scene.\n * A mark with a fault is not in the content. The space of the content has the y axis up.\n */\nexport function createViewerContent(scene: Scene, marks?: readonly Mark[], options: ViewerContentOptions = {}): ViewerContent {\n const room = createRoomContent(scene, options.solids, options.loads);\n const given = marks ?? outletMarks(scene, room.solids, options.loads);\n const faulty = new Set(checkMarks(given).map((fault) => fault.index));\n const good = given.filter((_, index) => !faulty.has(index));\n const onStage = transformMarks(good, TO_Y_UP);\n /** The mark of the scene for each mark of the stage. */\n const inScene = new Map<Mark, Mark>(onStage.map((mark, index) => [mark, good[index] ?? mark]));\n const sceneMark = (mark: Mark): Mark => inScene.get(mark) ?? mark;\n const markers = createMarkers(onStage, options.markers);\n const themeOf = marksThemes();\n const above: StageContent<StageValue, ViewerTheme> = {\n objects: markers.objects,\n extent: markers.extent,\n has: (record) => markers.has(record),\n pick: (ray) => markers.pick(ray),\n paint(theme, highlight): void {\n markers.paint(themeOf(theme), highlight);\n },\n step: (frame) => markers.step?.(frame) ?? false,\n dispose(): void {\n markers.dispose();\n },\n };\n return {\n content: stackContents<StageValue, ViewerTheme>([room, above]),\n show(test): void {\n markers.show((mark) => test(sceneMark(mark)));\n },\n told(value) {\n if (value === undefined) return [undefined, undefined];\n return \"type\" in value ? [room.pickOf(value.record), sceneMark(value)] : [value, undefined];\n },\n };\n}\n\n/**\n * This function makes a viewer of a scene in a container of a page. The viewer fills the container, so give the container a size.\n *\n * A person turns the model with a drag, and moves nearer with the wheel after a click in the picture.\n * The walls between the camera and the room become almost clear. A click selects the record of a solid or of a mark.\n * With the keyboard, the arrow keys turn the model, `+` and `-` change the distance, `Home` shows the first view and `T` shows the plan.\n *\n * The viewer draws the marks of the scene with `@mark1russell7/visuals/markers`. A point is a sign with the color and the shape of its level.\n * With no list of marks, each outlet has a sign. An outlet or an object with a highlight then shows a line from the outlet to each object on it.\n *\n * The function gives `undefined` when the browser has no WebGL 2. It does not throw, and it writes no error to the console.\n */\nexport function createRoomViewer(container: HTMLElement, options: RoomViewerOptions): RoomViewer | undefined {\n let accepted: (mark: Mark) => boolean = () => true;\n let current = createViewerContent(options.scene, options.marks, options);\n /** This function gives a record of the stage to a function of the page. */\n const tell = (to: ((pick: ViewerPick | undefined, mark?: Mark) => void) | undefined, value: StageValue | undefined): void => {\n if (to === undefined) return;\n const [pick, mark] = current.told(value);\n if (mark === undefined) to(pick);\n else to(pick, mark);\n };\n\n const stage = createStage<StageValue, ViewerTheme>(container, {\n content: current.content,\n theme: options.theme ?? LIGHT_THEME,\n label: options.label ?? \"3D model of the room\",\n views: { home: fitView(HOME_VIEW), top: fitView(TOP_VIEW) },\n home: \"home\",\n keys: { t: \"top\" },\n onHover: (value) => tell(options.onHover, value),\n onSelect: (value) => tell(options.onSelect, value),\n });\n if (stage === undefined) {\n current.content.dispose();\n return undefined;\n }\n\n return {\n canvas: stage.canvas,\n setScene(scene: Scene, marks?: readonly Mark[]): void {\n current = createViewerContent(scene, marks, options);\n current.show(accepted);\n stage.setContent(current.content);\n },\n setTheme(theme: ViewerTheme): void {\n stage.setTheme(theme);\n },\n setView(view: ViewName): void {\n stage.setView(view);\n },\n highlight(records: readonly (ViewerRecord | string)[]): void {\n stage.highlight(records.map(nameOf));\n },\n select(record: ViewerRecord | string | undefined): void {\n stage.select(record === undefined ? undefined : nameOf(record));\n },\n showMarks(test: (mark: Mark) => boolean): void {\n accepted = test;\n current.show(test);\n stage.refresh();\n },\n dispose(): void {\n stage.dispose();\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAM,cAAyB;CAAE,GAAG;CAAG,GAAG;CAAG,GAAG;CAAG,GAAG;AAAE;;;;;;;AAQxD,SAAgB,cAAc,OAA8B;CAC1D,MAAM,QAAQ,MAAM;CACpB,IAAI,MAAM,SAAS,OAAO;EACxB,MAAM,EAAE,KAAK,cAAc;EAC3B,MAAM,SAAS;GAAE,GAAG,IAAI,IAAI,IAAI,IAAI;GAAG,GAAG,IAAI,IAAI,IAAI,IAAI;GAAG,GAAG,IAAI,IAAI,IAAI,IAAI;EAAE;EAClF,OAAO;GAAE,UAAU,IAAI,YAAY,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;GAAG,UAAU,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AAK;EACvC,IAAI,SAAS,KAAA,GAAW,GAAG,IAAI;OAC1B,GAAG,MAAM,IAAI;CACpB;CAEA,MAAM,QAAQ,YAAqC,WAAW;EAC5D,SAAS,QAAQ;EACjB,OAAO,QAAQ,SAAS;EACxB,OAAO,QAAQ,SAAS;EACxB,OAAO;GAAE,MAAM,QAAQ,SAAS;GAAG,KAAK,QAAQ,QAAQ;EAAE;EAC1D,MAAM;EACN,MAAM,EAAE,GAAG,MAAM;EACjB,UAAU,UAAU,KAAK,QAAQ,SAAS,KAAK;EAC/C,WAAW,UAAU,KAAK,QAAQ,UAAU,KAAK;CACnD,CAAC;CACD,IAAI,UAAU,KAAA,GAAW;EACvB,QAAQ,QAAQ,QAAQ;EACxB;CACF;CAEA,OAAO;EACL,QAAQ,MAAM;EACd,SAAS,OAAc,OAA+B;GACpD,UAAU,oBAAoB,OAAO,OAAO,OAAO;GACnD,QAAQ,KAAK,QAAQ;GACrB,MAAM,WAAW,QAAQ,OAAO;EAClC;EACA,SAAS,OAA0B;GACjC,MAAM,SAAS,KAAK;EACtB;EACA,QAAQ,MAAsB;GAC5B,MAAM,QAAQ,IAAI;EACpB;EACA,UAAU,SAAmD;GAC3D,MAAM,UAAU,QAAQ,IAAI,MAAM,CAAC;EACrC;EACA,OAAO,QAAiD;GACtD,MAAM,OAAO,WAAW,KAAA,IAAY,KAAA,IAAY,OAAO,MAAM,CAAC;EAChE;EACA,UAAU,MAAqC;GAC7C,WAAW;GACX,QAAQ,KAAK,IAAI;GACjB,MAAM,QAAQ;EAChB;EACA,UAAgB;GACd,MAAM,QAAQ;EAChB;CACF;AACF"}
1
+ {"version":3,"file":"three.js","names":[],"sources":["../src/viewer/geometry.ts","../src/viewer/theme.ts","../src/viewer/fade.ts","../src/viewer/view.ts","../src/viewer/model.ts","../src/viewer/content.ts","../src/viewer/outlets.ts","../src/viewer/viewer.ts"],"sourcesContent":["import { transformPoint3, type Point3, type Rotation3 } from \"@mark1russell7/layout-contract\";\nimport { BoxGeometry, ExtrudeGeometry, Shape, Vector2, type BufferGeometry } from \"three\";\nimport type { Solid } from \"../solids.ts\";\n\n/**\n * The three.js geometry of a solid, and its place in the room.\n * The origin of the geometry is the center of the solid. Thus three.js puts clear solids in the correct sequence.\n */\nexport interface SolidPlacement {\n /** The geometry, in meters, around its own origin. The caller disposes it. */\n readonly geometry: BufferGeometry;\n /** The position of the origin of the geometry in the room, where the z axis points up. */\n readonly position: Point3;\n /** The rotation of the geometry in the room. */\n readonly rotation: Rotation3;\n}\n\n/** The rotation that changes no direction. */\nconst NO_ROTATION: Rotation3 = { x: 0, y: 0, z: 0, w: 1 };\n\n/**\n * This function gives the three.js geometry of a solid, with its place in the room.\n *\n * A mesh with this geometry, this position and this rotation is in the space of the room: the z axis points up.\n * Put the mesh in a group with the rotation of `TO_Y_UP`. Then three.js shows it with the y axis up.\n */\nexport function solidGeometry(solid: Solid): SolidPlacement {\n const shape = solid.shape;\n if (shape.kind === \"box\") {\n const { box, transform } = shape;\n const center = { x: box.x + box.w / 2, y: box.y + box.h / 2, z: box.z + box.d / 2 };\n return { geometry: new BoxGeometry(box.w, box.h, box.d), position: transformPoint3(transform, center), rotation: transform.rotation };\n }\n let minX = Infinity;\n let maxX = -Infinity;\n let minY = Infinity;\n let maxY = -Infinity;\n for (const [x, y] of shape.ring) {\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n }\n const centerX = (minX + maxX) / 2;\n const centerY = (minY + maxY) / 2;\n const outline = new Shape(shape.ring.map(([x, y]) => new Vector2(x - centerX, y - centerY)));\n const geometry = new ExtrudeGeometry(outline, { depth: shape.d, bevelEnabled: false, steps: 1, curveSegments: 1 });\n geometry.translate(0, 0, 0 - shape.d / 2);\n return { geometry, position: { x: centerX, y: centerY, z: shape.z + shape.d / 2 }, rotation: NO_ROTATION };\n}\n","import type { LoadLevel } from \"../loads.ts\";\n\n/**\n * The colors of a viewer. Each color is a CSS hex color, for example `#22364a`.\n * The viewer has no background: the page shows behind the model.\n */\nexport interface ViewerTheme {\n /** The color of the edges of each solid. */\n readonly edge: string;\n /** The color that marks the solids under the pointer and the selected solids. */\n readonly accent: string;\n readonly floor: string;\n readonly wall: string;\n readonly glass: string;\n /** The part of the glass that is not clear, from 0 to 1. */\n readonly glassOpacity: number;\n /** The color of an outlet with no circuit. */\n readonly outlet: string;\n /** The color of the marks of each level, and of the plates of the outlets of a circuit at each level of its load. */\n readonly levels: Readonly<Record<LoadLevel, string>>;\n /** The color of the line around the sign of a mark. It is the color of the page, so a sign is clear on each solid. */\n readonly halo: string;\n /**\n * The colors of a field mark, from the value `min` of its scale to the value `max`.\n * A theme with no such list gives a field the color of its level.\n */\n readonly field?: readonly string[] | undefined;\n /** The part of a field mark that is not clear, from 0 to 1. The default is 0.8. */\n readonly fieldOpacity?: number | undefined;\n /** The color of a placed object whose kind has no color in `objects`. */\n readonly object: string;\n /** The color of the placed objects of each kind. The key is the field `kind` of a placed object. */\n readonly objects: Readonly<Record<string, string>>;\n /** The color of the light from above. */\n readonly sky: string;\n /** The color of the light from below. */\n readonly ground: string;\n}\n\n/** The colors of a model of white card with ink edges, for a light page. */\nexport const LIGHT_THEME: ViewerTheme = {\n edge: \"#22364a\",\n accent: \"#f2b705\",\n floor: \"#dfe5ea\",\n wall: \"#fcfcfb\",\n glass: \"#8fc4e8\",\n glassOpacity: 0.35,\n outlet: \"#55677a\",\n levels: { unknown: \"#55677a\", ok: \"#1f5fa8\", near: \"#d9662f\", over: \"#c62f2f\" },\n halo: \"#ffffff\",\n object: \"#b8c0c8\",\n objects: { desk: \"#c9b596\", sofa: \"#8fa3b5\", rack: \"#3d4954\", computer: \"#5b6d7e\", display: \"#2c3640\" },\n sky: \"#ffffff\",\n ground: \"#b9c3cd\",\n};\n\n/** The colors of a blueprint, for a dark page. */\nexport const DARK_THEME: ViewerTheme = {\n edge: \"#cfe6ff\",\n accent: \"#ffd24a\",\n floor: \"#17395a\",\n wall: \"#1f4a73\",\n glass: \"#9fd0ff\",\n glassOpacity: 0.25,\n outlet: \"#a9bfd4\",\n levels: { unknown: \"#a9bfd4\", ok: \"#6fb3f2\", near: \"#f5a962\", over: \"#f0625f\" },\n halo: \"#0e2740\",\n object: \"#2a5580\",\n objects: { desk: \"#2a5a8a\", sofa: \"#28527c\", rack: \"#16324e\", computer: \"#3a74ad\", display: \"#122a42\" },\n sky: \"#ffffff\",\n ground: \"#7f9bb8\",\n};\n","import { pointInRing, type Point, type Point3, type Ring } from \"@mark1russell7/layout-contract\";\nimport { wallFrames, wallHasOutline, wallPoint, type WallFrame } from \"../frames.ts\";\nimport type { Room } from \"../room.ts\";\nimport { metersPer } from \"../units.ts\";\n\n/** The side of a wall that looks at the room. A wall between two parts of a room has the value `both`. */\nexport type InnerSide = \"left\" | \"right\" | \"both\";\n\n/** A wall, and the side of it that looks at the room. */\nexport interface WallShade {\n readonly frame: WallFrame;\n readonly inner: InnerSide;\n}\n\n/** The distance from a face of a wall to the points that find the floor, in meters. */\nconst PROBE = 0.05;\n\n/** A wall hides the room when it hides a strip of the floor that is deeper than this, in meters. */\nexport const HIDDEN_LIMIT = 0.3;\n\n/** This function gives the distance of a point of the plan across a wall. It is positive to the left of the line of the wall. */\nfunction across(frame: WallFrame, point: Point): number {\n return (point.x - frame.start.x) * frame.left.x + (point.y - frame.start.y) * frame.left.y;\n}\n\n/** This function tells if a floor is next to one face of a wall. `offset` is the distance across of points near that face. */\nfunction hasFloor(frame: WallFrame, offset: number, floors: readonly Ring[]): boolean {\n return [0.25, 0.5, 0.75].some((part) => {\n const point = wallPoint(frame, frame.length * part, offset);\n return floors.some((ring) => pointInRing(point.x, point.y, ring));\n });\n}\n\n/**\n * This function gives each wall that the model makes, with the side that looks at the room.\n *\n * A side looks at the room when a floor is next to it. For a wall with no floor on each side, the side is the side of `center`,\n * a point of the plan in meters. Without a center, such a wall has the value `both`.\n */\nexport function wallShades(room: Room, center?: Point): readonly WallShade[] {\n const scale = metersPer(room.unit);\n const floors = (room.floors ?? []).map((floor): Ring => floor.ring.map(([x, y]) => [x * scale, y * scale] as const));\n return wallFrames(room)\n .filter((frame) => wallHasOutline(frame))\n .map((frame): WallShade => {\n const left = hasFloor(frame, frame.leftOffset + PROBE, floors);\n const right = hasFloor(frame, frame.rightOffset - PROBE, floors);\n if (left !== right) return { frame, inner: left ? \"left\" : \"right\" };\n if (left || center === undefined) return { frame, inner: \"both\" };\n const side = across(frame, center);\n return { frame, inner: side > frame.leftOffset ? \"left\" : side < frame.rightOffset ? \"right\" : \"both\" };\n });\n}\n\n/**\n * This function gives the depth of the strip of the floor that a wall hides from a camera, in meters.\n *\n * `camera` is a point of the room in meters, with the z axis up. A camera above the wall, between its two faces, hides no strip.\n * A camera that is not above the top of the wall hides all of the floor behind the wall, and the depth is `Infinity`.\n */\nexport function hiddenDepth(frame: WallFrame, camera: Point3): number {\n const side = across(frame, camera);\n const gap = side > frame.leftOffset ? side - frame.leftOffset : side < frame.rightOffset ? frame.rightOffset - side : 0;\n if (!(gap > 0)) return 0;\n return camera.z > frame.height ? (frame.height * gap) / (camera.z - frame.height) : Infinity;\n}\n\n/**\n * This function gives the `id` of each wall that hides the room from a camera. A viewer makes these walls almost clear.\n *\n * A wall with one side to the room hides the room when the camera is on its other side.\n * A wall between two parts of a room hides the part behind it from each side.\n * `limit` is the depth of the hidden strip of the floor, in meters, above which a wall hides the room.\n */\nexport function hidingWalls(shades: readonly WallShade[], camera: Point3, limit: number = HIDDEN_LIMIT): ReadonlySet<string> {\n const hiding = new Set<string>();\n for (const { frame, inner } of shades) {\n const side = across(frame, camera);\n const cameraSide = side > frame.leftOffset ? \"left\" : side < frame.rightOffset ? \"right\" : undefined;\n if (cameraSide === undefined || cameraSide === inner) continue;\n if (hiddenDepth(frame, camera) > limit) hiding.add(frame.id);\n }\n return hiding;\n}\n","import type { Point3 } from \"@mark1russell7/layout-contract\";\nimport type { ViewAngles } from \"@mark1russell7/visuals\";\n\n// The space of the viewer has the y axis up. The x axis is the x axis of the plan, and the negative z axis is the y axis of the plan.\n// At an azimuth of 0, the camera is south of the room and it looks north. At a polar angle of 0, it looks down from above.\n\n/** The view of a dollhouse: from the south-east, 38 degrees above the floor. */\nexport const HOME_VIEW: ViewAngles = { polar: (52 * Math.PI) / 180, azimuth: (35 * Math.PI) / 180 };\n\n/** The view of a plan: from above, with north at the top. */\nexport const TOP_VIEW: ViewAngles = { polar: 0, azimuth: 0 };\n\n/** This function gives a point of the room in the space of the viewer: the z axis of the room becomes the y axis. */\nexport function toViewer(point: Point3): Point3 {\n return { x: point.x, y: point.z, z: 0 - point.y };\n}\n\n/** This function gives a point of the viewer in the space of the room: the y axis of the viewer becomes the z axis. */\nexport function toRoom(point: Point3): Point3 {\n return { x: point.x, y: 0 - point.z, z: point.y };\n}\n","import type { Point3 } from \"@mark1russell7/layout-contract\";\nimport type { Highlight } from \"@mark1russell7/visuals\";\nimport { Color, EdgesGeometry, Group, Mesh, MeshLambertMaterial, type BufferGeometry, type Material } from \"three\";\nimport { LineMaterial } from \"three/addons/lines/LineMaterial.js\";\nimport { LineSegments2 } from \"three/addons/lines/LineSegments2.js\";\nimport { LineSegmentsGeometry } from \"three/addons/lines/LineSegmentsGeometry.js\";\nimport { solidRecord } from \"../check.ts\";\nimport { outletLevels, type LoadLevel, type LoadOptions } from \"../loads.ts\";\nimport type { Scene } from \"../room.ts\";\nimport { boundsOfSolids, sceneSolids, solidCorners, TO_Y_UP, type Solid, type SolidKind, type SolidOptions } from \"../solids.ts\";\nimport { metersPer } from \"../units.ts\";\nimport { wallShades, type WallShade } from \"./fade.ts\";\nimport { solidGeometry } from \"./geometry.ts\";\nimport type { ViewerTheme } from \"./theme.ts\";\nimport { toViewer } from \"./view.ts\";\n\n/** One solid of the model as three.js objects. */\nexport interface ModelPart {\n readonly solid: Solid;\n /** The name of the record of the solid, from `solidRecord`. Each part of one wall has the same name. */\n readonly record: string;\n /** The `id` of the wall that the part fades with: the wall itself, the wall of a window or the wall of an outlet. */\n readonly wall: string | undefined;\n /** The name of the record of the object that this object is in or on. */\n readonly holder: string | undefined;\n /** This value is true for an object with other objects in it. Such an object shows as a clear box. */\n readonly holds: boolean;\n /** The level of the circuit of an outlet. An outlet with no circuit has no level, and so has each other part. */\n readonly level: LoadLevel | undefined;\n readonly mesh: Mesh<BufferGeometry, MeshLambertMaterial>;\n readonly lines: LineSegments2;\n /** The fade of the part, from 0 for a solid part to 1 for a part that hides the room. The viewer changes it. */\n fade: number;\n}\n\n/** The model of a scene as three.js objects. */\nexport interface RoomModel {\n /** The group of each part. It has the rotation from the room to the space of the viewer. */\n readonly group: Group;\n readonly parts: readonly ModelPart[];\n /** Each corner of each solid, in the space of the viewer. */\n readonly corners: readonly Point3[];\n /** The center of the model, in the space of the viewer. */\n readonly center: Point3;\n /** The walls of the room, each with the side that looks at the room. */\n readonly shades: readonly WallShade[];\n}\n\n/** The width of the edges of each kind of solid, in CSS pixels. */\nconst EDGE_WIDTH: Readonly<Record<SolidKind, number>> = { floor: 1.25, wall: 1.25, glass: 1, outlet: 1, object: 1.25 };\n\n/** The part of a clear box of objects that is not clear. */\nconst HOLDER_OPACITY = 0.14;\n\n/** A part with an opacity above this value writes its depth, as a solid part does. */\nconst SOLID_OPACITY = 0.999;\n\n/** This function gives the `id` of each placed object that has an object in its box. */\nfunction holders(scene: Scene): ReadonlySet<string> {\n const scale = metersPer(scene.room.unit);\n const objects = new Map((scene.objects ?? []).map((object) => [object.id, object] as const));\n const found = new Set<string>();\n for (const object of scene.objects ?? []) {\n const parent = object.parent === undefined ? undefined : objects.get(object.parent);\n if (parent === undefined) continue;\n const x = object.at[0] * scale;\n const y = object.at[1] * scale;\n const z = ((object.lift ?? 0) + object.size[2] / 2) * scale;\n const [w, h, d] = [parent.size[0] * scale, parent.size[1] * scale, parent.size[2] * scale];\n if (Math.abs(x) < w / 2 && Math.abs(y) < h / 2 && z > 0 && z < d) found.add(parent.id);\n }\n return found;\n}\n\n/**\n * This function makes the three.js objects of a scene: one mesh with its edges for each solid.\n * The parts have no colors until `paintPart` gives them. The caller disposes the model with `disposeModel`.\n */\nexport function buildModel(scene: Scene, options: SolidOptions = {}, loads: LoadOptions = {}): RoomModel {\n const solids = sceneSolids(scene, options);\n const levels = outletLevels(scene, loads);\n const wallOfOpening = new Map((scene.room.openings ?? []).map((opening) => [opening.id, opening.wall] as const));\n const wallOfOutlet = new Map((scene.room.outlets ?? []).map((outlet) => [outlet.id, outlet.wall] as const));\n const parentOf = new Map((scene.objects ?? []).map((object) => [object.id, object.parent] as const));\n const holding = holders(scene);\n const group = new Group();\n group.quaternion.set(TO_Y_UP.rotation.x, TO_Y_UP.rotation.y, TO_Y_UP.rotation.z, TO_Y_UP.rotation.w);\n const parts = solids.map((solid): ModelPart => {\n const { geometry, position, rotation } = solidGeometry(solid);\n const mesh = new Mesh(geometry, new MeshLambertMaterial({ polygonOffset: true, polygonOffsetFactor: 1, polygonOffsetUnits: 1 }));\n mesh.position.set(position.x, position.y, position.z);\n mesh.quaternion.set(rotation.x, rotation.y, rotation.z, rotation.w);\n const edges = new EdgesGeometry(geometry, 30);\n const lines = new LineSegments2(new LineSegmentsGeometry().fromEdgesGeometry(edges), new LineMaterial({ linewidth: EDGE_WIDTH[solid.kind] }));\n edges.dispose();\n mesh.add(lines);\n group.add(mesh);\n const parent = solid.kind === \"object\" ? parentOf.get(solid.source) : undefined;\n return {\n solid,\n record: solidRecord(solid.kind, solid.source),\n wall: solid.kind === \"wall\" ? solid.source : solid.kind === \"glass\" ? wallOfOpening.get(solid.source) : solid.kind === \"outlet\" ? wallOfOutlet.get(solid.source) : undefined,\n holder: parent === undefined ? undefined : solidRecord(\"object\", parent),\n holds: solid.kind === \"object\" && holding.has(solid.source),\n level: solid.kind === \"outlet\" ? levels.get(solid.source) : undefined,\n mesh,\n lines,\n fade: 0,\n };\n });\n // A pick uses the place of each mesh in the world before the first picture.\n group.updateMatrixWorld(true);\n const bounds = boundsOfSolids(solids);\n const middle = bounds === undefined ? { x: 0, y: 0, z: 0 } : { x: bounds.x + bounds.w / 2, y: bounds.y + bounds.h / 2, z: bounds.z + bounds.d / 2 };\n return {\n group,\n parts,\n corners: solids.flatMap((solid) => solidCorners(solid).map((corner) => toViewer(corner))),\n center: toViewer(middle),\n shades: wallShades(scene.room, bounds === undefined ? undefined : middle),\n };\n}\n\n/** This function sets the opacity of a material. A material that is not solid does not write its depth. */\nfunction setOpacity(material: Material, opacity: number): void {\n const clear = opacity < SOLID_OPACITY;\n if (material.transparent !== clear) {\n material.transparent = clear;\n material.depthWrite = !clear;\n material.needsUpdate = true;\n }\n material.opacity = opacity;\n}\n\n/** This function gives the color of a part in a theme, before a mark. */\nfunction baseColor(part: ModelPart, scene: Scene, theme: ViewerTheme): string {\n const kind = part.solid.kind;\n if (kind === \"outlet\") return part.level === undefined ? theme.outlet : theme.levels[part.level];\n if (kind !== \"object\") return theme[kind];\n const object = (scene.objects ?? []).find((candidate) => candidate.id === part.solid.source);\n return (object === undefined ? undefined : theme.objects[object.kind]) ?? theme.object;\n}\n\n/**\n * This function gives a part its colors: the colors of the theme, the fade of the part and its highlight.\n * A part with a highlight has some of the color `accent` of the theme, and a selected part has wide edges.\n * An outlet has the color of the level of its circuit.\n */\nexport function paintPart(part: ModelPart, scene: Scene, theme: ViewerTheme, mark: Highlight): void {\n const kind = part.solid.kind;\n const fill = part.mesh.material;\n const ink = part.lines.material;\n const color = baseColor(part, scene, theme);\n fill.color.set(color);\n if (mark !== 0) fill.color.lerp(new Color(theme.accent), mark === 2 ? 0.55 : 0.3);\n ink.color.set(theme.edge);\n ink.linewidth = EDGE_WIDTH[kind] * (mark === 2 ? 2 : 1);\n const still = 1 - part.fade;\n let opacity = kind === \"glass\" ? theme.glassOpacity : part.holds ? (mark === 0 ? HOLDER_OPACITY : 0.45) : 1;\n let edge = 1;\n if (kind === \"wall\") {\n opacity *= 0.08 + 0.92 * still;\n edge = 0.3 + 0.7 * still;\n } else if (kind === \"glass\" || kind === \"outlet\") {\n opacity *= 0.35 + 0.65 * still;\n edge = 0.35 + 0.65 * still;\n }\n setOpacity(fill, opacity);\n setOpacity(ink, edge);\n}\n\n/** This function releases the memory of the graphics card that a model uses. */\nexport function disposeModel(model: RoomModel): void {\n for (const part of model.parts) {\n part.mesh.geometry.dispose();\n part.mesh.material.dispose();\n part.lines.geometry.dispose();\n part.lines.material.dispose();\n }\n model.group.clear();\n}\n","import type { Highlight } from \"@mark1russell7/visuals\";\nimport type { StageContent, StageFrame, StagePick } from \"@mark1russell7/visuals/three\";\nimport type { Object3D, Raycaster } from \"three\";\nimport type { LoadOptions } from \"../loads.ts\";\nimport type { Scene } from \"../room.ts\";\nimport type { Solid, SolidKind, SolidOptions } from \"../solids.ts\";\nimport { hidingWalls } from \"./fade.ts\";\nimport { buildModel, disposeModel, paintPart, type ModelPart } from \"./model.ts\";\nimport type { ViewerTheme } from \"./theme.ts\";\nimport { toRoom } from \"./view.ts\";\n\n/** A record of a scene that the viewer shows: a floor, a wall, a window, an outlet or a placed object. */\nexport interface ViewerRecord {\n /** The kind of the solids of the record. A window has the kind `glass`. */\n readonly kind: SolidKind;\n /** The `id` of the record in the scene. */\n readonly source: string;\n}\n\n/** The solid under the pointer, with its record. */\nexport interface ViewerPick extends ViewerRecord {\n /** The `id` of the solid. A wall with openings has more than one solid. */\n readonly solid: string;\n}\n\n/** The content of a stage that shows the solids of a scene. The value of a pick is the solid. */\nexport interface RoomContent extends StageContent<ViewerPick, ViewerTheme> {\n /** The solids of the scene. */\n readonly solids: readonly Solid[];\n /** This function gives the first solid of a record with a name, as a pick. A name of no record of the content gives `undefined`. */\n pickOf(record: string): ViewerPick | undefined;\n}\n\n/** The time in which a wall goes most of the way to clear or to solid, in seconds. */\nexport const FADE_TIME = 0.11;\n\n/**\n * This function makes the content of a stage that shows the solids of a scene.\n * The solids are the floors, the walls, the windows, the plates of the outlets and the placed objects.\n *\n * The walls between the camera and the room become almost clear, and the pointer goes through them.\n * An object in a clear box of objects gets the pick before the box. Each pick has its distance, so a mark in front of a solid gets the pick.\n * The space of the content has the y axis up: the z axis of the scene becomes the y axis.\n */\nexport function createRoomContent(scene: Scene, solids: SolidOptions = {}, loads: LoadOptions = {}): RoomContent {\n const model = buildModel(scene, solids, loads);\n const first = new Map<string, ModelPart>();\n for (const part of model.parts) if (!first.has(part.record)) first.set(part.record, part);\n const byMesh = new Map<Object3D, ModelPart>(model.parts.map((part) => [part.mesh, part]));\n const pickOfPart = (part: ModelPart): ViewerPick => ({ solid: part.solid.id, kind: part.solid.kind, source: part.solid.source });\n\n /** The walls that hide the room from the camera of the last step. */\n let hiding: ReadonlySet<string> = new Set();\n let theme: ViewerTheme | undefined;\n let highlightOf: (record: string) => Highlight = () => 0;\n const paintOne = (part: ModelPart): void => {\n if (theme !== undefined) paintPart(part, scene, theme, highlightOf(part.record));\n };\n\n return {\n objects: [model.group],\n extent: { corners: model.corners, center: model.center },\n solids: model.parts.map((part) => part.solid),\n has: (record) => first.has(record),\n pickOf(record): ViewerPick | undefined {\n const part = first.get(record);\n return part === undefined ? undefined : pickOfPart(part);\n },\n pick(ray: Raycaster): StagePick<ViewerPick> | undefined {\n // A wall that hides the room is clear, and the pointer goes through it.\n const open = model.parts.filter((part) => part.wall === undefined || !hiding.has(part.wall)).map((part) => part.mesh);\n const hits = ray.intersectObjects(open, false);\n const nearest = hits[0];\n const found = nearest === undefined ? undefined : byMesh.get(nearest.object);\n if (nearest === undefined || found === undefined) return undefined;\n if (found.holds) {\n // A clear box of objects: the pointer selects an object in the box before the box.\n for (const hit of hits) {\n const part = byMesh.get(hit.object);\n if (part !== undefined && part.holder === found.record) return { record: part.record, value: pickOfPart(part), distance: hit.distance };\n }\n }\n return { record: found.record, value: pickOfPart(found), distance: nearest.distance };\n },\n paint(nextTheme, highlight): void {\n theme = nextTheme;\n highlightOf = highlight;\n for (const part of model.parts) paintOne(part);\n },\n step(frame: StageFrame): boolean {\n hiding = hidingWalls(model.shades, toRoom(frame.camera.position));\n // Each wall goes to its goal: clear for a wall that hides the room, solid for each other wall.\n const rate = frame.settle ? 1 : 1 - Math.exp(0 - frame.seconds / FADE_TIME);\n let active = false;\n for (const part of model.parts) {\n if (part.wall === undefined) continue;\n const goal = hiding.has(part.wall) ? 1 : 0;\n if (part.fade === goal) continue;\n const next = part.fade + (goal - part.fade) * rate;\n part.fade = Math.abs(goal - next) < 0.01 ? goal : next;\n paintOne(part);\n active = active || part.fade !== goal;\n }\n return active;\n },\n dispose(): void {\n disposeModel(model);\n },\n };\n}\n","import { addPoints3, scalePoint3, type Point3 } from \"@mark1russell7/layout-contract\";\nimport type { LinkMark, Mark, PointMark } from \"@mark1russell7/visuals/marks\";\nimport { sceneSpace } from \"../anchors.ts\";\nimport { recordName } from \"../check.ts\";\nimport { outletLevels, type LoadOptions } from \"../loads.ts\";\nimport type { Scene } from \"../room.ts\";\nimport { OUTLET_PLATE, solidCorners, type Solid } from \"../solids.ts\";\n\n/** This function gives the center of a solid, in the space of the scene: the mean of its corners. */\nfunction centerOf(solid: Solid): Point3 {\n const corners = solidCorners(solid);\n const sum = corners.reduce((total, corner) => addPoints3(total, corner), { x: 0, y: 0, z: 0 });\n return scalePoint3(sum, 1 / Math.max(corners.length, 1));\n}\n\n/**\n * This function gives the marks of the outlets of a scene, in the space of the scene: meters, with the z axis up.\n *\n * - An outlet gives a point on the front of its plate. Its level is the level of its circuit, and `unknown` for no circuit of the room.\n * - A placed object with an outlet gives a link from that outlet to the center of the object.\n *\n * The record name of a point is the name of the record of its outlet, so the sign and the plate are one record.\n * The record name of a link is the name of the record of its object: that record has the outlet.\n * `solids` are the solids of the scene. An outlet or an object with no solid gives no mark. The first record of an `id` gives the mark.\n */\nexport function outletMarks(scene: Scene, solids: readonly Solid[], loads: LoadOptions = {}): readonly Mark[] {\n const space = sceneSpace(scene);\n const levels = outletLevels(scene, loads);\n /** The first solid of each outlet and of each placed object, by the name of its record. */\n const made = new Map<string, Solid>();\n for (const solid of solids) {\n const name = recordName(solid.kind, solid.source);\n if ((solid.kind === \"outlet\" || solid.kind === \"object\") && !made.has(name)) made.set(name, solid);\n }\n const circuits = new Map((scene.room.circuits ?? []).map((circuit) => [circuit.id, circuit.name ?? circuit.id] as const));\n const marks: Mark[] = [];\n\n const fronts = new Map<string, Point3>();\n for (const outlet of scene.room.outlets ?? []) {\n if (fronts.has(outlet.id) || !made.has(recordName(\"outlet\", outlet.id))) continue;\n const frame = space.frame({ on: \"wall\", wall: outlet.wall, face: outlet.face, offset: outlet.offset, height: outlet.height });\n if (frame === undefined) continue;\n // The plate is on the face of the wall, so its front is one depth of the plate out of the wall.\n const front = addPoints3(frame.at, scalePoint3(frame.out, OUTLET_PLATE.depth));\n fronts.set(outlet.id, front);\n const level = levels.get(outlet.id);\n const circuit = level === undefined || outlet.circuit === undefined ? \"\" : `, circuit ${circuits.get(outlet.circuit) ?? outlet.circuit}`;\n const point: PointMark = {\n type: \"point\",\n record: recordName(\"outlet\", outlet.id),\n kind: \"outlet\",\n level: level ?? \"unknown\",\n label: `Outlet ${outlet.id}${circuit}`.replace(/\\s+/g, \" \").trim(),\n frame: { at: front, out: frame.out },\n };\n marks.push(point);\n }\n\n const linked = new Set<string>();\n for (const object of scene.objects ?? []) {\n const from = object.outlet === undefined ? undefined : fronts.get(object.outlet);\n const solid = made.get(recordName(\"object\", object.id));\n if (object.outlet === undefined || from === undefined || solid === undefined || linked.has(object.id)) continue;\n linked.add(object.id);\n const link: LinkMark = {\n type: \"link\",\n record: recordName(\"object\", object.id),\n kind: \"feed\",\n level: levels.get(object.outlet) ?? \"unknown\",\n label: `Outlet ${object.outlet} to ${object.name ?? object.id}`.replace(/\\s+/g, \" \").trim(),\n from: { record: recordName(\"outlet\", object.outlet), at: from },\n to: { record: recordName(\"object\", object.id), at: centerOf(solid) },\n };\n marks.push(link);\n }\n return marks;\n}\n","import { fitView } from \"@mark1russell7/visuals\";\nimport { createMarkers, type MarkersOptions, type MarkersTheme } from \"@mark1russell7/visuals/markers\";\nimport { checkMarks, transformMarks, type Mark } from \"@mark1russell7/visuals/marks\";\nimport { createStage, stackContents, type StageContent } from \"@mark1russell7/visuals/three\";\nimport { solidRecord } from \"../check.ts\";\nimport type { LoadOptions } from \"../loads.ts\";\nimport type { Scene } from \"../room.ts\";\nimport { TO_Y_UP, type SolidOptions } from \"../solids.ts\";\nimport { createRoomContent, type ViewerPick, type ViewerRecord } from \"./content.ts\";\nimport { outletMarks } from \"./outlets.ts\";\nimport { LIGHT_THEME, type ViewerTheme } from \"./theme.ts\";\nimport { HOME_VIEW, TOP_VIEW } from \"./view.ts\";\n\nexport type { ViewerPick, ViewerRecord } from \"./content.ts\";\n\n/** The name of a view: `home` looks into the room from a corner above it, and `top` shows the plan. */\nexport type ViewName = \"home\" | \"top\";\n\n/** The options of a viewer. */\nexport interface RoomViewerOptions {\n readonly scene: Scene;\n /** The colors. The default is `LIGHT_THEME`. */\n readonly theme?: ViewerTheme | undefined;\n /** The options of the model. */\n readonly solids?: SolidOptions | undefined;\n /** The options of the levels of the circuits. */\n readonly loads?: LoadOptions | undefined;\n /** The options of the picture of the marks, for example the radius of a sign. */\n readonly markers?: MarkersOptions | undefined;\n /**\n * The marks of the scene, in the space of the scene: meters, with the z axis up. `layerMarks` of the entry `/marks` gives them.\n * With no list, the viewer makes the marks of the outlets of the scene. An empty list gives a picture with no mark.\n * The viewer draws no mark with a fault. `checkMarks` of `@mark1russell7/visuals/marks` tells each fault.\n */\n readonly marks?: readonly Mark[] | undefined;\n /** The name of the picture for a screen reader. */\n readonly label?: string | undefined;\n /**\n * The viewer starts this function when the pointer goes to a different record, or to no record.\n * `mark` is the mark under the pointer. `pick` is then the first solid of the record of the mark, or `undefined` for a record with no solid.\n */\n readonly onHover?: ((pick: ViewerPick | undefined, mark?: Mark) => void) | undefined;\n /** The viewer starts this function when a person selects a record with the pointer, or selects no record. The parameters are those of `onHover`. */\n readonly onSelect?: ((pick: ViewerPick | undefined, mark?: Mark) => void) | undefined;\n}\n\n/** A viewer of one scene in a page. */\nexport interface RoomViewer {\n /** The canvas of the viewer. It is in the container. */\n readonly canvas: HTMLCanvasElement;\n /**\n * This function shows a different scene, with its marks. The view stays if a person moved it.\n * With no list of marks, the viewer makes the marks of the outlets of the scene.\n */\n setScene(scene: Scene, marks?: readonly Mark[]): void;\n /** This function changes the colors. */\n setTheme(theme: ViewerTheme): void;\n /** This function moves the camera to a view that shows all of the model. */\n setView(view: ViewName): void;\n /**\n * This function highlights records, as the pointer does. An empty list removes the highlights.\n * A record is a record of a solid, or the record name of a mark, for example `electrical/1:nook-2`.\n */\n highlight(records: readonly (ViewerRecord | string)[]): void;\n /** This function selects one record, or no record. It does not start `onSelect`. */\n select(record: ViewerRecord | string | undefined): void;\n /**\n * This function shows only the marks that a test accepts, for example the marks of one kind. The pointer does not find a mark that the picture does not show.\n * The test stays for each subsequent scene. A test that accepts each mark shows all of them again.\n */\n showMarks(test: (mark: Mark) => boolean): void;\n /** This function removes the canvas and releases the memory of the graphics card. */\n dispose(): void;\n}\n\n/** The options of the content of a viewer: the options of the model, of the levels and of the picture of the marks. */\nexport type ViewerContentOptions = Pick<RoomViewerOptions, \"solids\" | \"loads\" | \"markers\">;\n\n/** The record under the pointer for the stage: a solid of the room, or a mark. */\nexport type StageValue = ViewerPick | Mark;\n\n/** This function gives the name of a record for the stage. */\nexport function nameOf(record: ViewerRecord | string): string {\n return typeof record === \"string\" ? record : solidRecord(record.kind, record.source);\n}\n\n/**\n * This function makes a function that gives the colors of the marks of a viewer theme.\n * The marks paint each field again for a new theme object. So the function gives the same object while the viewer theme is the same.\n * A theme with no colors of a field gives a field the color of its level.\n */\nexport function marksThemes(): (theme: ViewerTheme) => MarkersTheme {\n let from: ViewerTheme | undefined;\n let to: MarkersTheme | undefined;\n return (theme) => {\n if (to === undefined || theme !== from) {\n to = { sky: theme.sky, ground: theme.ground, levels: theme.levels, halo: theme.halo, accent: theme.accent, field: theme.field ?? [], fieldOpacity: theme.fieldOpacity };\n }\n from = theme;\n return to;\n };\n}\n\n/** The content of a viewer for one scene, with the functions that use its marks. */\nexport interface ViewerContent {\n /** The solids of the scene, and its marks above them. */\n readonly content: StageContent<StageValue, ViewerTheme>;\n /** This function shows only the marks that a test accepts. The test gets each mark as the scene has it. */\n show(test: (mark: Mark) => boolean): void;\n /**\n * This function gives a record of the stage as a page gets it.\n * A mark gives the first solid of its record and the mark as the scene has it. A solid gives the solid.\n */\n told(value: StageValue | undefined): readonly [pick: ViewerPick | undefined, mark: Mark | undefined];\n}\n\n/**\n * This function makes the content of a viewer for a scene: the solids, and the marks above them.\n *\n * `marks` are in the space of the scene: meters, with the z axis up. With no list, the function makes the marks of the outlets of the scene.\n * A mark with a fault is not in the content. The space of the content has the y axis up.\n */\nexport function createViewerContent(scene: Scene, marks?: readonly Mark[], options: ViewerContentOptions = {}): ViewerContent {\n const room = createRoomContent(scene, options.solids, options.loads);\n const given = marks ?? outletMarks(scene, room.solids, options.loads);\n const faulty = new Set(checkMarks(given).map((fault) => fault.index));\n const good = given.filter((_, index) => !faulty.has(index));\n const onStage = transformMarks(good, TO_Y_UP);\n /** The mark of the scene for each mark of the stage. */\n const inScene = new Map<Mark, Mark>(onStage.map((mark, index) => [mark, good[index] ?? mark]));\n const sceneMark = (mark: Mark): Mark => inScene.get(mark) ?? mark;\n const markers = createMarkers(onStage, options.markers);\n const themeOf = marksThemes();\n const above: StageContent<StageValue, ViewerTheme> = {\n objects: markers.objects,\n extent: markers.extent,\n has: (record) => markers.has(record),\n pick: (ray) => markers.pick(ray),\n paint(theme, highlight): void {\n markers.paint(themeOf(theme), highlight);\n },\n step: (frame) => markers.step?.(frame) ?? false,\n dispose(): void {\n markers.dispose();\n },\n };\n return {\n content: stackContents<StageValue, ViewerTheme>([room, above]),\n show(test): void {\n markers.show((mark) => test(sceneMark(mark)));\n },\n told(value) {\n if (value === undefined) return [undefined, undefined];\n return \"type\" in value ? [room.pickOf(value.record), sceneMark(value)] : [value, undefined];\n },\n };\n}\n\n/**\n * This function makes a viewer of a scene in a container of a page. The viewer fills the container, so give the container a size.\n *\n * A person turns the model with a drag, and moves nearer with the wheel after a click in the picture.\n * The walls between the camera and the room become almost clear. A click selects the record of a solid or of a mark.\n * With the keyboard, the arrow keys turn the model, `+` and `-` change the distance, `Home` shows the first view and `T` shows the plan.\n *\n * The viewer draws the marks of the scene with `@mark1russell7/visuals/markers`. A point is a sign with the color and the shape of its level.\n * With no list of marks, each outlet has a sign. An outlet or an object with a highlight then shows a line from the outlet to each object on it.\n *\n * The function gives `undefined` when the browser has no WebGL 2. It does not throw, and it writes no error to the console.\n */\nexport function createRoomViewer(container: HTMLElement, options: RoomViewerOptions): RoomViewer | undefined {\n let accepted: (mark: Mark) => boolean = () => true;\n let current = createViewerContent(options.scene, options.marks, options);\n /** This function gives a record of the stage to a function of the page. */\n const tell = (to: ((pick: ViewerPick | undefined, mark?: Mark) => void) | undefined, value: StageValue | undefined): void => {\n if (to === undefined) return;\n const [pick, mark] = current.told(value);\n if (mark === undefined) to(pick);\n else to(pick, mark);\n };\n\n const stage = createStage<StageValue, ViewerTheme>(container, {\n content: current.content,\n theme: options.theme ?? LIGHT_THEME,\n label: options.label ?? \"3D model of the room\",\n views: { home: fitView(HOME_VIEW), top: fitView(TOP_VIEW) },\n home: \"home\",\n keys: { t: \"top\" },\n onHover: (value) => tell(options.onHover, value),\n onSelect: (value) => tell(options.onSelect, value),\n });\n if (stage === undefined) {\n current.content.dispose();\n return undefined;\n }\n\n return {\n canvas: stage.canvas,\n setScene(scene: Scene, marks?: readonly Mark[]): void {\n current = createViewerContent(scene, marks, options);\n current.show(accepted);\n stage.setContent(current.content);\n },\n setTheme(theme: ViewerTheme): void {\n stage.setTheme(theme);\n },\n setView(view: ViewName): void {\n stage.setView(view);\n },\n highlight(records: readonly (ViewerRecord | string)[]): void {\n stage.highlight(records.map(nameOf));\n },\n select(record: ViewerRecord | string | undefined): void {\n stage.select(record === undefined ? undefined : nameOf(record));\n },\n showMarks(test: (mark: Mark) => boolean): void {\n accepted = test;\n current.show(test);\n stage.refresh();\n },\n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IAAI,MAAM,CAAC;EACrC;EACA,OAAO,QAAiD;GACtD,MAAM,OAAO,WAAW,KAAA,IAAY,KAAA,IAAY,OAAO,MAAM,CAAC;EAChE;EACA,UAAU,MAAqC;GAC7C,WAAW;GACX,QAAQ,KAAK,IAAI;GACjB,MAAM,QAAQ;EAChB;EACA,UAAgB;GACd,MAAM,QAAQ;EAChB;CACF;AACF"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@mark1russell7/room-view",
4
- "version": "0.2.2",
4
+ "version": "0.2.4",
5
5
  "description": "A room as data, and its 3D model from that data: walls with openings, floors, outlets, circuits and placed objects.",
6
6
  "license": "MIT",
7
7
  "repository": {