@kruschdev/pascal-plugin-mit-assets 0.0.0-stage → 0.1.0
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.
- package/ASSETS.md +298 -0
- package/LICENSE +21 -0
- package/README.md +71 -2
- package/dist/agent-operations.d.ts +8 -0
- package/dist/agent-operations.js +305 -0
- package/dist/agent-tools.d.ts +7 -0
- package/dist/agent-tools.js +128 -0
- package/dist/audit.d.ts +78 -0
- package/dist/bin/pascal-mit-assets.js +5238 -0
- package/dist/bom.d.ts +123 -0
- package/dist/cad/appliance-mep-builders.d.ts +7 -0
- package/dist/cad/furniture-builders.d.ts +9 -0
- package/dist/cad/index.d.ts +48 -0
- package/dist/cad/index.js +23 -0
- package/dist/cad/kitchen-bath-builders.d.ts +9 -0
- package/dist/cad/outdoor-fenestration-builders.d.ts +8 -0
- package/dist/cad/primitives.d.ts +56 -0
- package/dist/cad/props-vehicles-builders.d.ts +8 -0
- package/dist/chunk-2qgndrap.js +5200 -0
- package/dist/chunk-6hzyh6qv.js +346 -0
- package/dist/chunk-f72r2bmp.js +84 -0
- package/dist/chunk-hqgm57dv.js +310 -0
- package/dist/chunk-kgwk6kan.js +150 -0
- package/dist/chunk-raafkn3w.js +286 -0
- package/dist/chunk-vzmjt9dz.js +4380 -0
- package/dist/chunk-xhkwv6t4.js +5080 -0
- package/dist/hdri/index.d.ts +1 -0
- package/dist/hdri/index.js +322 -0
- package/dist/hdri/sky.d.ts +26 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +198 -0
- package/dist/manifest.d.ts +46 -0
- package/dist/materials/index.d.ts +10 -0
- package/dist/materials/index.js +1464 -0
- package/dist/materials/ktx2.d.ts +10 -0
- package/dist/materials/noise.d.ts +89 -0
- package/dist/materials/patterns.d.ts +15 -0
- package/dist/nodes/mit-item.d.ts +76 -0
- package/dist/render.d.ts +10 -0
- package/dist/render.js +24 -0
- package/dist/scripts/build-assets.js +17129 -0
- package/dist/sfx/index.d.ts +1 -0
- package/dist/sfx/index.js +1223 -0
- package/dist/sfx/synth.d.ts +25 -0
- package/dist/sku-crosswalk.d.ts +46 -0
- package/dist/ui/chat-card.d.ts +7 -0
- package/dist/ui/host-panel.d.ts +1 -0
- package/dist/ui/inspector-card.d.ts +4 -0
- package/dist/ui/schedule-view.d.ts +1 -0
- package/package.json +135 -4
- package/src/agent-operations.ts +373 -0
- package/src/agent-tools.ts +136 -0
- package/src/audit.ts +356 -0
- package/src/bom.ts +512 -0
- package/src/cad/appliance-mep-builders.ts +1336 -0
- package/src/cad/furniture-builders.ts +1622 -0
- package/src/cad/index.ts +993 -0
- package/src/cad/kitchen-bath-builders.ts +1189 -0
- package/src/cad/outdoor-fenestration-builders.ts +1499 -0
- package/src/cad/primitives.ts +286 -0
- package/src/cad/props-vehicles-builders.ts +1065 -0
- package/src/hdri/index.ts +5 -0
- package/src/hdri/sky.ts +481 -0
- package/src/index.ts +127 -0
- package/src/manifest.ts +5296 -0
- package/src/materials/index.ts +56 -0
- package/src/materials/ktx2.ts +138 -0
- package/src/materials/noise.ts +417 -0
- package/src/materials/patterns.ts +1507 -0
- package/src/nodes/mit-item.ts +163 -0
- package/src/render.ts +25 -0
- package/src/sfx/index.ts +6 -0
- package/src/sfx/synth.ts +1495 -0
- package/src/sku-crosswalk.ts +3868 -0
- package/src/ui/chat-card.tsx +93 -0
- package/src/ui/host-panel.tsx +330 -0
- package/src/ui/inspector-card.tsx +213 -0
- package/src/ui/schedule-view.tsx +188 -0
|
@@ -0,0 +1,1336 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clean-room MIT Parametric 3D CAD Builders: Appliances, HVAC, MEP & Safety.
|
|
3
|
+
* Strictly Three.js + ./primitives only. Zero React, @pascal-app/*, Next, or node:* imports.
|
|
4
|
+
* Never caches global materials; uses only the passed MaterialPalette.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as THREE from 'three'
|
|
8
|
+
import {
|
|
9
|
+
addBox,
|
|
10
|
+
addCyl,
|
|
11
|
+
addRoundedRectExtrude,
|
|
12
|
+
addSphere,
|
|
13
|
+
addTorus,
|
|
14
|
+
normalizeAndGroundGroup,
|
|
15
|
+
type MaterialPalette,
|
|
16
|
+
type SlugBuilderFn,
|
|
17
|
+
} from './primitives'
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Helper to add a concentric circular fan grille + swept blades.
|
|
21
|
+
* `axis` is 'y' for top-discharge condensers or 'z' for front-discharge units.
|
|
22
|
+
*/
|
|
23
|
+
function addFanAssembly(
|
|
24
|
+
parent: THREE.Object3D,
|
|
25
|
+
radius: number,
|
|
26
|
+
x: number,
|
|
27
|
+
y: number,
|
|
28
|
+
z: number,
|
|
29
|
+
axis: 'y' | 'z',
|
|
30
|
+
bladeCount: number,
|
|
31
|
+
p: MaterialPalette,
|
|
32
|
+
): void {
|
|
33
|
+
const fanGroup = new THREE.Group()
|
|
34
|
+
fanGroup.position.set(x, y, z)
|
|
35
|
+
if (axis === 'z') {
|
|
36
|
+
fanGroup.rotation.x = Math.PI / 2
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Dark recessed shroud cavity & rim proudly seated above cabinet top/front plate (zero Z-fighting)
|
|
40
|
+
const depth = Math.max(0.024, radius * 0.22)
|
|
41
|
+
addCyl(fanGroup, radius, radius, depth, 0, -depth * 0.32, 0, p.plasticDark, 24)
|
|
42
|
+
addTorus(fanGroup, radius, Math.max(0.01, radius * 0.045), 0, depth * 0.16, 0, p.metalDark, [
|
|
43
|
+
Math.PI / 2,
|
|
44
|
+
0,
|
|
45
|
+
0,
|
|
46
|
+
])
|
|
47
|
+
|
|
48
|
+
// Motor hub + angled fan blades cleanly above shroud floor
|
|
49
|
+
addCyl(fanGroup, radius * 0.2, radius * 0.22, depth * 0.55, 0, 0.002, 0, p.metalBrushed, 14)
|
|
50
|
+
for (let i = 0; i < bladeCount; i++) {
|
|
51
|
+
const angle = (i / bladeCount) * Math.PI * 2
|
|
52
|
+
const bladeHolder = new THREE.Group()
|
|
53
|
+
bladeHolder.rotation.y = angle
|
|
54
|
+
addBox(
|
|
55
|
+
bladeHolder,
|
|
56
|
+
radius * 0.72,
|
|
57
|
+
Math.max(0.006, radius * 0.03),
|
|
58
|
+
radius * 0.28,
|
|
59
|
+
radius * 0.48,
|
|
60
|
+
depth * 0.04,
|
|
61
|
+
0,
|
|
62
|
+
p.metalDark,
|
|
63
|
+
[0.34, 0, 0],
|
|
64
|
+
)
|
|
65
|
+
fanGroup.add(bladeHolder)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Concentric safety wire grille rings + 4 cross spokes proudly clear of blades
|
|
69
|
+
const wireR = Math.max(0.0035, radius * 0.016)
|
|
70
|
+
for (const frac of [0.35, 0.62, 0.88]) {
|
|
71
|
+
addTorus(fanGroup, radius * frac, wireR, 0, depth * 0.24, 0, p.metalDark, [Math.PI / 2, 0, 0])
|
|
72
|
+
}
|
|
73
|
+
for (let i = 0; i < 4; i++) {
|
|
74
|
+
const a = (i * Math.PI) / 4
|
|
75
|
+
addBox(
|
|
76
|
+
fanGroup,
|
|
77
|
+
radius * 1.96,
|
|
78
|
+
wireR * 2,
|
|
79
|
+
wireR * 2,
|
|
80
|
+
0,
|
|
81
|
+
depth * 0.25,
|
|
82
|
+
0,
|
|
83
|
+
p.metalDark,
|
|
84
|
+
[0, a, 0],
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
parent.add(fanGroup)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// ---------------------------------------------------------------------------
|
|
92
|
+
// HVAC & MEP (9)
|
|
93
|
+
// ---------------------------------------------------------------------------
|
|
94
|
+
|
|
95
|
+
const buildAcBlock: SlugBuilderFn = (w, h, d, p) => {
|
|
96
|
+
const g = new THREE.Group()
|
|
97
|
+
const footH = h * 0.06
|
|
98
|
+
const bodyH = h - footH
|
|
99
|
+
const bodyW = w * 0.94
|
|
100
|
+
const bodyD = d * 0.94
|
|
101
|
+
|
|
102
|
+
// 4 rubber anti-vibration feet
|
|
103
|
+
for (const sx of [-1, 1]) {
|
|
104
|
+
for (const sz of [-1, 1]) {
|
|
105
|
+
addBox(
|
|
106
|
+
g,
|
|
107
|
+
w * 0.14,
|
|
108
|
+
footH,
|
|
109
|
+
d * 0.14,
|
|
110
|
+
sx * (bodyW * 0.38),
|
|
111
|
+
footH / 2,
|
|
112
|
+
sz * (bodyD * 0.38),
|
|
113
|
+
p.rubberBlack,
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Base pan & top stamped cap
|
|
119
|
+
addBox(g, bodyW, bodyH * 0.08, bodyD, 0, footH + bodyH * 0.04, 0, p.metalDark)
|
|
120
|
+
addBox(g, bodyW * 1.02, bodyH * 0.07, bodyD * 1.02, 0, footH + bodyH * 0.965, 0, p.metalBrushed)
|
|
121
|
+
|
|
122
|
+
// Recessed dark condenser coil core
|
|
123
|
+
const coreH = bodyH * 0.86
|
|
124
|
+
const coreY = footH + bodyH * 0.51
|
|
125
|
+
addBox(g, bodyW * 0.86, coreH, bodyD * 0.86, 0, coreY, 0, p.plasticDark)
|
|
126
|
+
|
|
127
|
+
// Corner structural sheet-metal posts
|
|
128
|
+
const postW = bodyW * 0.11
|
|
129
|
+
for (const sx of [-1, 1]) {
|
|
130
|
+
for (const sz of [-1, 1]) {
|
|
131
|
+
addBox(
|
|
132
|
+
g,
|
|
133
|
+
postW,
|
|
134
|
+
coreH,
|
|
135
|
+
postW,
|
|
136
|
+
sx * (bodyW * 0.5 - postW * 0.5),
|
|
137
|
+
coreY,
|
|
138
|
+
sz * (bodyD * 0.5 - postW * 0.5),
|
|
139
|
+
p.paintWhite,
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Horizontal louvered grilles on all 4 vertical faces
|
|
145
|
+
const slats = 11
|
|
146
|
+
for (let i = 0; i < slats; i++) {
|
|
147
|
+
const sy = footH + bodyH * (0.14 + (i / (slats - 1)) * 0.74)
|
|
148
|
+
const slatH = bodyH * 0.028
|
|
149
|
+
const slatD = bodyD * 0.032
|
|
150
|
+
// Front & back slats
|
|
151
|
+
addBox(g, bodyW * 0.82, slatH, slatD, 0, sy, bodyD * 0.47, p.metalBrushed, [0.4, 0, 0])
|
|
152
|
+
addBox(g, bodyW * 0.82, slatH, slatD, 0, sy, -bodyD * 0.47, p.metalBrushed, [-0.4, 0, 0])
|
|
153
|
+
// Left & right slats
|
|
154
|
+
addBox(g, slatD, slatH, bodyD * 0.82, bodyW * 0.47, sy, 0, p.metalBrushed, [0, 0, -0.4])
|
|
155
|
+
addBox(g, slatD, slatH, bodyD * 0.82, -bodyW * 0.47, sy, 0, p.metalBrushed, [0, 0, 0.4])
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Top discharge fan shroud, blades & concentric safety grille
|
|
159
|
+
const fanR = Math.min(bodyW, bodyD) * 0.36
|
|
160
|
+
addFanAssembly(g, fanR, 0, footH + bodyH * 1.0, 0, 'y', 4, p)
|
|
161
|
+
|
|
162
|
+
// Side electrical service panel & insulated copper refrigerant service valves
|
|
163
|
+
addBox(
|
|
164
|
+
g,
|
|
165
|
+
w * 0.06,
|
|
166
|
+
bodyH * 0.36,
|
|
167
|
+
bodyD * 0.24,
|
|
168
|
+
bodyW * 0.5 + w * 0.025,
|
|
169
|
+
footH + bodyH * 0.34,
|
|
170
|
+
bodyD * 0.2,
|
|
171
|
+
p.metalDark,
|
|
172
|
+
)
|
|
173
|
+
addCyl(
|
|
174
|
+
g,
|
|
175
|
+
0.016,
|
|
176
|
+
0.016,
|
|
177
|
+
w * 0.08,
|
|
178
|
+
bodyW * 0.5 + w * 0.03,
|
|
179
|
+
footH + bodyH * 0.16,
|
|
180
|
+
-bodyD * 0.18,
|
|
181
|
+
p.metalCopper,
|
|
182
|
+
10,
|
|
183
|
+
[0, 0, Math.PI / 2],
|
|
184
|
+
)
|
|
185
|
+
addCyl(
|
|
186
|
+
g,
|
|
187
|
+
0.012,
|
|
188
|
+
0.012,
|
|
189
|
+
w * 0.08,
|
|
190
|
+
bodyW * 0.5 + w * 0.03,
|
|
191
|
+
footH + bodyH * 0.23,
|
|
192
|
+
-bodyD * 0.25,
|
|
193
|
+
p.metalCopper,
|
|
194
|
+
10,
|
|
195
|
+
[0, 0, Math.PI / 2],
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const buildAirConditioner: SlugBuilderFn = (w, h, d, p) => {
|
|
202
|
+
const g = new THREE.Group()
|
|
203
|
+
|
|
204
|
+
// Rear mounting plate
|
|
205
|
+
addBox(g, w * 0.94, h * 0.84, d * 0.1, 0, h * 0.5, -d * 0.45, p.metalBrushed)
|
|
206
|
+
|
|
207
|
+
// Sculpted main indoor mini-split chassis
|
|
208
|
+
addBox(g, w, h * 0.78, d * 0.82, 0, h * 0.55, -d * 0.02, p.plasticWhite)
|
|
209
|
+
addRoundedRectExtrude(g, w * 0.98, d * 0.45, h * 0.62, d * 0.14, 0, h * 0.56, d * 0.22, p.plasticWhite)
|
|
210
|
+
|
|
211
|
+
// Upper intake grille louvers
|
|
212
|
+
for (let i = 0; i < 4; i++) {
|
|
213
|
+
addBox(
|
|
214
|
+
g,
|
|
215
|
+
w * 0.86,
|
|
216
|
+
h * 0.02,
|
|
217
|
+
d * 0.07,
|
|
218
|
+
0,
|
|
219
|
+
h * 0.96,
|
|
220
|
+
-d * 0.26 + i * d * 0.12,
|
|
221
|
+
p.plasticDark,
|
|
222
|
+
)
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// Horizontal chrome accent strip across front panel
|
|
226
|
+
addBox(g, w * 0.96, h * 0.035, d * 0.04, 0, h * 0.46, d * 0.45, p.metalChrome)
|
|
227
|
+
|
|
228
|
+
// Bottom discharge plenum + motorized tilt deflector vane + vertical vanes
|
|
229
|
+
addBox(g, w * 0.86, h * 0.2, d * 0.24, 0, h * 0.16, d * 0.28, p.plasticDark)
|
|
230
|
+
addBox(g, w * 0.84, h * 0.04, d * 0.22, 0, h * 0.11, d * 0.36, p.plasticWhite, [0.42, 0, 0])
|
|
231
|
+
for (let i = -4; i <= 4; i++) {
|
|
232
|
+
addBox(g, w * 0.012, h * 0.16, d * 0.14, i * (w * 0.088), h * 0.18, d * 0.3, p.metalDark)
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// Digital temperature display + green LED indicator on right fascia
|
|
236
|
+
addBox(g, w * 0.12, h * 0.16, d * 0.03, w * 0.32, h * 0.62, d * 0.46, p.screenGlow)
|
|
237
|
+
addBox(g, w * 0.02, h * 0.04, d * 0.035, w * 0.41, h * 0.62, d * 0.46, p.emissiveGreen)
|
|
238
|
+
|
|
239
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const buildAirConditionerBlock: SlugBuilderFn = (w, h, d, p) => {
|
|
243
|
+
const g = new THREE.Group()
|
|
244
|
+
const footH = h * 0.08
|
|
245
|
+
const bodyH = h - footH
|
|
246
|
+
|
|
247
|
+
// Dual heavy L-bracket mounting rails
|
|
248
|
+
for (const sx of [-1, 1]) {
|
|
249
|
+
addBox(g, w * 0.1, footH, d * 0.96, sx * w * 0.34, footH / 2, 0, p.metalDark)
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// Main outdoor mini-split condenser cabinet
|
|
253
|
+
addBox(g, w * 0.96, bodyH * 0.96, d * 0.86, 0, footH + bodyH * 0.48, 0, p.paintWhite)
|
|
254
|
+
addBox(g, w, bodyH * 0.06, d * 0.9, 0, footH + bodyH * 0.97, 0, p.metalBrushed)
|
|
255
|
+
|
|
256
|
+
// Rear dark finned condenser coil pack
|
|
257
|
+
addBox(g, w * 0.88, bodyH * 0.82, d * 0.08, 0, footH + bodyH * 0.48, -d * 0.43, p.plasticDark)
|
|
258
|
+
for (let i = 0; i < 8; i++) {
|
|
259
|
+
addBox(
|
|
260
|
+
g,
|
|
261
|
+
w * 0.86,
|
|
262
|
+
bodyH * 0.02,
|
|
263
|
+
d * 0.03,
|
|
264
|
+
0,
|
|
265
|
+
footH + bodyH * (0.14 + (i / 7) * 0.68),
|
|
266
|
+
-d * 0.46,
|
|
267
|
+
p.metalBrushed,
|
|
268
|
+
)
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// Front side-discharge circular fan on left 65%
|
|
272
|
+
const fanR = Math.min(w * 0.29, bodyH * 0.38)
|
|
273
|
+
addFanAssembly(g, fanR, -w * 0.14, footH + bodyH * 0.5, d * 0.44, 'z', 3, p)
|
|
274
|
+
|
|
275
|
+
// Right service panel louvers, brand badge, & valve cover
|
|
276
|
+
addBox(g, w * 0.22, bodyH * 0.78, d * 0.04, w * 0.33, footH + bodyH * 0.48, d * 0.43, p.metalBrushed)
|
|
277
|
+
for (let i = 0; i < 6; i++) {
|
|
278
|
+
addBox(
|
|
279
|
+
g,
|
|
280
|
+
w * 0.16,
|
|
281
|
+
bodyH * 0.025,
|
|
282
|
+
d * 0.03,
|
|
283
|
+
w * 0.33,
|
|
284
|
+
footH + bodyH * (0.2 + i * 0.07),
|
|
285
|
+
d * 0.455,
|
|
286
|
+
p.plasticDark,
|
|
287
|
+
)
|
|
288
|
+
}
|
|
289
|
+
addBox(g, w * 0.05, bodyH * 0.28, d * 0.32, w * 0.49, footH + bodyH * 0.26, -d * 0.08, p.plasticDark)
|
|
290
|
+
addCyl(
|
|
291
|
+
g,
|
|
292
|
+
0.014,
|
|
293
|
+
0.014,
|
|
294
|
+
w * 0.06,
|
|
295
|
+
w * 0.5,
|
|
296
|
+
footH + bodyH * 0.18,
|
|
297
|
+
-d * 0.14,
|
|
298
|
+
p.metalCopper,
|
|
299
|
+
10,
|
|
300
|
+
[0, 0, Math.PI / 2],
|
|
301
|
+
)
|
|
302
|
+
addCyl(
|
|
303
|
+
g,
|
|
304
|
+
0.01,
|
|
305
|
+
0.01,
|
|
306
|
+
w * 0.06,
|
|
307
|
+
w * 0.5,
|
|
308
|
+
footH + bodyH * 0.24,
|
|
309
|
+
-d * 0.04,
|
|
310
|
+
p.metalCopper,
|
|
311
|
+
10,
|
|
312
|
+
[0, 0, Math.PI / 2],
|
|
313
|
+
)
|
|
314
|
+
|
|
315
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
const buildAirConditioning: SlugBuilderFn = (w, h, d, p) => {
|
|
319
|
+
const g = new THREE.Group()
|
|
320
|
+
|
|
321
|
+
// Wall bracket & full commercial air handler chassis (front face sits at +d*0.44 so grilles/OLED sit proudly visible!)
|
|
322
|
+
addBox(g, w * 0.96, h * 0.88, d * 0.1, 0, h * 0.5, -d * 0.45, p.metalDark)
|
|
323
|
+
addBox(g, w, h * 0.94, d * 0.78, 0, h * 0.5, -d * 0.04, p.plasticWhite)
|
|
324
|
+
addRoundedRectExtrude(g, w * 0.98, d * 0.22, h * 0.86, d * 0.07, 0, h * 0.51, d * 0.32, p.plasticWhite)
|
|
325
|
+
|
|
326
|
+
// Upper twin intake grille bays proudly offset on front (+Z)
|
|
327
|
+
for (const sx of [-0.25, 0.16]) {
|
|
328
|
+
addBox(g, w * 0.36, h * 0.24, d * 0.04, sx * w, h * 0.72, d * 0.445, p.plasticDark)
|
|
329
|
+
for (let i = 0; i < 5; i++) {
|
|
330
|
+
addBox(
|
|
331
|
+
g,
|
|
332
|
+
w * 0.34,
|
|
333
|
+
h * 0.022,
|
|
334
|
+
d * 0.035,
|
|
335
|
+
sx * w,
|
|
336
|
+
h * (0.63 + i * 0.045),
|
|
337
|
+
d * 0.47,
|
|
338
|
+
p.metalBrushed,
|
|
339
|
+
)
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// Lower wide dual-vane discharge plenum cleanly visible on front face
|
|
344
|
+
addBox(g, w * 0.74, h * 0.28, d * 0.08, -w * 0.07, h * 0.25, d * 0.435, p.plasticDark)
|
|
345
|
+
addBox(g, w * 0.72, h * 0.036, d * 0.12, -w * 0.07, h * 0.3, d * 0.485, p.plasticWhite, [0.35, 0, 0])
|
|
346
|
+
addBox(g, w * 0.72, h * 0.036, d * 0.12, -w * 0.07, h * 0.19, d * 0.485, p.plasticWhite, [0.35, 0, 0])
|
|
347
|
+
|
|
348
|
+
// Right control fascia panel with OLED readout & status LEDs proudly clear of fascia
|
|
349
|
+
addBox(g, w * 0.14, h * 0.72, d * 0.04, w * 0.41, h * 0.48, d * 0.45, p.metalBrushed)
|
|
350
|
+
addBox(g, w * 0.1, h * 0.2, d * 0.03, w * 0.41, h * 0.64, d * 0.48, p.screenGlow)
|
|
351
|
+
addBox(g, w * 0.025, h * 0.045, d * 0.03, w * 0.38, h * 0.44, d * 0.48, p.emissiveGreen)
|
|
352
|
+
addBox(g, w * 0.025, h * 0.045, d * 0.03, w * 0.44, h * 0.44, d * 0.48, p.emissiveWarm)
|
|
353
|
+
for (let i = 0; i < 3; i++) {
|
|
354
|
+
addBox(g, w * 0.07, h * 0.05, d * 0.03, w * 0.41, h * (0.32 - i * 0.08), d * 0.48, p.plasticDark)
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
const buildCeilingFan: SlugBuilderFn = (w, h, d, p) => {
|
|
361
|
+
const g = new THREE.Group()
|
|
362
|
+
const spanR = Math.min(w, d) * 0.5
|
|
363
|
+
|
|
364
|
+
// Top ceiling canopy bell & downrod
|
|
365
|
+
addCyl(g, spanR * 0.16, spanR * 0.12, h * 0.16, 0, h * 0.92, 0, p.metalBrushed, 18)
|
|
366
|
+
addCyl(g, spanR * 0.032, spanR * 0.032, h * 0.38, 0, h * 0.67, 0, p.metalDark, 12)
|
|
367
|
+
|
|
368
|
+
// Motor housing drum + upper/lower brushed accent rings
|
|
369
|
+
const motorY = h * 0.38
|
|
370
|
+
const motorR = spanR * 0.24
|
|
371
|
+
addCyl(g, motorR, motorR * 0.96, h * 0.24, 0, motorY, 0, p.metalDark, 24)
|
|
372
|
+
addTorus(g, motorR * 1.01, h * 0.022, 0, motorY + h * 0.1, 0, p.metalBrushed, [Math.PI / 2, 0, 0])
|
|
373
|
+
addTorus(g, motorR * 0.98, h * 0.022, 0, motorY - h * 0.1, 0, p.metalBrushed, [Math.PI / 2, 0, 0])
|
|
374
|
+
|
|
375
|
+
// 5 pitched wood blades with metal blade-iron brackets
|
|
376
|
+
const bladeCount = 5
|
|
377
|
+
const bladeLen = spanR - motorR * 0.75
|
|
378
|
+
for (let i = 0; i < bladeCount; i++) {
|
|
379
|
+
const a = (i / bladeCount) * Math.PI * 2
|
|
380
|
+
const holder = new THREE.Group()
|
|
381
|
+
holder.position.set(0, motorY, 0)
|
|
382
|
+
holder.rotation.y = a
|
|
383
|
+
|
|
384
|
+
// Blade iron bracket
|
|
385
|
+
addBox(holder, bladeLen * 0.28, h * 0.035, spanR * 0.11, motorR + bladeLen * 0.06, 0, 0, p.metalBrushed)
|
|
386
|
+
// Pitched airfoil blade
|
|
387
|
+
addBox(
|
|
388
|
+
holder,
|
|
389
|
+
bladeLen * 0.92,
|
|
390
|
+
h * 0.025,
|
|
391
|
+
spanR * 0.22,
|
|
392
|
+
motorR * 0.8 + bladeLen * 0.52,
|
|
393
|
+
h * 0.01,
|
|
394
|
+
0,
|
|
395
|
+
p.woodWarm,
|
|
396
|
+
[0.18, 0, 0],
|
|
397
|
+
)
|
|
398
|
+
g.add(holder)
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// Bottom frosted glass light kit dome + brushed finial
|
|
402
|
+
addCyl(g, motorR * 0.72, motorR * 0.62, h * 0.08, 0, h * 0.22, 0, p.metalBrushed, 20)
|
|
403
|
+
addSphere(g, motorR * 0.64, 0, h * 0.16, 0, p.emissiveWarm, [1, 0.55, 1], 18)
|
|
404
|
+
addCyl(g, motorR * 0.12, motorR * 0.05, h * 0.06, 0, h * 0.03, 0, p.metalChrome, 12)
|
|
405
|
+
|
|
406
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
const buildElectricPanel: SlugBuilderFn = (w, h, d, p) => {
|
|
410
|
+
const g = new THREE.Group()
|
|
411
|
+
|
|
412
|
+
// Top & bottom EMT steel conduit stubs
|
|
413
|
+
for (const sx of [-0.28, 0, 0.28]) {
|
|
414
|
+
addCyl(g, d * 0.16, d * 0.16, h * 0.06, sx * w, h * 0.97, -d * 0.1, p.metalChrome, 10)
|
|
415
|
+
}
|
|
416
|
+
addCyl(g, d * 0.18, d * 0.18, h * 0.05, 0, h * 0.025, -d * 0.1, p.metalChrome, 10)
|
|
417
|
+
|
|
418
|
+
// Main NEMA steel enclosure box & beveled trim collar
|
|
419
|
+
const boxH = h * 0.9
|
|
420
|
+
const boxY = h * 0.49
|
|
421
|
+
addBox(g, w * 0.94, boxH, d * 0.78, 0, boxY, -d * 0.1, p.metalBrushed)
|
|
422
|
+
addBox(g, w, boxH * 0.98, d * 0.12, 0, boxY, d * 0.34, p.metalBrushed)
|
|
423
|
+
|
|
424
|
+
// Recessed interior panel cavity with main disconnect & dual columns of circuit breakers (cleanly proud)
|
|
425
|
+
addBox(g, w * 0.76, boxH * 0.82, d * 0.06, 0, boxY, d * 0.415, p.metalDark)
|
|
426
|
+
// Main breaker at top
|
|
427
|
+
addBox(g, w * 0.32, boxH * 0.08, d * 0.08, 0, boxY + boxH * 0.3, d * 0.445, p.plasticDark)
|
|
428
|
+
addBox(g, w * 0.18, boxH * 0.03, d * 0.06, 0, boxY + boxH * 0.3, d * 0.48, p.paintRed)
|
|
429
|
+
|
|
430
|
+
// Dual vertical columns of branch breaker switches
|
|
431
|
+
for (let row = 0; row < 8; row++) {
|
|
432
|
+
const ry = boxY + boxH * (0.18 - row * 0.068)
|
|
433
|
+
for (const sx of [-1, 1]) {
|
|
434
|
+
addBox(g, w * 0.26, boxH * 0.048, d * 0.06, sx * w * 0.18, ry, d * 0.445, p.plasticDark)
|
|
435
|
+
addBox(g, w * 0.08, boxH * 0.022, d * 0.05, sx * w * 0.09, ry, d * 0.475, p.metalChrome)
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// Clear inspection cover window, latch handle, schedule card & high-voltage warning badge
|
|
440
|
+
addBox(g, w * 0.72, boxH * 0.62, d * 0.025, 0, boxY + boxH * 0.04, d * 0.5, p.glass)
|
|
441
|
+
addBox(g, w * 0.12, boxH * 0.06, d * 0.04, w * 0.32, boxY - boxH * 0.34, d * 0.46, p.paintYellow)
|
|
442
|
+
addBox(g, w * 0.34, boxH * 0.07, d * 0.035, -w * 0.12, boxY - boxH * 0.34, d * 0.455, p.ceramicWhite)
|
|
443
|
+
addBox(g, w * 0.06, boxH * 0.12, d * 0.08, w * 0.43, boxY, d * 0.46, p.metalDark)
|
|
444
|
+
addBox(g, w * 0.04, boxH * 0.025, d * 0.04, -w * 0.36, boxY + boxH * 0.38, d * 0.455, p.emissiveGreen)
|
|
445
|
+
|
|
446
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
const buildEvWallCharger: SlugBuilderFn = (w, h, d, p) => {
|
|
450
|
+
const g = new THREE.Group()
|
|
451
|
+
|
|
452
|
+
// Wall backplate
|
|
453
|
+
addBox(g, w * 0.86, h * 0.88, d * 0.14, 0, h * 0.52, -d * 0.43, p.metalDark)
|
|
454
|
+
|
|
455
|
+
// Sculpted white/dark wallbox housing
|
|
456
|
+
addRoundedRectExtrude(g, w * 0.9, d * 0.66, h * 0.78, w * 0.14, 0, h * 0.56, -d * 0.05, p.plasticWhite)
|
|
457
|
+
addRoundedRectExtrude(g, w * 0.74, d * 0.2, h * 0.68, w * 0.1, 0, h * 0.56, d * 0.25, p.plasticDark)
|
|
458
|
+
|
|
459
|
+
// Glowing vertical LED charge status strip & mini screen proudly offset from dark fascia
|
|
460
|
+
addBox(g, w * 0.08, h * 0.38, d * 0.04, 0, h * 0.52, d * 0.38, p.emissiveGreen)
|
|
461
|
+
addBox(g, w * 0.44, h * 0.11, d * 0.04, 0, h * 0.77, d * 0.38, p.screenGlow)
|
|
462
|
+
|
|
463
|
+
// Side connector holster + J1772 charging gun handle
|
|
464
|
+
addBox(g, w * 0.14, h * 0.2, d * 0.3, w * 0.46, h * 0.56, d * 0.06, p.plasticDark)
|
|
465
|
+
addCyl(g, w * 0.07, w * 0.06, d * 0.34, w * 0.48, h * 0.6, d * 0.16, p.rubberBlack, 12, [
|
|
466
|
+
Math.PI / 2,
|
|
467
|
+
0,
|
|
468
|
+
0,
|
|
469
|
+
])
|
|
470
|
+
addCyl(g, w * 0.055, w * 0.055, d * 0.12, w * 0.48, h * 0.6, d * 0.34, p.metalChrome, 12, [
|
|
471
|
+
Math.PI / 2,
|
|
472
|
+
0,
|
|
473
|
+
0,
|
|
474
|
+
])
|
|
475
|
+
addBox(g, w * 0.09, h * 0.18, d * 0.12, w * 0.48, h * 0.47, d * 0.12, p.rubberBlack, [0.3, 0, 0])
|
|
476
|
+
|
|
477
|
+
// Coiled charging cable loops hanging cleanly under wallbox
|
|
478
|
+
addCyl(g, w * 0.06, w * 0.06, h * 0.08, 0, h * 0.16, -d * 0.04, p.metalDark, 10)
|
|
479
|
+
for (let i = 0; i < 3; i++) {
|
|
480
|
+
addTorus(g, w * 0.36, w * 0.042, 0, h * 0.16, -d * 0.12 + i * d * 0.14, p.rubberBlack, [
|
|
481
|
+
0,
|
|
482
|
+
0,
|
|
483
|
+
0,
|
|
484
|
+
])
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
const buildPowerOutlet: SlugBuilderFn = (w, h, d, p) => {
|
|
491
|
+
const g = new THREE.Group()
|
|
492
|
+
|
|
493
|
+
// Rear flush box collar + beveled faceplate
|
|
494
|
+
addBox(g, w * 0.76, h * 0.78, d * 0.45, 0, h * 0.5, -d * 0.25, p.plasticDark)
|
|
495
|
+
addBox(g, w, h, d * 0.42, 0, h * 0.5, d * 0.15, p.plasticWhite)
|
|
496
|
+
addBox(g, w * 0.92, h * 0.92, d * 0.14, 0, h * 0.5, d * 0.38, p.ceramicWhite)
|
|
497
|
+
|
|
498
|
+
// Center mounting screw
|
|
499
|
+
addCyl(g, w * 0.045, w * 0.045, d * 0.1, 0, h * 0.5, d * 0.44, p.metalChrome, 10, [
|
|
500
|
+
Math.PI / 2,
|
|
501
|
+
0,
|
|
502
|
+
0,
|
|
503
|
+
])
|
|
504
|
+
|
|
505
|
+
// Upper & lower duplex receptacles (neutral slot, hot slot, ground pin)
|
|
506
|
+
for (const sy of [0.27, 0.73]) {
|
|
507
|
+
addBox(g, w * 0.48, h * 0.32, d * 0.12, 0, h * sy, d * 0.42, p.plasticWhite)
|
|
508
|
+
addBox(g, w * 0.055, h * 0.13, d * 0.08, -w * 0.11, h * (sy + 0.03), d * 0.47, p.plasticDark)
|
|
509
|
+
addBox(g, w * 0.055, h * 0.1, d * 0.08, w * 0.11, h * (sy + 0.03), d * 0.47, p.plasticDark)
|
|
510
|
+
addCyl(g, w * 0.045, w * 0.045, d * 0.08, 0, h * (sy - 0.075), d * 0.47, p.plasticDark, 10, [
|
|
511
|
+
Math.PI / 2,
|
|
512
|
+
0,
|
|
513
|
+
0,
|
|
514
|
+
])
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
const buildThermostat: SlugBuilderFn = (w, h, d, p) => {
|
|
521
|
+
const g = new THREE.Group()
|
|
522
|
+
const r = Math.min(w, h) * 0.48
|
|
523
|
+
|
|
524
|
+
// Thin wall trim plate
|
|
525
|
+
addBox(g, w, h, d * 0.22, 0, h * 0.5, -d * 0.38, p.plasticWhite)
|
|
526
|
+
|
|
527
|
+
// Circular smart thermostat brushed metal rotary ring
|
|
528
|
+
addCyl(g, r, r * 0.96, d * 0.65, 0, h * 0.5, d * 0.05, p.metalBrushed, 28, [Math.PI / 2, 0, 0])
|
|
529
|
+
addTorus(g, r * 0.95, d * 0.16, 0, h * 0.5, d * 0.32, p.metalChrome, [0, 0, 0])
|
|
530
|
+
|
|
531
|
+
// Recessed circular glossy OLED face & glowing status ring
|
|
532
|
+
addCyl(g, r * 0.82, r * 0.82, d * 0.15, 0, h * 0.5, d * 0.38, p.screenGlow, 24, [
|
|
533
|
+
Math.PI / 2,
|
|
534
|
+
0,
|
|
535
|
+
0,
|
|
536
|
+
])
|
|
537
|
+
addTorus(g, r * 0.64, d * 0.07, 0, h * 0.5, d * 0.44, p.emissiveGreen, [0, 0, 0])
|
|
538
|
+
addBox(g, r * 0.42, r * 0.18, d * 0.08, 0, h * 0.52, d * 0.45, p.emissiveWarm)
|
|
539
|
+
|
|
540
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
// ---------------------------------------------------------------------------
|
|
544
|
+
// Safety & Fire (8)
|
|
545
|
+
// ---------------------------------------------------------------------------
|
|
546
|
+
|
|
547
|
+
const buildAlarmKeypad: SlugBuilderFn = (w, h, d, p) => {
|
|
548
|
+
const g = new THREE.Group()
|
|
549
|
+
|
|
550
|
+
// Wall gasket & beveled main body
|
|
551
|
+
addBox(g, w * 0.94, h * 0.92, d * 0.28, 0, h * 0.5, -d * 0.34, p.plasticDark)
|
|
552
|
+
addBox(g, w, h, d * 0.56, 0, h * 0.5, d * 0.08, p.plasticWhite)
|
|
553
|
+
|
|
554
|
+
// Upper LCD screen & 3 status LEDs
|
|
555
|
+
addBox(g, w * 0.62, h * 0.24, d * 0.14, -w * 0.1, h * 0.74, d * 0.38, p.screenGlow)
|
|
556
|
+
addCyl(g, h * 0.032, h * 0.032, d * 0.16, w * 0.3, h * 0.8, d * 0.38, p.emissiveGreen, 10, [
|
|
557
|
+
Math.PI / 2,
|
|
558
|
+
0,
|
|
559
|
+
0,
|
|
560
|
+
])
|
|
561
|
+
addCyl(g, h * 0.032, h * 0.032, d * 0.16, w * 0.38, h * 0.8, d * 0.38, p.emissiveWarm, 10, [
|
|
562
|
+
Math.PI / 2,
|
|
563
|
+
0,
|
|
564
|
+
0,
|
|
565
|
+
])
|
|
566
|
+
addCyl(g, h * 0.032, h * 0.032, d * 0.16, w * 0.34, h * 0.68, d * 0.38, p.emissiveRed, 10, [
|
|
567
|
+
Math.PI / 2,
|
|
568
|
+
0,
|
|
569
|
+
0,
|
|
570
|
+
])
|
|
571
|
+
|
|
572
|
+
// 3x4 tactile keypad buttons
|
|
573
|
+
for (let r = 0; r < 4; r++) {
|
|
574
|
+
for (let c = 0; c < 3; c++) {
|
|
575
|
+
const bx = -w * 0.32 + c * w * 0.2
|
|
576
|
+
const by = h * (0.5 - r * 0.12)
|
|
577
|
+
addBox(g, w * 0.14, h * 0.085, d * 0.2, bx, by, d * 0.4, p.ceramicMatte)
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// 3 color-coded emergency quick keys on right
|
|
582
|
+
const emergencyMats = [p.paintRed, p.paintBlue, p.paintYellow] as const
|
|
583
|
+
for (let i = 0; i < 3; i++) {
|
|
584
|
+
const matItem = emergencyMats[i] ?? p.paintRed
|
|
585
|
+
addBox(g, w * 0.15, h * 0.1, d * 0.2, w * 0.33, h * (0.48 - i * 0.15), d * 0.4, matItem)
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
const buildExitSign: SlugBuilderFn = (w, h, d, p) => {
|
|
592
|
+
const g = new THREE.Group()
|
|
593
|
+
|
|
594
|
+
// Wall/ceiling mounting canopy + rectangular housing
|
|
595
|
+
addBox(g, w * 0.24, h * 0.14, d * 0.62, 0, h * 0.93, -d * 0.12, p.plasticWhite)
|
|
596
|
+
addBox(g, w * 0.88, h * 0.72, d * 0.62, 0, h * 0.42, -d * 0.06, p.plasticWhite)
|
|
597
|
+
|
|
598
|
+
// Glowing green illuminated face panel
|
|
599
|
+
const faceZ = d * 0.28
|
|
600
|
+
addBox(g, w * 0.8, h * 0.58, d * 0.12, 0, h * 0.42, faceZ, p.emissiveGreen)
|
|
601
|
+
|
|
602
|
+
// Crisp 3D geometric white "E X I T" bars on the illuminated face
|
|
603
|
+
const strokeZ = d * 0.36
|
|
604
|
+
const strokeD = d * 0.06
|
|
605
|
+
const letterH = h * 0.34
|
|
606
|
+
const cy = h * 0.42
|
|
607
|
+
const sw = w * 0.025
|
|
608
|
+
// 'E'
|
|
609
|
+
const ex = -w * 0.27
|
|
610
|
+
addBox(g, sw, letterH, strokeD, ex - w * 0.04, cy, strokeZ, p.paintWhite)
|
|
611
|
+
addBox(g, w * 0.09, sw, strokeD, ex, cy + letterH * 0.45, strokeZ, p.paintWhite)
|
|
612
|
+
addBox(g, w * 0.08, sw, strokeD, ex - w * 0.005, cy, strokeZ, p.paintWhite)
|
|
613
|
+
addBox(g, w * 0.09, sw, strokeD, ex, cy - letterH * 0.45, strokeZ, p.paintWhite)
|
|
614
|
+
// 'X'
|
|
615
|
+
const xx = -w * 0.09
|
|
616
|
+
addBox(g, sw, letterH * 1.08, strokeD, xx, cy, strokeZ, p.paintWhite, [0, 0, 0.36])
|
|
617
|
+
addBox(g, sw, letterH * 1.08, strokeD, xx, cy, strokeZ, p.paintWhite, [0, 0, -0.36])
|
|
618
|
+
// 'I'
|
|
619
|
+
const ix = w * 0.08
|
|
620
|
+
addBox(g, sw, letterH, strokeD, ix, cy, strokeZ, p.paintWhite)
|
|
621
|
+
// 'T'
|
|
622
|
+
const tx = w * 0.24
|
|
623
|
+
addBox(g, sw, letterH, strokeD, tx, cy, strokeZ, p.paintWhite)
|
|
624
|
+
addBox(g, w * 0.11, sw, strokeD, tx, cy + letterH * 0.45, strokeZ, p.paintWhite)
|
|
625
|
+
|
|
626
|
+
// Twin side-mounted adjustable emergency floodlight heads
|
|
627
|
+
for (const sx of [-1, 1]) {
|
|
628
|
+
addBox(g, w * 0.06, h * 0.08, d * 0.2, sx * w * 0.46, h * 0.56, d * 0.02, p.plasticWhite)
|
|
629
|
+
addCyl(g, h * 0.13, h * 0.1, d * 0.42, sx * w * 0.49, h * 0.62, d * 0.14, p.plasticWhite, 14, [
|
|
630
|
+
Math.PI / 2,
|
|
631
|
+
0,
|
|
632
|
+
0,
|
|
633
|
+
])
|
|
634
|
+
addCyl(g, h * 0.11, h * 0.11, d * 0.06, sx * w * 0.49, h * 0.62, d * 0.36, p.emissiveWarm, 14, [
|
|
635
|
+
Math.PI / 2,
|
|
636
|
+
0,
|
|
637
|
+
0,
|
|
638
|
+
])
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
const buildFireAlarm: SlugBuilderFn = (w, h, d, p) => {
|
|
645
|
+
const g = new THREE.Group()
|
|
646
|
+
|
|
647
|
+
// Red cast backbox & beveled housing
|
|
648
|
+
addBox(g, w, h, d * 0.66, 0, h * 0.5, -d * 0.14, p.paintRed)
|
|
649
|
+
addBox(g, w * 0.88, h * 0.88, d * 0.2, 0, h * 0.5, d * 0.24, p.paintRed)
|
|
650
|
+
|
|
651
|
+
// Upper horn louver slots + white alert strip
|
|
652
|
+
addBox(g, w * 0.72, h * 0.14, d * 0.1, 0, h * 0.8, d * 0.33, p.paintWhite)
|
|
653
|
+
for (let i = 0; i < 3; i++) {
|
|
654
|
+
addBox(g, w * 0.64, h * 0.024, d * 0.08, 0, h * (0.66 - i * 0.045), d * 0.34, p.plasticDark)
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
// Recessed pull cavity + T-bar pull handle
|
|
658
|
+
addBox(g, w * 0.68, h * 0.38, d * 0.12, 0, h * 0.32, d * 0.32, p.plasticDark)
|
|
659
|
+
addBox(g, w * 0.58, h * 0.16, d * 0.18, 0, h * 0.36, d * 0.4, p.paintWhite)
|
|
660
|
+
addBox(g, w * 0.48, h * 0.07, d * 0.14, 0, h * 0.28, d * 0.45, p.paintRed)
|
|
661
|
+
|
|
662
|
+
// Top xenon strobe dome
|
|
663
|
+
addSphere(g, w * 0.18, 0, h * 0.8, d * 0.42, p.emissiveWarm, [1, 0.7, 0.7], 12)
|
|
664
|
+
|
|
665
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
const buildFireDetector: SlugBuilderFn = (w, h, d, p) => {
|
|
669
|
+
const g = new THREE.Group()
|
|
670
|
+
|
|
671
|
+
// Wall-mounted red notification/fire detector housing
|
|
672
|
+
addBox(g, w, h, d * 0.52, 0, h * 0.5, -d * 0.22, p.paintRed)
|
|
673
|
+
// Upper louvered horn grill
|
|
674
|
+
addBox(g, w * 0.8, h * 0.28, d * 0.14, 0, h * 0.78, d * 0.08, p.plasticDark)
|
|
675
|
+
for (let i = 0; i < 4; i++) {
|
|
676
|
+
addBox(g, w * 0.78, h * 0.025, d * 0.12, 0, h * (0.68 + i * 0.06), d * 0.12, p.paintRed)
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
// Protruding clear/warm strobe beacon housing
|
|
680
|
+
addBox(g, w * 0.68, h * 0.32, d * 0.38, 0, h * 0.44, d * 0.22, p.glass)
|
|
681
|
+
addCyl(g, w * 0.18, w * 0.22, h * 0.18, 0, h * 0.44, d * 0.2, p.emissiveWarm, 12)
|
|
682
|
+
|
|
683
|
+
// Lower circular optical/thermal sensor puck + status LED
|
|
684
|
+
addCyl(g, w * 0.3, w * 0.26, d * 0.26, 0, h * 0.16, d * 0.15, p.plasticWhite, 16, [
|
|
685
|
+
Math.PI / 2,
|
|
686
|
+
0,
|
|
687
|
+
0,
|
|
688
|
+
])
|
|
689
|
+
addCyl(g, w * 0.06, w * 0.06, d * 0.08, w * 0.14, h * 0.16, d * 0.28, p.emissiveRed, 10, [
|
|
690
|
+
Math.PI / 2,
|
|
691
|
+
0,
|
|
692
|
+
0,
|
|
693
|
+
])
|
|
694
|
+
|
|
695
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
const buildFireExtinguisher: SlugBuilderFn = (w, h, d, p) => {
|
|
699
|
+
const g = new THREE.Group()
|
|
700
|
+
const tankR = Math.min(w, d) * 0.36
|
|
701
|
+
const tankH = h * 0.66
|
|
702
|
+
|
|
703
|
+
// Protective rubber base ring + red steel pressure cylinder + domed shoulder
|
|
704
|
+
addCyl(g, tankR * 1.03, tankR * 1.04, h * 0.06, 0, h * 0.03, 0, p.rubberBlack, 20)
|
|
705
|
+
addCyl(g, tankR, tankR, tankH, 0, h * 0.06 + tankH * 0.5, 0, p.paintRed, 22)
|
|
706
|
+
addSphere(g, tankR, 0, h * 0.06 + tankH, 0, p.paintRed, [1, 0.55, 1], 18)
|
|
707
|
+
|
|
708
|
+
// White instruction label wrap & red header band cleanly proud of cylinder (zero coplanar clipping)
|
|
709
|
+
addCyl(g, tankR * 1.036, tankR * 1.036, tankH * 0.42, 0, h * 0.4, 0, p.ceramicWhite, 22)
|
|
710
|
+
addCyl(g, tankR * 1.046, tankR * 1.046, tankH * 0.08, 0, h * 0.52, 0, p.paintRed, 22)
|
|
711
|
+
|
|
712
|
+
// Brass/chrome valve neck, pressure gauge, safety pin & squeeze levers
|
|
713
|
+
const neckY = h * 0.82
|
|
714
|
+
addCyl(g, tankR * 0.26, tankR * 0.3, h * 0.11, 0, neckY, 0, p.metalCopper, 14)
|
|
715
|
+
// Pressure gauge
|
|
716
|
+
addCyl(g, tankR * 0.18, tankR * 0.18, tankR * 0.12, 0, neckY + h * 0.02, tankR * 0.34, p.metalChrome, 14, [
|
|
717
|
+
Math.PI / 2,
|
|
718
|
+
0,
|
|
719
|
+
0,
|
|
720
|
+
])
|
|
721
|
+
addCyl(g, tankR * 0.13, tankR * 0.13, tankR * 0.04, 0, neckY + h * 0.02, tankR * 0.4, p.emissiveGreen, 12, [
|
|
722
|
+
Math.PI / 2,
|
|
723
|
+
0,
|
|
724
|
+
0,
|
|
725
|
+
])
|
|
726
|
+
// Carry handle & upper squeeze trigger
|
|
727
|
+
addBox(g, tankR * 0.2, h * 0.028, tankR * 1.1, 0, neckY + h * 0.06, -tankR * 0.45, p.metalDark, [
|
|
728
|
+
-0.12,
|
|
729
|
+
0,
|
|
730
|
+
0,
|
|
731
|
+
])
|
|
732
|
+
addBox(g, tankR * 0.18, h * 0.026, tankR * 1.15, 0, neckY + h * 0.13, -tankR * 0.48, p.metalDark, [
|
|
733
|
+
0.26,
|
|
734
|
+
0,
|
|
735
|
+
0,
|
|
736
|
+
])
|
|
737
|
+
// Safety pull ring
|
|
738
|
+
addTorus(g, tankR * 0.14, tankR * 0.025, tankR * 0.28, neckY + h * 0.05, 0, p.metalChrome, [
|
|
739
|
+
0,
|
|
740
|
+
Math.PI / 2,
|
|
741
|
+
0,
|
|
742
|
+
])
|
|
743
|
+
|
|
744
|
+
// Side discharge hose & flared conical nozzle horn
|
|
745
|
+
addCyl(g, tankR * 0.1, tankR * 0.1, tankR * 0.65, tankR * 0.52, neckY + h * 0.02, 0, p.rubberBlack, 10, [
|
|
746
|
+
0,
|
|
747
|
+
0,
|
|
748
|
+
Math.PI / 2,
|
|
749
|
+
])
|
|
750
|
+
addCyl(g, tankR * 0.1, tankR * 0.1, h * 0.44, tankR * 0.88, h * 0.61, 0, p.rubberBlack, 10)
|
|
751
|
+
addCyl(g, tankR * 0.12, tankR * 0.26, h * 0.2, tankR * 0.88, h * 0.3, 0, p.plasticDark, 14)
|
|
752
|
+
|
|
753
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
const buildHydrant: SlugBuilderFn = (w, h, d, p) => {
|
|
757
|
+
const g = new THREE.Group()
|
|
758
|
+
const baseR = Math.min(w, d) * 0.34
|
|
759
|
+
const barrelR = baseR * 0.62
|
|
760
|
+
|
|
761
|
+
// Ground flange plate with 8 anchor bolts
|
|
762
|
+
addCyl(g, baseR, baseR * 1.05, h * 0.08, 0, h * 0.04, 0, p.paintRed, 20)
|
|
763
|
+
for (let i = 0; i < 8; i++) {
|
|
764
|
+
const a = (i / 8) * Math.PI * 2
|
|
765
|
+
addCyl(
|
|
766
|
+
g,
|
|
767
|
+
baseR * 0.08,
|
|
768
|
+
baseR * 0.08,
|
|
769
|
+
h * 0.045,
|
|
770
|
+
Math.cos(a) * baseR * 0.82,
|
|
771
|
+
h * 0.09,
|
|
772
|
+
Math.sin(a) * baseR * 0.82,
|
|
773
|
+
p.metalBrushed,
|
|
774
|
+
6,
|
|
775
|
+
)
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
// Cast-iron vertical barrel + 6 vertical cast ribs
|
|
779
|
+
addCyl(g, barrelR * 0.96, barrelR, h * 0.66, 0, h * 0.41, 0, p.paintRed, 20)
|
|
780
|
+
for (let i = 0; i < 6; i++) {
|
|
781
|
+
const a = (i / 6) * Math.PI * 2
|
|
782
|
+
addBox(
|
|
783
|
+
g,
|
|
784
|
+
barrelR * 0.14,
|
|
785
|
+
h * 0.52,
|
|
786
|
+
barrelR * 0.14,
|
|
787
|
+
Math.cos(a) * barrelR * 0.96,
|
|
788
|
+
h * 0.38,
|
|
789
|
+
Math.sin(a) * barrelR * 0.96,
|
|
790
|
+
p.paintRed,
|
|
791
|
+
[0, -a, 0],
|
|
792
|
+
)
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
// Upper collar flange + domed bonnet + pentagonal operating nut
|
|
796
|
+
addCyl(g, barrelR * 1.24, barrelR * 1.24, h * 0.06, 0, h * 0.74, 0, p.paintRed, 20)
|
|
797
|
+
addSphere(g, barrelR * 0.98, 0, h * 0.77, 0, p.paintRed, [1, 0.72, 1], 18)
|
|
798
|
+
addCyl(g, barrelR * 0.28, barrelR * 0.32, h * 0.09, 0, h * 0.94, 0, p.metalBrushed, 5)
|
|
799
|
+
|
|
800
|
+
// Left & right hose nozzle outlets + hex caps
|
|
801
|
+
for (const sx of [-1, 1]) {
|
|
802
|
+
addCyl(
|
|
803
|
+
g,
|
|
804
|
+
barrelR * 0.34,
|
|
805
|
+
barrelR * 0.38,
|
|
806
|
+
baseR * 0.56,
|
|
807
|
+
sx * (barrelR + baseR * 0.2),
|
|
808
|
+
h * 0.56,
|
|
809
|
+
0,
|
|
810
|
+
p.paintRed,
|
|
811
|
+
14,
|
|
812
|
+
[0, 0, Math.PI / 2],
|
|
813
|
+
)
|
|
814
|
+
addCyl(
|
|
815
|
+
g,
|
|
816
|
+
barrelR * 0.38,
|
|
817
|
+
barrelR * 0.38,
|
|
818
|
+
baseR * 0.14,
|
|
819
|
+
sx * (barrelR + baseR * 0.5),
|
|
820
|
+
h * 0.56,
|
|
821
|
+
0,
|
|
822
|
+
p.metalChrome,
|
|
823
|
+
6,
|
|
824
|
+
[0, 0, Math.PI / 2],
|
|
825
|
+
)
|
|
826
|
+
// Hanging chain accent
|
|
827
|
+
addTorus(g, barrelR * 0.22, barrelR * 0.03, sx * (barrelR + baseR * 0.32), h * 0.44, 0, p.metalDark, [
|
|
828
|
+
0,
|
|
829
|
+
Math.PI / 2,
|
|
830
|
+
0,
|
|
831
|
+
])
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
// Front large pumper steamer nozzle + cap
|
|
835
|
+
addCyl(
|
|
836
|
+
g,
|
|
837
|
+
barrelR * 0.48,
|
|
838
|
+
barrelR * 0.52,
|
|
839
|
+
baseR * 0.5,
|
|
840
|
+
0,
|
|
841
|
+
h * 0.53,
|
|
842
|
+
barrelR + baseR * 0.16,
|
|
843
|
+
p.paintRed,
|
|
844
|
+
16,
|
|
845
|
+
[Math.PI / 2, 0, 0],
|
|
846
|
+
)
|
|
847
|
+
addCyl(
|
|
848
|
+
g,
|
|
849
|
+
barrelR * 0.5,
|
|
850
|
+
barrelR * 0.5,
|
|
851
|
+
baseR * 0.14,
|
|
852
|
+
0,
|
|
853
|
+
h * 0.53,
|
|
854
|
+
barrelR + baseR * 0.44,
|
|
855
|
+
p.metalChrome,
|
|
856
|
+
6,
|
|
857
|
+
[Math.PI / 2, 0, 0],
|
|
858
|
+
)
|
|
859
|
+
|
|
860
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
const buildSmokeDetector: SlugBuilderFn = (w, h, d, p) => {
|
|
864
|
+
const g = new THREE.Group()
|
|
865
|
+
const r = Math.min(w, d) * 0.5
|
|
866
|
+
|
|
867
|
+
// Ceiling mounting base plate
|
|
868
|
+
addCyl(g, r, r * 0.98, h * 0.36, 0, h * 0.82, 0, p.plasticWhite, 24)
|
|
869
|
+
// Recessed dark smoke-intake louver band with radial fins
|
|
870
|
+
addCyl(g, r * 0.88, r * 0.86, h * 0.28, 0, h * 0.5, 0, p.plasticDark, 24)
|
|
871
|
+
for (let i = 0; i < 16; i++) {
|
|
872
|
+
const a = (i / 16) * Math.PI * 2
|
|
873
|
+
addBox(
|
|
874
|
+
g,
|
|
875
|
+
r * 0.08,
|
|
876
|
+
h * 0.3,
|
|
877
|
+
r * 0.14,
|
|
878
|
+
Math.cos(a) * r * 0.88,
|
|
879
|
+
h * 0.5,
|
|
880
|
+
Math.sin(a) * r * 0.88,
|
|
881
|
+
p.plasticWhite,
|
|
882
|
+
[0, -a, 0],
|
|
883
|
+
)
|
|
884
|
+
}
|
|
885
|
+
// Lower tapered face + central test button + red LED
|
|
886
|
+
addCyl(g, r * 0.9, r * 0.78, h * 0.3, 0, h * 0.22, 0, p.plasticWhite, 24)
|
|
887
|
+
addCyl(g, r * 0.24, r * 0.22, h * 0.12, 0, h * 0.06, 0, p.ceramicMatte, 16)
|
|
888
|
+
addCyl(g, r * 0.06, r * 0.06, h * 0.08, r * 0.42, h * 0.08, 0, p.emissiveRed, 10)
|
|
889
|
+
|
|
890
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
const buildSprinkler: SlugBuilderFn = (w, h, d, p) => {
|
|
894
|
+
const g = new THREE.Group()
|
|
895
|
+
const r = Math.min(w, d) * 0.5
|
|
896
|
+
|
|
897
|
+
// Chrome ceiling escutcheon trim plate + threaded brass riser boss
|
|
898
|
+
addCyl(g, r, r * 0.9, h * 0.22, 0, h * 0.89, 0, p.metalChrome, 24)
|
|
899
|
+
addCyl(g, r * 0.34, r * 0.28, h * 0.24, 0, h * 0.68, 0, p.metalCopper, 14)
|
|
900
|
+
|
|
901
|
+
// Twin brass frame arms descending to deflector boss
|
|
902
|
+
for (const sx of [-1, 1]) {
|
|
903
|
+
addBox(g, r * 0.08, h * 0.56, r * 0.09, sx * r * 0.26, h * 0.42, 0, p.metalCopper, [
|
|
904
|
+
0,
|
|
905
|
+
0,
|
|
906
|
+
sx * 0.22,
|
|
907
|
+
])
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
// Red glass thermal trigger bulb in center
|
|
911
|
+
addCyl(g, r * 0.08, r * 0.08, h * 0.38, 0, h * 0.4, 0, p.emissiveRed, 12)
|
|
912
|
+
|
|
913
|
+
// Bottom toothed brass deflector wheel
|
|
914
|
+
addCyl(g, r * 0.46, r * 0.46, h * 0.08, 0, h * 0.1, 0, p.metalCopper, 16)
|
|
915
|
+
for (let i = 0; i < 8; i++) {
|
|
916
|
+
const a = (i / 8) * Math.PI * 2
|
|
917
|
+
addBox(
|
|
918
|
+
g,
|
|
919
|
+
r * 0.14,
|
|
920
|
+
h * 0.08,
|
|
921
|
+
r * 0.06,
|
|
922
|
+
Math.cos(a) * r * 0.48,
|
|
923
|
+
h * 0.09,
|
|
924
|
+
Math.sin(a) * r * 0.48,
|
|
925
|
+
p.metalCopper,
|
|
926
|
+
[0, -a, 0],
|
|
927
|
+
)
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
// ---------------------------------------------------------------------------
|
|
934
|
+
// Small Appliances & Electronics (9)
|
|
935
|
+
// ---------------------------------------------------------------------------
|
|
936
|
+
|
|
937
|
+
const buildCoffeeMachine: SlugBuilderFn = (w, h, d, p) => {
|
|
938
|
+
const g = new THREE.Group()
|
|
939
|
+
|
|
940
|
+
// Base drip tray & stainless grate cleanly proud
|
|
941
|
+
addBox(g, w * 0.94, h * 0.12, d * 0.96, 0, h * 0.06, 0, p.metalDark)
|
|
942
|
+
addBox(g, w * 0.82, h * 0.024, d * 0.48, 0, h * 0.132, d * 0.2, p.metalBrushed)
|
|
943
|
+
|
|
944
|
+
// Rear translucent water reservoir tank + main vertical stainless tower
|
|
945
|
+
addBox(g, w * 0.88, h * 0.72, d * 0.28, 0, h * 0.48, -d * 0.34, p.glass)
|
|
946
|
+
addBox(g, w * 0.9, h * 0.06, d * 0.3, 0, h * 0.86, -d * 0.34, p.plasticDark)
|
|
947
|
+
addBox(g, w * 0.94, h * 0.82, d * 0.34, 0, h * 0.53, -d * 0.04, p.metalBrushed)
|
|
948
|
+
|
|
949
|
+
// Overhanging brew head + front control strip + pressure dial proudly offset
|
|
950
|
+
addBox(g, w * 0.92, h * 0.26, d * 0.38, 0, h * 0.84, d * 0.24, p.metalDark)
|
|
951
|
+
addCyl(g, w * 0.12, w * 0.12, d * 0.04, 0, h * 0.84, d * 0.455, p.ceramicWhite, 14, [
|
|
952
|
+
Math.PI / 2,
|
|
953
|
+
0,
|
|
954
|
+
0,
|
|
955
|
+
])
|
|
956
|
+
addCyl(g, w * 0.045, w * 0.045, d * 0.04, -w * 0.28, h * 0.84, d * 0.455, p.emissiveGreen, 10, [
|
|
957
|
+
Math.PI / 2,
|
|
958
|
+
0,
|
|
959
|
+
0,
|
|
960
|
+
])
|
|
961
|
+
|
|
962
|
+
// Portafilter basket + angled handle + side steam wand
|
|
963
|
+
addCyl(g, w * 0.22, w * 0.2, h * 0.1, 0, h * 0.66, d * 0.24, p.metalChrome, 16)
|
|
964
|
+
addCyl(g, w * 0.045, w * 0.055, d * 0.38, 0, h * 0.65, d * 0.44, p.plasticDark, 10, [
|
|
965
|
+
Math.PI / 2,
|
|
966
|
+
0,
|
|
967
|
+
0,
|
|
968
|
+
])
|
|
969
|
+
addCyl(g, w * 0.025, w * 0.025, h * 0.28, w * 0.34, h * 0.56, d * 0.22, p.metalChrome, 8, [
|
|
970
|
+
0.15,
|
|
971
|
+
0,
|
|
972
|
+
-0.2,
|
|
973
|
+
])
|
|
974
|
+
|
|
975
|
+
// Ceramic espresso mug resting on drip grate
|
|
976
|
+
const mugR = w * 0.22
|
|
977
|
+
addCyl(g, mugR, mugR * 0.86, h * 0.28, 0, h * 0.27, d * 0.22, p.ceramicWhite, 16)
|
|
978
|
+
addTorus(g, mugR * 0.5, mugR * 0.14, mugR * 1.05, h * 0.27, d * 0.22, p.ceramicWhite, [0, 0, 0])
|
|
979
|
+
|
|
980
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
const buildKettle: SlugBuilderFn = (w, h, d, p) => {
|
|
984
|
+
const g = new THREE.Group()
|
|
985
|
+
const bodyR = Math.min(w * 0.36, d * 0.46)
|
|
986
|
+
|
|
987
|
+
// 360-degree swivel power base + glowing power switch
|
|
988
|
+
addCyl(g, bodyR * 1.04, bodyR * 1.08, h * 0.11, 0, h * 0.055, 0, p.plasticDark, 22)
|
|
989
|
+
addBox(g, bodyR * 0.24, h * 0.05, bodyR * 0.18, bodyR * 0.92, h * 0.07, 0, p.emissiveWarm)
|
|
990
|
+
|
|
991
|
+
// Tapered brushed stainless steel kettle vessel + water level window
|
|
992
|
+
addCyl(g, bodyR * 0.78, bodyR, h * 0.72, 0, h * 0.47, 0, p.metalBrushed, 24)
|
|
993
|
+
addBox(g, bodyR * 0.16, h * 0.46, bodyR * 0.12, 0, h * 0.46, bodyR * 0.88, p.glass)
|
|
994
|
+
|
|
995
|
+
// Hinged domed lid + center lid lift knob
|
|
996
|
+
addCyl(g, bodyR * 0.72, bodyR * 0.78, h * 0.08, 0, h * 0.86, 0, p.metalChrome, 20)
|
|
997
|
+
addSphere(g, bodyR * 0.2, 0, h * 0.94, 0, p.plasticDark, [1, 0.7, 1], 12)
|
|
998
|
+
|
|
999
|
+
// Angled pouring spout on -X side
|
|
1000
|
+
addCyl(
|
|
1001
|
+
g,
|
|
1002
|
+
bodyR * 0.14,
|
|
1003
|
+
bodyR * 0.24,
|
|
1004
|
+
w * 0.28,
|
|
1005
|
+
-bodyR * 0.95,
|
|
1006
|
+
h * 0.72,
|
|
1007
|
+
0,
|
|
1008
|
+
p.metalBrushed,
|
|
1009
|
+
12,
|
|
1010
|
+
[0, 0, 0.82],
|
|
1011
|
+
)
|
|
1012
|
+
|
|
1013
|
+
// Ergonomic D-handle on +X side
|
|
1014
|
+
addBox(g, w * 0.22, h * 0.07, bodyR * 0.26, bodyR * 0.98, h * 0.76, 0, p.plasticDark)
|
|
1015
|
+
addBox(g, w * 0.1, h * 0.56, bodyR * 0.28, bodyR * 1.18, h * 0.49, 0, p.plasticDark)
|
|
1016
|
+
addBox(g, w * 0.22, h * 0.07, bodyR * 0.26, bodyR * 0.98, h * 0.22, 0, p.plasticDark)
|
|
1017
|
+
|
|
1018
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
const buildToaster: SlugBuilderFn = (w, h, d, p) => {
|
|
1022
|
+
const g = new THREE.Group()
|
|
1023
|
+
|
|
1024
|
+
// 4 rubber feet
|
|
1025
|
+
for (const sx of [-1, 1]) {
|
|
1026
|
+
for (const sz of [-1, 1]) {
|
|
1027
|
+
addCyl(g, w * 0.055, w * 0.06, h * 0.07, sx * w * 0.34, h * 0.035, sz * d * 0.34, p.rubberBlack, 10)
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
// Rounded stainless toaster body + lower matte trim skirt
|
|
1032
|
+
addBox(g, w * 0.9, h * 0.12, d * 0.9, 0, h * 0.11, 0, p.plasticDark)
|
|
1033
|
+
addRoundedRectExtrude(g, w * 0.88, d * 0.88, h * 0.78, d * 0.22, 0, h * 0.54, 0, p.metalBrushed)
|
|
1034
|
+
|
|
1035
|
+
// Top chrome bezel plate + 2 recessed dark toast slots
|
|
1036
|
+
addBox(g, w * 0.78, h * 0.03, d * 0.72, 0, h * 0.94, 0, p.metalChrome)
|
|
1037
|
+
for (const sz of [-0.18, 0.18]) {
|
|
1038
|
+
addBox(g, w * 0.66, h * 0.06, d * 0.17, 0, h * 0.94, sz * d, p.plasticDark)
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
// Right-end carriage lever slot, press handle, browning knob & cancel button
|
|
1042
|
+
addBox(g, w * 0.04, h * 0.44, d * 0.1, w * 0.45, h * 0.58, 0, p.plasticDark)
|
|
1043
|
+
addBox(g, w * 0.12, h * 0.08, d * 0.26, w * 0.5, h * 0.7, 0, p.plasticDark)
|
|
1044
|
+
addCyl(g, h * 0.11, h * 0.12, w * 0.07, w * 0.46, h * 0.28, -d * 0.18, p.metalChrome, 14, [
|
|
1045
|
+
0,
|
|
1046
|
+
0,
|
|
1047
|
+
Math.PI / 2,
|
|
1048
|
+
])
|
|
1049
|
+
addCyl(g, h * 0.055, h * 0.055, w * 0.06, w * 0.46, h * 0.28, d * 0.18, p.emissiveRed, 10, [
|
|
1050
|
+
0,
|
|
1051
|
+
0,
|
|
1052
|
+
Math.PI / 2,
|
|
1053
|
+
])
|
|
1054
|
+
|
|
1055
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
const buildIron: SlugBuilderFn = (w, h, d, p) => {
|
|
1059
|
+
const g = new THREE.Group()
|
|
1060
|
+
|
|
1061
|
+
// Helper to build a true teardrop/pointed steam-iron planform shape in (X length, Y width)
|
|
1062
|
+
const makeIronPlanform = (len: number, wid: number): THREE.Shape => {
|
|
1063
|
+
const s = new THREE.Shape()
|
|
1064
|
+
const hw = wid * 0.5
|
|
1065
|
+
s.moveTo(-len * 0.48, -hw * 0.86)
|
|
1066
|
+
s.quadraticCurveTo(-len * 0.52, 0, -len * 0.48, hw * 0.86)
|
|
1067
|
+
s.bezierCurveTo(-len * 0.14, hw * 1.05, len * 0.22, hw * 0.72, len * 0.5, 0)
|
|
1068
|
+
s.bezierCurveTo(len * 0.22, -hw * 0.72, -len * 0.14, -hw * 1.05, -len * 0.48, -hw * 0.86)
|
|
1069
|
+
return s
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
const extrudePlanform = (
|
|
1073
|
+
len: number,
|
|
1074
|
+
wid: number,
|
|
1075
|
+
thick: number,
|
|
1076
|
+
yBot: number,
|
|
1077
|
+
xOff: number,
|
|
1078
|
+
mat: THREE.Material,
|
|
1079
|
+
bevel = 0.004,
|
|
1080
|
+
): void => {
|
|
1081
|
+
const safeBevel = Math.min(bevel, len * 0.06, wid * 0.08, thick * 0.35)
|
|
1082
|
+
const geom = new THREE.ExtrudeGeometry(makeIronPlanform(len, wid), {
|
|
1083
|
+
depth: thick,
|
|
1084
|
+
bevelEnabled: safeBevel > 1e-4,
|
|
1085
|
+
bevelThickness: safeBevel,
|
|
1086
|
+
bevelSize: safeBevel,
|
|
1087
|
+
bevelSegments: 2,
|
|
1088
|
+
curveSegments: 16,
|
|
1089
|
+
})
|
|
1090
|
+
geom.rotateX(-Math.PI / 2)
|
|
1091
|
+
const mesh = new THREE.Mesh(geom, mat)
|
|
1092
|
+
mesh.position.set(xOff, yBot, 0)
|
|
1093
|
+
g.add(mesh)
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
// 1. Sleek tapered stainless-steel soleplate resting flat on y = 0
|
|
1097
|
+
extrudePlanform(w * 0.98, d * 0.96, h * 0.09, 0.004, 0, p.metalChrome, 0.004)
|
|
1098
|
+
// 2. Sculpted white lower body deck & translucent blue steam water tank tapering cleanly upward
|
|
1099
|
+
extrudePlanform(w * 0.9, d * 0.86, h * 0.18, h * 0.1, -w * 0.02, p.plasticWhite, 0.008)
|
|
1100
|
+
extrudePlanform(w * 0.78, d * 0.72, h * 0.22, h * 0.26, -w * 0.04, p.paintBlue, 0.01)
|
|
1101
|
+
// 3. Temperature fabric selector dial nested on top deck beneath handle arch
|
|
1102
|
+
addCyl(g, d * 0.18, d * 0.2, h * 0.08, -w * 0.06, h * 0.53, 0, p.plasticDark, 16)
|
|
1103
|
+
addCyl(g, d * 0.12, d * 0.12, h * 0.09, -w * 0.06, h * 0.54, 0, p.metalChrome, 14)
|
|
1104
|
+
|
|
1105
|
+
// 4. Sculpted swept-back open ergonomic top handle (front riser + horizontal grip + steam burst buttons)
|
|
1106
|
+
addBox(g, w * 0.16, h * 0.42, d * 0.28, w * 0.1, h * 0.65, 0, p.plasticWhite, [0, 0, 0.52])
|
|
1107
|
+
addRoundedRectExtrude(g, w * 0.56, d * 0.28, h * 0.15, d * 0.08, -w * 0.14, h * 0.84, 0, p.plasticWhite)
|
|
1108
|
+
addRoundedRectExtrude(g, w * 0.36, d * 0.3, h * 0.12, d * 0.07, -w * 0.16, h * 0.89, 0, p.rubberBlack)
|
|
1109
|
+
// Dual steam/spray push buttons at handle thumb rest + precision spray nozzle at tip
|
|
1110
|
+
addCyl(g, d * 0.065, d * 0.065, h * 0.06, w * 0.08, h * 0.93, -d * 0.06, p.paintBlue, 10)
|
|
1111
|
+
addCyl(g, d * 0.065, d * 0.065, h * 0.06, w * 0.08, h * 0.93, d * 0.06, p.metalChrome, 10)
|
|
1112
|
+
addCyl(g, d * 0.045, d * 0.055, w * 0.06, w * 0.32, h * 0.44, 0, p.metalChrome, 10, [0, 0, Math.PI / 2])
|
|
1113
|
+
|
|
1114
|
+
// 5. Rear standing heel rest flange & rubber power-cord flex boot at -X
|
|
1115
|
+
addBox(g, w * 0.07, h * 0.68, d * 0.64, -w * 0.44, h * 0.46, 0, p.plasticDark, [0, 0, 0.14])
|
|
1116
|
+
addCyl(g, d * 0.05, d * 0.07, w * 0.12, -w * 0.5, h * 0.68, 0, p.rubberBlack, 10, [0, 0, Math.PI / 2])
|
|
1117
|
+
|
|
1118
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
const buildSewingMachine: SlugBuilderFn = (w, h, d, p) => {
|
|
1122
|
+
const g = new THREE.Group()
|
|
1123
|
+
|
|
1124
|
+
// Flatbed base + brushed stainless needle plate
|
|
1125
|
+
addBox(g, w * 0.94, h * 0.18, d * 0.88, 0, h * 0.09, 0, p.plasticWhite)
|
|
1126
|
+
addBox(g, w * 0.24, h * 0.025, d * 0.42, -w * 0.28, h * 0.185, d * 0.06, p.metalBrushed)
|
|
1127
|
+
|
|
1128
|
+
// Right vertical column pillar
|
|
1129
|
+
addBox(g, w * 0.28, h * 0.68, d * 0.72, w * 0.32, h * 0.5, 0, p.plasticWhite)
|
|
1130
|
+
|
|
1131
|
+
// Overhanging upper horizontal arm + left needle head housing
|
|
1132
|
+
addBox(g, w * 0.86, h * 0.26, d * 0.62, -w * 0.02, h * 0.78, 0, p.plasticWhite)
|
|
1133
|
+
addBox(g, w * 0.2, h * 0.38, d * 0.58, -w * 0.35, h * 0.64, 0, p.plasticWhite)
|
|
1134
|
+
|
|
1135
|
+
// Needle bar, presser foot & work light
|
|
1136
|
+
addCyl(g, w * 0.012, w * 0.008, h * 0.28, -w * 0.32, h * 0.36, d * 0.06, p.metalChrome, 8)
|
|
1137
|
+
addBox(g, w * 0.07, h * 0.03, d * 0.14, -w * 0.32, h * 0.22, d * 0.06, p.metalChrome)
|
|
1138
|
+
addBox(g, w * 0.06, h * 0.04, d * 0.12, -w * 0.22, h * 0.62, d * 0.06, p.emissiveWarm)
|
|
1139
|
+
|
|
1140
|
+
// Stitch selector dial, tension knob & reverse lever on front face
|
|
1141
|
+
addCyl(g, h * 0.09, h * 0.095, d * 0.12, w * 0.32, h * 0.52, d * 0.36, p.metalDark, 16, [
|
|
1142
|
+
Math.PI / 2,
|
|
1143
|
+
0,
|
|
1144
|
+
0,
|
|
1145
|
+
])
|
|
1146
|
+
addCyl(g, h * 0.055, h * 0.055, d * 0.1, -w * 0.05, h * 0.78, d * 0.32, p.plasticDark, 14, [
|
|
1147
|
+
Math.PI / 2,
|
|
1148
|
+
0,
|
|
1149
|
+
0,
|
|
1150
|
+
])
|
|
1151
|
+
addBox(g, w * 0.18, h * 0.11, d * 0.05, w * 0.1, h * 0.78, d * 0.32, p.screenGlow)
|
|
1152
|
+
|
|
1153
|
+
// Right-side handwheel
|
|
1154
|
+
addCyl(g, h * 0.16, h * 0.16, w * 0.09, w * 0.49, h * 0.72, 0, p.ceramicMatte, 20, [
|
|
1155
|
+
0,
|
|
1156
|
+
0,
|
|
1157
|
+
Math.PI / 2,
|
|
1158
|
+
])
|
|
1159
|
+
addCyl(g, h * 0.08, h * 0.08, w * 0.11, w * 0.5, h * 0.72, 0, p.metalChrome, 14, [
|
|
1160
|
+
0,
|
|
1161
|
+
0,
|
|
1162
|
+
Math.PI / 2,
|
|
1163
|
+
])
|
|
1164
|
+
|
|
1165
|
+
// Top spool pin + thread spool
|
|
1166
|
+
addCyl(g, w * 0.012, w * 0.012, h * 0.14, w * 0.24, h * 0.96, -d * 0.06, p.metalChrome, 8)
|
|
1167
|
+
addCyl(g, w * 0.045, w * 0.045, h * 0.1, w * 0.24, h * 0.95, -d * 0.06, p.paintRed, 14)
|
|
1168
|
+
|
|
1169
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
const buildComputer: SlugBuilderFn = (w, h, d, p) => {
|
|
1173
|
+
const g = new THREE.Group()
|
|
1174
|
+
|
|
1175
|
+
// Monitor pedestal base & tilted aluminum neck
|
|
1176
|
+
addBox(g, w * 0.32, h * 0.03, d * 0.56, 0, h * 0.015, -d * 0.16, p.metalBrushed)
|
|
1177
|
+
addBox(g, w * 0.12, h * 0.38, d * 0.07, 0, h * 0.22, -d * 0.26, p.metalBrushed, [-0.18, 0, 0])
|
|
1178
|
+
|
|
1179
|
+
// Widescreen display chassis, brushed lower chin & glowing screen
|
|
1180
|
+
const monY = h * 0.62
|
|
1181
|
+
const monH = h * 0.72
|
|
1182
|
+
addBox(g, w, monH, d * 0.14, 0, monY, -d * 0.16, p.plasticDark)
|
|
1183
|
+
addBox(g, w, monH * 0.14, d * 0.15, 0, monY - monH * 0.43, -d * 0.15, p.metalBrushed)
|
|
1184
|
+
addBox(g, w * 0.95, monH * 0.8, d * 0.04, 0, monY + monH * 0.06, -d * 0.08, p.screenGlow)
|
|
1185
|
+
// Tiny webcam dot at top center
|
|
1186
|
+
addCyl(g, w * 0.01, w * 0.01, d * 0.03, 0, monY + monH * 0.47, -d * 0.08, p.metalChrome, 8, [
|
|
1187
|
+
Math.PI / 2,
|
|
1188
|
+
0,
|
|
1189
|
+
0,
|
|
1190
|
+
])
|
|
1191
|
+
|
|
1192
|
+
// Low-profile wireless keyboard & sculpted mouse in front
|
|
1193
|
+
const kbW = w * 0.58
|
|
1194
|
+
const kbD = d * 0.34
|
|
1195
|
+
addBox(g, kbW, h * 0.03, kbD, -w * 0.08, h * 0.02, d * 0.3, p.metalBrushed, [0.1, 0, 0])
|
|
1196
|
+
for (let row = 0; row < 4; row++) {
|
|
1197
|
+
addBox(
|
|
1198
|
+
g,
|
|
1199
|
+
kbW * 0.92,
|
|
1200
|
+
h * 0.016,
|
|
1201
|
+
kbD * 0.16,
|
|
1202
|
+
-w * 0.08,
|
|
1203
|
+
h * 0.038,
|
|
1204
|
+
d * (0.2 + row * 0.068),
|
|
1205
|
+
p.plasticDark,
|
|
1206
|
+
[0.1, 0, 0],
|
|
1207
|
+
)
|
|
1208
|
+
}
|
|
1209
|
+
addSphere(g, w * 0.05, w * 0.34, h * 0.03, d * 0.32, p.plasticWhite, [0.9, 0.45, 1.5], 12)
|
|
1210
|
+
|
|
1211
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
const buildTelevision: SlugBuilderFn = (w, h, d, p) => {
|
|
1215
|
+
const g = new THREE.Group()
|
|
1216
|
+
|
|
1217
|
+
// Wide central pedestal base & vertical support column
|
|
1218
|
+
addBox(g, w * 0.42, h * 0.04, d * 0.78, 0, h * 0.02, 0, p.metalDark)
|
|
1219
|
+
addBox(g, w * 0.14, h * 0.24, d * 0.18, 0, h * 0.14, -d * 0.08, p.metalBrushed)
|
|
1220
|
+
// Flanking splayed feet accents for stability aesthetic
|
|
1221
|
+
for (const sx of [-1, 1]) {
|
|
1222
|
+
addBox(g, w * 0.04, h * 0.035, d * 0.68, sx * w * 0.34, h * 0.02, 0, p.metalBrushed)
|
|
1223
|
+
addBox(g, w * 0.04, h * 0.15, d * 0.08, sx * w * 0.34, h * 0.09, -d * 0.04, p.metalDark)
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
// Main widescreen panel bezel + rear electronics housing + glowing 16:9 screen
|
|
1227
|
+
const screenH = h * 0.84
|
|
1228
|
+
const screenY = h * 0.58
|
|
1229
|
+
addBox(g, w, screenH, d * 0.12, 0, screenY, -d * 0.04, p.plasticDark)
|
|
1230
|
+
addBox(g, w * 0.76, screenH * 0.64, d * 0.14, 0, screenY - screenH * 0.08, -d * 0.14, p.plasticDark)
|
|
1231
|
+
addBox(g, w * 0.96, screenH * 0.93, d * 0.04, 0, screenY, d * 0.02, p.screenGlow)
|
|
1232
|
+
|
|
1233
|
+
// Compact soundbar resting along the front of the base
|
|
1234
|
+
addBox(g, w * 0.56, h * 0.075, d * 0.22, 0, h * 0.06, d * 0.3, p.plasticDark)
|
|
1235
|
+
addBox(g, w * 0.54, h * 0.055, d * 0.04, 0, h * 0.06, d * 0.41, p.metalBrushed)
|
|
1236
|
+
addBox(g, w * 0.02, h * 0.02, d * 0.03, w * 0.22, h * 0.06, d * 0.42, p.emissiveGreen)
|
|
1237
|
+
|
|
1238
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
const buildFlatScreenTv: SlugBuilderFn = (w, h, d, p) => {
|
|
1242
|
+
const g = new THREE.Group()
|
|
1243
|
+
|
|
1244
|
+
// Rear low-profile VESA wall mount bracket
|
|
1245
|
+
addBox(g, w * 0.48, h * 0.46, d * 0.35, 0, h * 0.5, -d * 0.32, p.metalDark)
|
|
1246
|
+
// Metallic outer perimeter bezel + main ultra-thin body
|
|
1247
|
+
addBox(g, w, h, d * 0.42, 0, h * 0.5, d * 0.06, p.metalBrushed)
|
|
1248
|
+
addBox(g, w * 0.99, h * 0.985, d * 0.44, 0, h * 0.5, d * 0.09, p.plasticDark)
|
|
1249
|
+
// Glowing OLED screen surface
|
|
1250
|
+
addBox(g, w * 0.96, h * 0.94, d * 0.12, 0, h * 0.5, d * 0.34, p.screenGlow)
|
|
1251
|
+
// Bottom center IR receiver & standby LED
|
|
1252
|
+
addBox(g, w * 0.06, h * 0.024, d * 0.22, 0, h * 0.012, d * 0.24, p.plasticDark)
|
|
1253
|
+
addBox(g, w * 0.015, h * 0.012, d * 0.06, 0, h * 0.012, d * 0.36, p.emissiveRed)
|
|
1254
|
+
|
|
1255
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
const buildStereoSpeaker: SlugBuilderFn = (w, h, d, p) => {
|
|
1259
|
+
const g = new THREE.Group()
|
|
1260
|
+
|
|
1261
|
+
// 4 brass isolation spike feet + weighted plinth
|
|
1262
|
+
const plinthH = h * 0.04
|
|
1263
|
+
for (const sx of [-1, 1]) {
|
|
1264
|
+
for (const sz of [-1, 1]) {
|
|
1265
|
+
addCyl(g, w * 0.06, w * 0.02, h * 0.03, sx * w * 0.38, h * 0.015, sz * d * 0.38, p.metalCopper, 8)
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
addBox(g, w, plinthH, d, 0, h * 0.03 + plinthH / 2, 0, p.metalDark)
|
|
1269
|
+
|
|
1270
|
+
// Tall wood-veneer cabinet + matte acoustic front baffle
|
|
1271
|
+
const cabH = h * 0.93
|
|
1272
|
+
const cabY = h * 0.07 + cabH / 2
|
|
1273
|
+
addBox(g, w * 0.9, cabH, d * 0.88, 0, cabY, -d * 0.02, p.woodDark)
|
|
1274
|
+
addBox(g, w * 0.82, cabH * 0.94, d * 0.08, 0, cabY, d * 0.43, p.plasticDark)
|
|
1275
|
+
|
|
1276
|
+
// Tweeter dome + waveguide ring
|
|
1277
|
+
const faceZ = d * 0.48
|
|
1278
|
+
addTorus(g, w * 0.16, w * 0.025, 0, h * 0.86, faceZ, p.metalChrome, [0, 0, 0])
|
|
1279
|
+
addSphere(g, w * 0.09, 0, h * 0.86, faceZ, p.metalDark, [1, 1, 0.55], 12)
|
|
1280
|
+
|
|
1281
|
+
// Midrange driver + dual large woofers
|
|
1282
|
+
const driverSpec: ReadonlyArray<readonly [number, number]> = [
|
|
1283
|
+
[0.68, 0.26],
|
|
1284
|
+
[0.45, 0.33],
|
|
1285
|
+
[0.24, 0.33],
|
|
1286
|
+
]
|
|
1287
|
+
for (const [yFrac, rFrac] of driverSpec) {
|
|
1288
|
+
const r = w * rFrac
|
|
1289
|
+
addTorus(g, r, w * 0.032, 0, h * yFrac, faceZ, p.rubberBlack, [0, 0, 0])
|
|
1290
|
+
addCyl(g, r * 0.88, r * 0.4, d * 0.06, 0, h * yFrac, faceZ - d * 0.02, p.metalDark, 20, [
|
|
1291
|
+
Math.PI / 2,
|
|
1292
|
+
0,
|
|
1293
|
+
0,
|
|
1294
|
+
])
|
|
1295
|
+
addSphere(g, r * 0.24, 0, h * yFrac, faceZ, p.metalBrushed, [1, 1, 0.6], 12)
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
// Bottom bass-reflex port slot
|
|
1299
|
+
addBox(g, w * 0.54, h * 0.038, d * 0.06, 0, h * 0.11, faceZ, p.rubberBlack)
|
|
1300
|
+
|
|
1301
|
+
return normalizeAndGroundGroup(g, w, h, d)
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
export const APPLIANCE_MEP_BUILDERS: Record<string, SlugBuilderFn> = {
|
|
1305
|
+
// HVAC & MEP (9)
|
|
1306
|
+
'ac-block': buildAcBlock,
|
|
1307
|
+
'air-conditioner': buildAirConditioner,
|
|
1308
|
+
'air-conditioner-block': buildAirConditionerBlock,
|
|
1309
|
+
'air-conditioning': buildAirConditioning,
|
|
1310
|
+
'ceiling-fan': buildCeilingFan,
|
|
1311
|
+
'electric-panel': buildElectricPanel,
|
|
1312
|
+
'ev-wall-charger': buildEvWallCharger,
|
|
1313
|
+
'power-outlet-moa09g0o': buildPowerOutlet,
|
|
1314
|
+
thermostat: buildThermostat,
|
|
1315
|
+
|
|
1316
|
+
// Safety & Fire (8)
|
|
1317
|
+
'alarm-keypad': buildAlarmKeypad,
|
|
1318
|
+
'exit-sign': buildExitSign,
|
|
1319
|
+
'fire-alarm': buildFireAlarm,
|
|
1320
|
+
'fire-detector': buildFireDetector,
|
|
1321
|
+
'fire-extinguisher': buildFireExtinguisher,
|
|
1322
|
+
hydrant: buildHydrant,
|
|
1323
|
+
'smoke-detector': buildSmokeDetector,
|
|
1324
|
+
sprinkler: buildSprinkler,
|
|
1325
|
+
|
|
1326
|
+
// Small Appliances & Electronics (9)
|
|
1327
|
+
'coffee-machine': buildCoffeeMachine,
|
|
1328
|
+
kettle: buildKettle,
|
|
1329
|
+
toaster: buildToaster,
|
|
1330
|
+
iron: buildIron,
|
|
1331
|
+
'sewing-machine': buildSewingMachine,
|
|
1332
|
+
computer: buildComputer,
|
|
1333
|
+
television: buildTelevision,
|
|
1334
|
+
'flat-screen-tv': buildFlatScreenTv,
|
|
1335
|
+
'stereo-speaker': buildStereoSpeaker,
|
|
1336
|
+
}
|