@adatechnology/game-interactables-household 0.7.0 → 0.7.2

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/dist/index.js CHANGED
@@ -1996,7 +1996,8 @@ var types_default = [
1996
1996
  h: 4.4,
1997
1997
  y: 0,
1998
1998
  solid: true,
1999
- massKg: 14
1999
+ massKg: 14,
2000
+ fixed: true
2000
2001
  },
2001
2002
  {
2002
2003
  id: "electrical_panel",
@@ -2353,8 +2354,8 @@ function handle(c, kind, x, y, zf, len, color) {
2353
2354
  const oy = vertical ? s * (len / 2 - 0.025) : 0;
2354
2355
  c.b("metal", x + ox - 6e-3, y + oy - 6e-3, zf, x + ox + 6e-3, y + oy + 6e-3, zf + 0.02, dark);
2355
2356
  }
2356
- c.b("metal", x - gx / 2, y - gy / 2, zf + 0.018, x + gx / 2, y + gy / 2, zf + HANDLE, color);
2357
- c.b("metal", x - gx / 2 + (vertical ? 3e-3 : 0), y - gy / 2 + (vertical ? 0 : 3e-3), zf + HANDLE, x + gx / 2 - (vertical ? 3e-3 : 0), y + gy / 2 - (vertical ? 0 : 3e-3), zf + HANDLE + 5e-4, shade(color, 1.2));
2357
+ c.b("metal", x - gx / 2, y - gy / 2, zf + 0.018, x + gx / 2, y + gy / 2, zf + HANDLE - 2e-3, color);
2358
+ c.b("metal", x - gx / 2 + (vertical ? 3e-3 : 0), y - gy / 2 + (vertical ? 0 : 3e-3), zf + HANDLE - 2e-3, x + gx / 2 - (vertical ? 3e-3 : 0), y + gy / 2 - (vertical ? 0 : 3e-3), zf + HANDLE, shade(color, 1.2));
2358
2359
  }
2359
2360
  function hingedDoor(c, o) {
2360
2361
  const t = o.t ?? 0.02;
@@ -2385,11 +2386,11 @@ function hingedDoor(c, o) {
2385
2386
  c.b(mat, o.x0, o.y0 + r, o.zf - 3e-3, o.x0 + r, o.y1 - r, o.zf, shade(o.color, 1.06));
2386
2387
  c.b(mat, o.x1 - r, o.y0 + r, o.zf - 3e-3, o.x1, o.y1 - r, o.zf, shade(o.color, 1.06));
2387
2388
  } else {
2388
- c.b(mat, o.x0, o.y0, zIn, o.x1, o.y1, o.zf, o.color);
2389
- c.b(mat, o.x0 + 6e-3, o.y0 + 6e-3, o.zf - 2e-3, o.x1 - 6e-3, o.y1 - 6e-3, o.zf, shade(o.color, 1.04));
2389
+ c.b(mat, o.x0, o.y0, zIn, o.x1, o.y1, o.zf - 2e-3, o.color);
2390
+ c.b(mat, o.x0 + 6e-3, o.y0 + 6e-3, o.zf - 4e-3, o.x1 - 6e-3, o.y1 - 6e-3, o.zf, shade(o.color, 1.04));
2390
2391
  }
2391
2392
  const inner = o.inner ?? mix(o.color, 16777215, 0.55);
2392
- c.b("plain", o.x0 + 0.014, o.y0 + 0.014, zIn - 4e-3, o.x1 - 0.014, o.y1 - 0.014, zIn, inner);
2393
+ c.b("plain", o.x0 + 0.014, o.y0 + 0.014, zIn - 3e-3, o.x1 - 0.014, o.y1 - 0.014, zIn, inner);
2393
2394
  c.b("plain", o.x0 + 6e-3, o.y0 + 6e-3, zIn - 2e-3, o.x1 - 6e-3, o.y0 + 0.014, zIn, 3815996);
2394
2395
  c.b("plain", o.x0 + 6e-3, o.y1 - 0.014, zIn - 2e-3, o.x1 - 6e-3, o.y1 - 6e-3, zIn, 3815996);
2395
2396
  c.b("plain", o.x0 + 6e-3, o.y0 + 0.014, zIn - 2e-3, o.x0 + 0.014, o.y1 - 0.014, zIn, 3815996);
@@ -2427,7 +2428,7 @@ function drawer2(c, o) {
2427
2428
  const m = Math.min(0.04, (o.y1 - o.y0) / 4);
2428
2429
  c.b("wood", o.x0 + m, o.y0 + m, o.zf - 5e-3, o.x1 - m, o.y1 - m, o.zf - 1e-3, shade(o.color, 0.94));
2429
2430
  c.b("wood", o.x0 + m + 0.01, o.y0 + m + 0.01, o.zf - 1e-3, o.x1 - m - 0.01, o.y1 - m - 0.01, o.zf, mix(o.color, 16777215, 0.08));
2430
- c.b("wood", bx0, yb, zBack, bx1, yb + 8e-3, zFront, shade(o.color, 0.85));
2431
+ c.b("wood", bx0 + th, yb, zBack + th, bx1 - th, yb + 8e-3, zFront, shade(o.color, 0.85));
2431
2432
  c.b("wood", bx0, yb, zBack, bx0 + th, yt, zFront, shade(o.color, 0.88));
2432
2433
  c.b("wood", bx1 - th, yb, zBack, bx1, yt, zFront, shade(o.color, 0.88));
2433
2434
  c.b("wood", bx0 + th, yb, zBack, bx1 - th, yt, zBack + th, shade(o.color, 0.82));
@@ -2468,10 +2469,10 @@ function shell(c, o) {
2468
2469
  }
2469
2470
  function shelf(c, x0, x1, y, z0, z1, color, t = 0.016, glass = false) {
2470
2471
  if (glass) {
2471
- c.b("glass", x0, y - 6e-3, z0, x1, y, z1, 13625066);
2472
+ c.b("glass", x0, y - 6e-3, z0, x1, y, z1 - 0.012, 13625066);
2472
2473
  c.b("plain", x0, y - 8e-3, z1 - 0.012, x1, y + 0.012, z1, 15003376);
2473
2474
  } else {
2474
- c.b("wood", x0, y - t, z0, x1, y, z1, color);
2475
+ c.b("wood", x0, y - t, z0, x1, y, z1 - 3e-3, color);
2475
2476
  c.b("wood", x0, y - t, z1 - 3e-3, x1, y, z1, shade(color, 1.12));
2476
2477
  }
2477
2478
  }
@@ -2505,7 +2506,8 @@ function plugged(c, id, kind, watts, plug, o = {}) {
2505
2506
  id: `${id}_cord`,
2506
2507
  kind: "cord",
2507
2508
  radius: 4e-3,
2508
- points: [plug, [plug[0], Math.max(floor, plug[1] - 0.08), plug[2] - 0.04], [plug[0] + 0.05, floor, plug[2] - 0.2]]
2509
+ // (down the back from the plug, never behind it: behind the back is the wall the device stands against)
2510
+ points: [plug, [plug[0], Math.max(floor, plug[1] - 0.08), plug[2]], [plug[0] + 0.05, floor, plug[2]]]
2509
2511
  });
2510
2512
  }
2511
2513
 
@@ -2890,8 +2892,8 @@ var STOVE_WALL_GAP = 0.04;
2890
2892
  var STEEL = 11843772;
2891
2893
  var CHROME = 13817562;
2892
2894
  function tap2(c, x, y, z, id, partId) {
2893
- c.cyl("metal", x, y, z, 0.03, 0.02, STEEL, "cyl");
2894
- c.cyl("metal", x, y + 0.02, z, 0.017, 0.2, CHROME, "cyl");
2895
+ c.cyl("metal", x, y - 2e-3, z, 0.03, 0.022, STEEL, "cyl");
2896
+ c.cyl("metal", x, y + 0.02, z, 0.017, 0.19, CHROME, "cyl");
2895
2897
  c.cyl("metal", x, y + 0.2, z, 0.021, 0.02, STEEL, "cyl");
2896
2898
  c.b("metal", x - 0.015, y + 0.205, z, x + 0.015, y + 0.235, z + 0.015, CHROME);
2897
2899
  c.b("metal", x - 0.014, y + 0.205, z + 0.015, x + 0.014, y + 0.235, z + 0.19, CHROME);
@@ -3049,10 +3051,11 @@ function counterWithBasin(c, o) {
3049
3051
  const y0 = o.top - 0.04;
3050
3052
  const zf = hd - HANDLE + 0.02;
3051
3053
  const col = o.counter;
3052
- c.b("wood", -hw, y0, -hd, o.bx0, o.top, zf, col);
3053
- c.b("wood", o.bx1, y0, -hd, hw, o.top, zf, col);
3054
- c.b("wood", o.bx0, y0, -hd, o.bx1, o.top, o.bz0, col);
3055
- c.b("wood", o.bx0, y0, o.bz1, o.bx1, o.top, zf, col);
3054
+ const g = 0.01;
3055
+ c.b("wood", -hw, y0, -hd, o.bx0 - g, o.top, zf, col);
3056
+ c.b("wood", o.bx1 + g, y0, -hd, hw, o.top, zf, col);
3057
+ c.b("wood", o.bx0 - g, y0, -hd, o.bx1 + g, o.top, o.bz0 - g, col);
3058
+ c.b("wood", o.bx0 - g, y0, o.bz1 + g, o.bx1 + g, o.top, zf, col);
3056
3059
  const wall = o.steel ? 12896460 : 16054006;
3057
3060
  const floor = o.steel ? 11449014 : 15133162;
3058
3061
  const mat = o.steel ? "metal" : "plain";
@@ -3069,10 +3072,10 @@ function counterWithBasin(c, o) {
3069
3072
  c.b(mat, o.bx1, o.top, o.bz0, o.bx1 + 0.02, o.top + 4e-3, o.bz1, wall);
3070
3073
  }
3071
3074
  function pipes(c, x, top, z) {
3072
- const wall = -c.hd + 0.03;
3075
+ const wall = -c.hd + 2e-3;
3073
3076
  c.cyl("metal", x, 0.2, z, 0.02, top - 0.2 - 0.12, 13159632, "cyl6");
3074
3077
  c.rod("plain", "x", x + 0.06, 0.2, z, 0.02, 0.14, 15263976, "cyl6");
3075
- c.cyl("plain", x + 0.13, 0.08, z, 0.02, 0.14, 15263976, "cyl6");
3078
+ c.cyl("plain", x + 0.13, 0.07, z, 0.022, 0.15, 15263976, "cyl6");
3076
3079
  c.rod("plain", "z", x + 0.13, 0.09, (z + wall) / 2, 0.02, z - wall, 15263976, "cyl6");
3077
3080
  }
3078
3081
  function sinkKitchen(c) {
@@ -3137,7 +3140,7 @@ function utilitySink(c) {
3137
3140
  const tubTop = 0.88;
3138
3141
  const wall = 13619664;
3139
3142
  const bw = c.w - 0.04;
3140
- for (const sx of [-1, 1]) for (const sz of [-1, 1]) c.b("metal", sx * (hw - 0.04) - 0.02, 0, sz * (hd - 0.04) - 0.02, sx * (hw - 0.04) + 0.02, tubTop - 0.3, sz * (hd - 0.04) + 0.02, 6975090);
3143
+ for (const sx of [-1, 1]) for (const sz of [-1, 1]) c.b("metal", sx * (hw - 0.04) - 0.02, 0, sz * (hd - 0.04) - 0.02, sx * (hw - 0.04) + 0.02, tubTop - 0.32, sz * (hd - 0.04) + 0.02, 6975090);
3141
3144
  c.b("metal", -hw, tubTop - 0.34, -hd, hw, tubTop - 0.3, hd, 6975090);
3142
3145
  const x0 = -bw / 2;
3143
3146
  const x1 = bw / 2;
@@ -3272,16 +3275,16 @@ function sofaLike(c, n, lie) {
3272
3275
  const baseTop = 0.28;
3273
3276
  for (const sx of [-1, 1]) for (const sz of [-1, 1]) c.b("wood", sx * (hw - 0.07) - 0.025, 0, sz * (hd - 0.07) - 0.025, sx * (hw - 0.07) + 0.025, legH, sz * (hd - 0.07) + 0.025, 3811870);
3274
3277
  c.b("fabric", -hw, legH, -hd, hw, baseTop, hd, dark);
3275
- c.b("fabric", -hw + armW, baseTop - 0.01, hd - 0.02, hw - armW, baseTop + 0.02, hd, shade(fab, 0.7));
3278
+ c.b("fabric", -hw + armW, baseTop - 0.01, hd - 0.02, hw - armW, baseTop + 0.02, hd + 4e-3, shade(fab, 0.7));
3276
3279
  const bt = 0.2;
3277
3280
  c.b("fabric", -hw, baseTop, -hd, hw, h - 0.07 - bt / 2, -hd + bt, fab);
3278
- c.rod("fabric", "x", 0, h - 0.07 - bt / 2, -hd + bt / 2, bt / 2, c.w, fab);
3281
+ c.rod("fabric", "x", 0, h - 0.07 - bt / 2, -hd + bt / 2, bt / 2, c.w - 4e-3, fab);
3279
3282
  const armTop = 0.62;
3280
3283
  for (const s of [-1, 1]) {
3281
3284
  const x0 = s < 0 ? -hw : hw - armW;
3282
- c.b("fabric", x0, baseTop, -hd + bt, x0 + armW, armTop - armW / 2, hd, fab);
3283
- c.rod("fabric", "z", x0 + armW / 2, armTop - armW / 2, (-hd + bt + hd) / 2, armW / 2, hd - (-hd + bt), fab);
3284
- c.b("fabric", s < 0 ? x0 + armW - 0.012 : x0, baseTop + 0.02, -hd + bt, s < 0 ? x0 + armW : x0 + 0.012, armTop - armW / 2, hd - 0.02, light);
3285
+ c.b("fabric", s < 0 ? x0 : x0 + 6e-3, baseTop, -hd + bt, s < 0 ? x0 + armW - 6e-3 : x0 + armW, armTop - armW / 2, hd, fab);
3286
+ c.rod("fabric", "z", x0 + armW / 2, armTop - armW / 2, (-hd + bt + hd) / 2, armW / 2, hd - (-hd + bt) - 4e-3, fab);
3287
+ c.b("fabric", s < 0 ? x0 + armW - 0.012 : x0, baseTop + 0.02, -hd + bt + 3e-3, s < 0 ? x0 + armW : x0 + 0.012, armTop - armW / 2 + 3e-3, hd - 0.02, light);
3285
3288
  }
3286
3289
  const ix0 = -hw + armW;
3287
3290
  const ix1 = hw - armW;
@@ -3295,7 +3298,7 @@ function sofaLike(c, n, lie) {
3295
3298
  const col = i % 2 === 0 ? light : fab;
3296
3299
  c.b("fabric", x0, baseTop + 0.02, sz0 + 0.02, x1, seatY, sz1, col);
3297
3300
  c.b("fabric", x0 + 0.01, seatY, sz0 + 0.03, x1 - 0.01, seatY + 0.025, sz1 - 0.01, mix(col, 16777215, 0.06));
3298
- c.b("fabric", x0, baseTop + 0.02, sz1 - 6e-3, x1, seatY + 0.02, sz1, shade(col, 0.75));
3301
+ c.b("fabric", x0 + 3e-3, baseTop + 0.025, sz1 - 6e-3, x1 - 3e-3, seatY + 0.02, sz1 + 3e-3, shade(col, 0.75));
3299
3302
  c.b("fabric", x0 + 5e-3, seatY + 0.02, sz0 + 0.02, x1 - 5e-3, h - 0.12, sz0 + 0.19, col, 0, -0.18);
3300
3303
  const cx = (x0 + x1) / 2;
3301
3304
  seats.push({ id: `seat_${i + 1}`, pose: "sit", pos: [round3(cx), round3(seatY + 0.03), round3(sz0 + (sz1 - sz0) * 0.55)], ry: FACE, exit: [round3(cx), 0, round3(hd + 0.55)] });
@@ -3319,14 +3322,14 @@ function diningChair(c) {
3319
3322
  const seatY = 0.45;
3320
3323
  const lt = 0.035;
3321
3324
  for (const sx of [-1, 1]) for (const sz of [-1, 1]) c.b("wood", sx * (hw - lt / 2 - 0.01) - lt / 2, 0, sz * (hd - lt / 2 - 0.01) - lt / 2, sx * (hw - lt / 2 - 0.01) + lt / 2, sz < 0 ? h : seatY - 0.03, sz * (hd - lt / 2 - 0.01) + lt / 2, shade(wood, sz < 0 ? 0.9 : 1));
3322
- c.b("wood", -hw + 0.01, seatY - 0.09, -hd + 0.01, hw - 0.01, seatY - 0.04, -hd + 0.04, shade(wood, 0.85));
3323
- c.b("wood", -hw + 0.01, seatY - 0.09, hd - 0.04, hw - 0.01, seatY - 0.04, hd - 0.01, shade(wood, 0.85));
3324
- c.b("wood", -hw + 0.01, seatY - 0.09, -hd + 0.04, -hw + 0.04, seatY - 0.04, hd - 0.04, shade(wood, 0.85));
3325
- c.b("wood", hw - 0.04, seatY - 0.09, -hd + 0.04, hw - 0.01, seatY - 0.04, hd - 0.04, shade(wood, 0.85));
3325
+ c.b("wood", -hw + 0.014, seatY - 0.09, -hd + 0.014, hw - 0.014, seatY - 0.04, -hd + 0.04, shade(wood, 0.85));
3326
+ c.b("wood", -hw + 0.014, seatY - 0.09, hd - 0.04, hw - 0.014, seatY - 0.04, hd - 0.014, shade(wood, 0.85));
3327
+ c.b("wood", -hw + 0.014, seatY - 0.09, -hd + 0.04, -hw + 0.04, seatY - 0.04, hd - 0.04, shade(wood, 0.85));
3328
+ c.b("wood", hw - 0.04, seatY - 0.09, -hd + 0.04, hw - 0.014, seatY - 0.04, hd - 0.04, shade(wood, 0.85));
3326
3329
  c.b("wood", -hw, seatY - 0.03, -hd, hw, seatY, hd, wood);
3327
3330
  c.b("fabric", -hw + 0.02, seatY, -hd + 0.05, hw - 0.02, seatY + 0.04, hd - 0.02, cush);
3328
3331
  c.b("fabric", -hw + 0.03, seatY + 0.04, -hd + 0.06, hw - 0.03, seatY + 0.045, hd - 0.03, mix(cush, 16777215, 0.1));
3329
- c.b("wood", -hw + 0.01, h - 0.1, -hd + 0.01, hw - 0.01, h - 0.03, -hd + 0.04, wood);
3332
+ c.b("wood", -hw + 0.014, h - 0.1, -hd + 0.014, hw - 0.014, h - 0.03, -hd + 0.04, wood);
3330
3333
  for (let i = 0; i < 3; i++) c.b("wood", -hw + 0.07 + i * ((c.w - 0.14) / 3), seatY + 0.06, -hd + 0.015, -hw + 0.07 + i * ((c.w - 0.14) / 3) + 0.04, h - 0.1, -hd + 0.035, shade(wood, 1.05));
3331
3334
  c.add("seats", { id: "seat", pose: "sit", pos: [0, round3(seatY + 0.05), 0.02], ry: FACE, exit: [0, 0, round3(hd + 0.45)] });
3332
3335
  c.interact("sit", [0, seatY + 0.3, 0.1], { do: "sit", seat: "seat" }, "prompt.sit", 1.5);
@@ -3338,8 +3341,8 @@ function bedBuild(c, double) {
3338
3341
  const frameTop = 0.3;
3339
3342
  const matTop = 0.54;
3340
3343
  for (const sx of [-1, 1]) for (const sz of [-1, 1]) c.b("wood", sx * (hw - 0.04) - 0.035, 0, sz * (hd - 0.04) - 0.035, sx * (hw - 0.04) + 0.035, 0.16, sz * (hd - 0.04) + 0.035, shade(wood, 0.8));
3341
- c.b("wood", -hw, 0.14, -hd, -hw + 0.05, frameTop, hd, wood);
3342
- c.b("wood", hw - 0.05, 0.14, -hd, hw, frameTop, hd, wood);
3344
+ c.b("wood", -hw, 0.14, -hd + 0.06, -hw + 0.05, frameTop, hd - 0.05, wood);
3345
+ c.b("wood", hw - 0.05, 0.14, -hd + 0.06, hw, frameTop, hd - 0.05, wood);
3343
3346
  c.b("wood", -hw, 0.14, hd - 0.05, hw, 0.44, hd, shade(wood, 1.05));
3344
3347
  c.b("wood", -hw, 0.14, -hd, hw, h, -hd + 0.06, shade(wood, 0.92));
3345
3348
  c.b("wood", -hw + 0.06, h - 0.08, -hd + 0.06, hw - 0.06, h - 0.02, -hd + 0.07, shade(wood, 1.12));
@@ -3381,10 +3384,10 @@ function bench(c) {
3381
3384
  const x = sx * (hw - 0.06);
3382
3385
  c.b("metal", x - 0.025, 0, -hd + 0.05, x + 0.025, seatY - 0.03, -hd + 0.09, iron);
3383
3386
  c.b("metal", x - 0.025, 0, hd - 0.09, x + 0.025, seatY - 0.03, hd - 0.05, iron);
3384
- c.b("metal", x - 0.025, seatY - 0.05, -hd + 0.04, x + 0.025, seatY - 0.02, hd - 0.04, iron);
3387
+ c.b("metal", x - 0.02, seatY - 0.05, -hd + 0.04, x + 0.02, seatY - 0.02, hd - 0.04, iron);
3385
3388
  c.b("metal", x - 0.025, seatY - 0.02, -hd + 0.04, x + 0.025, h, -hd + 0.08, iron);
3386
- c.b("metal", x - 0.03, 0.62, -hd + 0.04, x + 0.03, 0.655, hd - 0.12, iron);
3387
- c.b("metal", x - 0.025, seatY - 0.02, hd - 0.12, x + 0.025, 0.62, hd - 0.09, iron);
3389
+ c.b("metal", x - 0.03, 0.62, -hd + 0.045, x + 0.03, 0.655, hd - 0.12, iron);
3390
+ c.b("metal", x - 0.025, seatY - 0.04, hd - 0.12, x + 0.025, 0.62, hd - 0.09, iron);
3388
3391
  }
3389
3392
  for (let i = 0; i < 5; i++) c.b("wood", -hw + 0.03, seatY - 0.02, -hd + 0.09 + i * ((c.d - 0.18) / 5), hw - 0.03, seatY + 0.015, -hd + 0.09 + i * ((c.d - 0.18) / 5) + (c.d - 0.18) / 5 - 0.012, i % 2 ? wood : shade(wood, 1.06));
3390
3393
  for (let i = 0; i < 3; i++) c.b("wood", -hw + 0.03, 0.55 + i * 0.1, -hd + 0.025, hw - 0.03, 0.55 + i * 0.1 + 0.075, -hd + 0.05, i % 2 ? wood : shade(wood, 1.06));
@@ -3424,7 +3427,7 @@ function bunkBed(c) {
3424
3427
  c.b("wood", -hw + post, highTop + 0.04, zEnd - post - 0.45, -hw + post + 0.03, highTop + 0.07, zEnd - post, wood);
3425
3428
  c.b("wood", hw - post - 0.03, highTop + 0.04, zEnd - post - 0.45, hw - post, highTop + 0.07, zEnd - post, wood);
3426
3429
  for (const x of [-0.2, 0.2]) c.b("wood", x - 0.02, 0.06, zEnd, x + 0.02, highTop + 0.3, hd, shade(wood, 1.1));
3427
- for (let i = 0; i < 5; i++) c.b("wood", -0.2, 0.3 + i * 0.22, zEnd, 0.2, 0.34 + i * 0.22, hd - 0.01, wood);
3430
+ for (let i = 0; i < 5; i++) c.b("wood", -0.2, 0.3 + i * 0.22, zEnd + 5e-3, 0.2, 0.34 + i * 0.22, hd - 0.01, wood);
3428
3431
  for (const [id, top, ex] of [["lie_lower", lowTop, 1], ["lie_upper", highTop, -1]]) {
3429
3432
  c.add("seats", { id, pose: "lie", pos: [0, round3(top + 0.06), round3(-hd + 0.95)], ry: FACE, eye: 0.2, exit: [round3(ex * (hw + 0.5)), 0, round3(-hd + 1.1)] });
3430
3433
  c.interact(`lie_${id}`, [0, round3(top + 0.3), round3(-hd + 0.95)], { do: "sit", seat: id }, "prompt.lie", 1.8);
@@ -3598,10 +3601,12 @@ function drawPieces(c, pieces, f) {
3598
3601
  // src/builders/storage.ts
3599
3602
  var sideOf = (c, fallback) => c.M.hinge ?? fallback;
3600
3603
  function doorLedge(c, x0, x1, y, zIn, depth, color) {
3601
- c.b("plain", x0, y, zIn - depth, x1, y + 8e-3, zIn, color);
3602
- c.b("plain", x0, y, zIn - depth, x1, y + 0.05, zIn - depth + 8e-3, mix(color, 16777215, 0.3));
3603
- c.b("plain", x0, y, zIn - depth, x0 + 8e-3, y + 0.05, zIn, mix(color, 16777215, 0.3));
3604
- c.b("plain", x1 - 8e-3, y, zIn - depth, x1, y + 0.05, zIn, mix(color, 16777215, 0.3));
3604
+ const zLip = zIn - depth + 8e-3;
3605
+ const zEnd = zIn - 2e-3;
3606
+ c.b("plain", x0 + 8e-3, y, zLip, x1 - 8e-3, y + 8e-3, zEnd, color);
3607
+ c.b("plain", x0, y, zIn - depth, x1, y + 0.05, zLip, mix(color, 16777215, 0.3));
3608
+ c.b("plain", x0, y, zLip, x0 + 8e-3, y + 0.05, zEnd, mix(color, 16777215, 0.3));
3609
+ c.b("plain", x1 - 8e-3, y, zLip, x1, y + 0.05, zEnd, mix(color, 16777215, 0.3));
3605
3610
  }
3606
3611
  function fridge(c) {
3607
3612
  const { hw, hd, h } = c;
@@ -3615,7 +3620,7 @@ function fridge(c) {
3615
3620
  const sh = shell(c, { x0: -hw, x1: hw, y0: 0.05, y1: h, z0: -hd, z1: zb, color: body, inner: lining, t: 0.04, tTop: 0.03, tBottom: 0.05, tBack: 0.03, material: "plain" });
3616
3621
  c.b("plain", -hw + 0.03, 0, -hd + 0.03, hw - 0.03, 0.05, zb - 0.04, 2895408);
3617
3622
  const yd = h - fh - 0.04;
3618
- c.b("plain", sh.ix0, yd, sh.iz0, sh.ix1, yd + 0.04, zb, shade(body, 0.92));
3623
+ c.b("plain", sh.ix0 + 3e-3, yd, sh.iz0, sh.ix1 - 3e-3, yd + 0.04, zb, shade(body, 0.92));
3619
3624
  c.b("plain", sh.ix0 + 3e-3, yd - 3e-3, sh.iz0 + 3e-3, sh.ix1 - 3e-3, yd, zb, lining);
3620
3625
  c.b("plain", sh.ix0 + 3e-3, yd + 0.04, sh.iz0 + 3e-3, sh.ix1 - 3e-3, yd + 0.043, zb, lining);
3621
3626
  const fy0 = sh.iy0;
@@ -3623,7 +3628,7 @@ function fridge(c) {
3623
3628
  const levels = [fy0, fy0 + 0.28, fy0 + 0.56, fy0 + 0.84];
3624
3629
  for (const y of levels.slice(1)) {
3625
3630
  shelf(c, sh.ix0 + 4e-3, sh.ix1 - 4e-3, y, sh.iz0 + 0.01, sz1, 13625066, 0.016, true);
3626
- for (const s of [-1, 1]) c.b("plain", s < 0 ? sh.ix0 : sh.ix1 - 0.012, y - 0.03, sh.iz0 + 0.01, s < 0 ? sh.ix0 + 0.012 : sh.ix1, y - 6e-3, sz1 - 0.02, 15003376);
3631
+ for (const s of [-1, 1]) c.b("plain", s < 0 ? sh.ix0 + 3e-3 : sh.ix1 - 0.012, y - 0.03, sh.iz0 + 0.01, s < 0 ? sh.ix0 + 0.012 : sh.ix1 - 3e-3, y - 6e-3, sz1 - 0.02, 15003376);
3627
3632
  }
3628
3633
  const slotsF = levels.flatMap((y) => c.row(sh.ix0 + 0.02, sh.ix1 - 0.02, y + (y === fy0 ? 3e-3 : 0), (sh.iz0 + 0.03 + sz1) / 2, 2, [0.3, 0.26, 0.3]));
3629
3634
  const zy = yd + 0.043;
@@ -3692,7 +3697,7 @@ function fridgeCompact(c) {
3692
3697
  c.b("plain", -hw + 0.03, 0, -hd + 0.03, hw - 0.03, 0.04, zb - 0.04, 2895408);
3693
3698
  const fz = 0.2;
3694
3699
  const yd = h - fz - 0.03;
3695
- c.b("plain", sh.ix0, yd, sh.iz0, sh.ix1, yd + 0.03, zb, shade(body, 0.92));
3700
+ c.b("plain", sh.ix0 + 3e-3, yd, sh.iz0, sh.ix1 - 3e-3, yd + 0.03, zb, shade(body, 0.92));
3696
3701
  c.b("plain", sh.ix0 + 3e-3, yd - 3e-3, sh.iz0 + 3e-3, sh.ix1 - 3e-3, yd, zb, lining);
3697
3702
  const fy0 = sh.iy0;
3698
3703
  const sz1 = zdi - 0.1;
@@ -3764,7 +3769,7 @@ function kitchenCabinetBase(c) {
3764
3769
  const info = drawer2(c, { id: "drawer", x0: -hw + 3e-3, x1: hw - 3e-3, y0: yDr, y1: top - 3e-3, zf, zb: sh.iz0, color: front, handle: "bar_h", handleLen: 0.18 });
3765
3770
  const midY = (0.1 + yDr) / 2;
3766
3771
  const shelfY = midY;
3767
- shelf(c, sh.ix0, sh.ix1, shelfY, sh.iz0, sh.iz1 - 0.02, body);
3772
+ shelf(c, sh.ix0 + 3e-3, sh.ix1 - 3e-3, shelfY, sh.iz0, sh.iz1 - 0.02, body);
3768
3773
  const zc = (sh.iz0 + sh.iz1 - 0.02) / 2;
3769
3774
  const n = c.w >= 0.6 ? 2 : 1;
3770
3775
  const ids = doorsAcross(c, { x0: -hw + 3e-3, x1: hw - 3e-3, y0: 0.103, y1: yDr - 3e-3, zf, t, color: front, inner: lining, handle: "bar_v", side: sideOf(c, "left") });
@@ -3793,7 +3798,7 @@ function kitchenCabinetWall(c) {
3793
3798
  const y1 = y0 + h;
3794
3799
  const sh = shell(c, { x0: -hw, x1: hw, y0, y1, z0: -hd, z1: zr, color: body, inner: lining, t: 0.018 });
3795
3800
  const shelfY = y0 + h / 2;
3796
- shelf(c, sh.ix0, sh.ix1, shelfY, sh.iz0, sh.iz1 - 0.02, body);
3801
+ shelf(c, sh.ix0 + 3e-3, sh.ix1 - 3e-3, shelfY, sh.iz0, sh.iz1 - 0.02, body);
3797
3802
  const n = c.w >= 0.6 ? 2 : 1;
3798
3803
  const ids = doorsAcross(c, { x0: -hw + 3e-3, x1: hw - 3e-3, y0: y0 + 3e-3, y1: y1 - 3e-3, zf, t, color: front, inner: lining, handle: "knob", side: sideOf(c, "left") });
3799
3804
  const zc = (sh.iz0 + sh.iz1 - 0.02) / 2;
@@ -3816,7 +3821,7 @@ function pantry(c) {
3816
3821
  const sh = shell(c, { x0: -hw, x1: hw, y0: 0.08, y1: h, z0: -hd, z1: zr, color: body, inner: lining, t: 0.018, material: garage ? "metal" : "wood" });
3817
3822
  c.b("wood", -hw + 0.01, 0, -hd + 0.03, hw - 0.01, 0.08, zr - 0.04, 3815478);
3818
3823
  const ys = [0.45, 0.8, 1.15, 1.5, 1.85].filter((y) => y < h - 0.2);
3819
- for (const y of ys) shelf(c, sh.ix0, sh.ix1, y, sh.iz0, sh.iz1 - (garage ? 0.02 : 0.025), body);
3824
+ for (const y of ys) shelf(c, sh.ix0 + 3e-3, sh.ix1 - 3e-3, y, sh.iz0, sh.iz1 - (garage ? 0.02 : 0.025), body);
3820
3825
  const dmax = sh.iz1 - 0.03 - sh.iz0 - 0.05;
3821
3826
  const zc = (sh.iz0 + sh.iz1 - 0.03) / 2;
3822
3827
  const levels = [sh.iy0, ...ys];
@@ -3840,17 +3845,17 @@ function wardrobe(c) {
3840
3845
  const sh = shell(c, { x0: -hw, x1: hw, y0: 0.1, y1: h, z0: -hd, z1: zr, color: body, inner: lining, t: 0.02, tBack: 0.012 });
3841
3846
  c.b("wood", -hw + 0.01, 0, -hd + 0.03, hw - 0.01, 0.1, zr - 0.04, 3815478);
3842
3847
  const yBoard = 0.372;
3843
- c.b("wood", sh.ix0, yBoard, sh.iz0, sh.ix1, yBoard + 0.018, sh.iz1, shade(body, 0.95));
3844
- c.b("plain", sh.ix0, yBoard + 0.018, sh.iz0, sh.ix1, yBoard + 0.021, sh.iz1, lining);
3848
+ c.b("wood", sh.ix0 + 3e-3, yBoard, sh.iz0, sh.ix1 - 3e-3, yBoard + 0.018, sh.iz1, shade(body, 0.95));
3849
+ c.b("plain", sh.ix0 + 3e-3, yBoard + 0.018, sh.iz0, sh.ix1 - 3e-3, yBoard + 0.021, sh.iz1, lining);
3845
3850
  const gap = 3e-3;
3846
3851
  const dw = (c.w - 6e-3 - gap * (n - 1)) / n;
3847
3852
  const dx = (i) => -hw + 3e-3 + i * (dw + gap);
3848
3853
  const xs = dx(n - 1) - gap / 2;
3849
- c.b("wood", xs - 9e-3, yBoard + 0.018, sh.iz0, xs + 9e-3, sh.iy1, sh.iz1 - 0.02, shade(body, 0.95));
3854
+ c.b("wood", xs - 9e-3, yBoard + 0.021, sh.iz0, xs + 9e-3, sh.iy1, sh.iz1 - 0.02, shade(body, 0.95));
3850
3855
  const rodY = Math.min(1.82, h - 0.28);
3851
3856
  const zc = (sh.iz0 + sh.iz1) / 2 - 0.02;
3852
- c.rod("metal", "x", (sh.ix0 + xs - 9e-3) / 2, rodY, zc, 0.0125, xs - 9e-3 - sh.ix0, 11843772);
3853
- for (const x of [sh.ix0 + 0.01, xs - 0.02]) c.b("metal", x - 0.01, rodY - 0.03, zc - 0.03, x + 0.01, rodY + 0.03, zc + 0.03, 9212054);
3857
+ c.rod("metal", "x", (sh.ix0 + 3e-3 + xs - 9e-3) / 2, rodY, zc, 0.0125, xs - 9e-3 - sh.ix0 - 3e-3, 11843772);
3858
+ for (const x of [sh.ix0 + 0.013, xs - 0.02]) c.b("metal", x - 0.01, rodY - 0.03, zc - 0.03, x + 0.01, rodY + 0.03, zc + 0.03, 9212054);
3854
3859
  const span2 = xs - 9e-3 - sh.ix0 - 0.1;
3855
3860
  const count = Math.max(4, Math.floor(span2 / 0.07));
3856
3861
  const palette = [3824266, 11029050, 4880970, 14209216, 2763312, 9071258, 13148224];
@@ -3866,7 +3871,7 @@ function wardrobe(c) {
3866
3871
  drawPieces(c, g.pieces, { x, y: rodY - 0.09 * scale, z: zc, yaw, scale });
3867
3872
  }
3868
3873
  const sy = [0.7, 1.05, 1.4, 1.75].filter((y) => y < h - 0.2);
3869
- for (const y of sy) shelf(c, xs + 9e-3, sh.ix1, y, sh.iz0, sh.iz1 - 0.02, body);
3874
+ for (const y of sy) shelf(c, xs + 9e-3, sh.ix1 - 3e-3, y, sh.iz0, sh.iz1 - 0.02, body);
3870
3875
  const levels = [yBoard + 0.021, ...sy];
3871
3876
  const cols = sh.ix1 - (xs + 0.02) >= 0.3 ? 2 : 1;
3872
3877
  const shelfSlots = levels.flatMap((y, i) => {
@@ -3996,7 +4001,7 @@ function bathroomCabinet(c) {
3996
4001
  const y1 = y0 + h;
3997
4002
  const sh = shell(c, { x0: -hw, x1: hw, y0, y1, z0: -hd, z1: zf - t - 3e-3, color: body, inner: lining, t: 0.015, tBack: 0.01, material: "plain" });
3998
4003
  const shelfYs = [y0 + h / 3, y0 + 2 * h / 3];
3999
- for (const y of shelfYs) shelf(c, sh.ix0, sh.ix1, y, sh.iz0, sh.iz1 - 0.01, 13625066, 0.016, true);
4004
+ for (const y of shelfYs) shelf(c, sh.ix0 + 3e-3, sh.ix1 - 3e-3, y, sh.iz0, sh.iz1 - 0.01, 13625066, 0.016, true);
4000
4005
  const levels = [sh.iy0, ...shelfYs];
4001
4006
  const zc = (sh.iz0 + sh.iz1) / 2;
4002
4007
  const slots = levels.flatMap((y, i) => c.row(sh.ix0 + 0.01, sh.ix1 - 0.01, y, zc, 4, [0.12, (i < levels.length - 1 ? levels[i + 1] - y : sh.iy1 - y) - 0.025, sh.iz1 - sh.iz0 - 0.03]));
@@ -4711,7 +4716,7 @@ function fireplace(c) {
4711
4716
  c.b("plain", -ow, hearthY, zw + 0.1, -ow + 0.04, openTop, zs, lin);
4712
4717
  c.b("plain", ow - 0.04, hearthY, zw + 0.1, ow, openTop, zs, lin);
4713
4718
  c.b("plain", -ow + 0.04, hearthY, zw + 0.1, ow - 0.04, hearthY + 0.03, zs, shade(lin, 0.75));
4714
- c.b("plain", -ow, openTop - 0.02, zw + 0.1, ow, openTop, zs, shade(lin, 0.8));
4719
+ c.b("plain", -ow + 0.04, openTop - 0.02, zw + 0.1, ow - 0.04, openTop, zs, shade(lin, 0.8));
4715
4720
  c.b("metal", -ow - 0.02, openTop, zs - 0.03, ow + 0.02, openTop + 0.04, zs + 5e-3, 3816512);
4716
4721
  masonry(-ow, openTop, zw, ow, mantelY, zs - 0.03);
4717
4722
  c.b("wood", -hw, mantelY, zw, hw, mantelY + 0.07, zs + 0.07, c.wood(6965808));
@@ -4722,16 +4727,16 @@ function fireplace(c) {
4722
4727
  masonry(-bw, mantelY + 0.07, zw, bw, breastTop, zw + 0.45);
4723
4728
  masonry(-stackHalf, breastTop, zw, stackHalf, chimneyTop - 0.08, zw + 0.4);
4724
4729
  c.b("plain", -stackHalf - 0.04, chimneyTop - 0.08, zw, stackHalf + 0.04, chimneyTop - 0.04, zw + 0.44, 13617596);
4725
- c.b("plain", -0.13, chimneyTop - 0.04, zw + 0.07, 0.13, chimneyTop, zw + 0.33, 10130570);
4726
- c.b("plain", -0.1, chimneyTop - 2e-3, zw + 0.1, 0.1, chimneyTop, zw + 0.3, 4866106);
4730
+ c.b("plain", -0.13, chimneyTop - 0.04, zw + 0.07, 0.13, chimneyTop - 2e-3, zw + 0.33, 10130570);
4731
+ c.b("plain", -0.1, chimneyTop - 4e-3, zw + 0.1, 0.1, chimneyTop, zw + 0.3, 4866106);
4727
4732
  const fz = zw + 0.1 + (sd - 0.1) * 0.5;
4728
4733
  const gy = hearthY + 0.03;
4729
4734
  for (const s of [-1, 1]) {
4730
4735
  c.b("metal", s * 0.27 - 0.02, gy, fz - 0.17, s * 0.27 + 0.02, gy + 0.2, fz - 0.15, IRON);
4731
4736
  c.b("metal", s * 0.27 - 0.02, gy, fz + 0.15, s * 0.27 + 0.02, gy + 0.2, fz + 0.17, IRON);
4732
- c.b("metal", s * 0.27 - 0.02, gy + 0.08, fz - 0.17, s * 0.27 + 0.02, gy + 0.1, fz + 0.17, IRON);
4737
+ c.b("metal", s * 0.27 - 0.015, gy + 0.08, fz - 0.15, s * 0.27 + 0.015, gy + 0.1, fz + 0.15, IRON);
4733
4738
  }
4734
- for (let i = 0; i < 5; i++) c.b("metal", -0.28, gy + 0.08, fz - 0.14 + i * 0.07, 0.28, gy + 0.095, fz - 0.128 + i * 0.07, shade(IRON, 1.3));
4739
+ for (let i = 0; i < 5; i++) c.b("metal", -0.28, gy + 0.083, fz - 0.14 + i * 0.07, 0.28, gy + 0.097, fz - 0.128 + i * 0.07, shade(IRON, 1.3));
4735
4740
  const log = 5914154;
4736
4741
  c.rod("wood", "x", 0, gy + 0.17, fz - 0.09, 0.06, 0.56, log);
4737
4742
  c.rod("wood", "x", 0.02, gy + 0.17, fz + 0.09, 0.055, 0.5, shade(log, 1.1));