@adatechnology/game-interactables-household 0.7.3 → 0.7.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.
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ var cabinet = { body: mdfBody, parts: [[/^drawer/, drawer], [/^door/, door("mdf"
15
15
  var fridgeLike = { body: { material: "steel", joint: "weld" }, parts: [[/^door/, door("steel")]] };
16
16
  var bin = { body: { material: "plastic", joint: "fused" }, parts: [["lid", door("plastic", "hinge", "lid")]] };
17
17
  var upholstery = { material: "fabric", joint: "glue" };
18
+ var POLE_CAGE = { material: "steel", spacing: 0.1, diameter: 0.01 };
18
19
  var DESTRUCTION = {
19
20
  fridge: fridgeLike,
20
21
  fridge_compact: fridgeLike,
@@ -40,7 +41,8 @@ var DESTRUCTION = {
40
41
  },
41
42
  wall_socket: { body: { material: "plastic", joint: "screw" }, parts: [] },
42
43
  wall_switch: { body: { material: "plastic", joint: "screw" }, parts: [["rocker", { material: "plastic", joint: "clip", piece: "rocker" }]] },
43
- service_entrance: { body: { material: "steel", joint: "bolt" }, parts: [["meter_door", door("steel")]] },
44
+ // a cast concrete pole (NBR 8451: CA-50 bars in the concrete), its segments held by the bars; the meter box, the cross arm and the bracket are bolted to it
45
+ service_entrance: { body: { material: "concrete", joint: "rebar", reinforcement: POLE_CAGE }, parts: [["meter_door", door("steel")]] },
44
46
  conduit_run: { body: { material: "plastic", joint: "clip" }, parts: [] },
45
47
  service_mast: { body: { material: "steel", joint: "clip" }, parts: [] },
46
48
  electrical_panel: {
@@ -175,6 +177,10 @@ function cornersOf(p) {
175
177
  }
176
178
  } else if (p.kind === "leaf") {
177
179
  out.push([p.x, p.y, p.z], [p.x, p.y + p.h, p.z]);
180
+ } else if (p.kind === "lathe") {
181
+ const r = Math.max(...p.points.map((q) => q[0]));
182
+ const ys = p.points.map((q) => q[1]);
183
+ for (const sx of [-1, 1]) for (const y of [Math.min(...ys), Math.max(...ys)]) for (const sz of [-1, 1]) out.push([p.x + sx * r, p.y + y, p.z + sz * r]);
178
184
  } else {
179
185
  out.push([p.x, p.y, p.z]);
180
186
  }
@@ -285,6 +291,21 @@ var Ctx = class {
285
291
  this.track({ kind: "cylinder", M: this.M, material: m, x, y, z, r, h, color, rx, rz, shape });
286
292
  this.api.cylinder(this.M, m, x - o[0], y - o[1], z - o[2], r, h, color, rx, rz, shape);
287
293
  }
294
+ /**
295
+ * A solid of revolution round the vertical axis through (x, z): its closed profile `points` (`[r, y]`, y from `y`) goes up outside and down inside for a hollow
296
+ * piece (a toilet bowl, a seat ring), so both faces show and what is inside is open. A host without lathes draws the cylinder round it.
297
+ */
298
+ lathe(m, x, y, z, points, color) {
299
+ const o = this.off;
300
+ this.track({ kind: "lathe", M: this.M, material: m, x, y, z, points, color });
301
+ if (this.api.lathe) {
302
+ this.api.lathe(this.M, m, x - o[0], y - o[1], z - o[2], points, color);
303
+ return;
304
+ }
305
+ const ys = points.map((q) => q[1]);
306
+ const lo = Math.min(...ys);
307
+ this.api.cylinder(this.M, m, x - o[0], y + lo - o[1], z - o[2], Math.max(...points.map((q) => q[0])), Math.max(...ys) - lo, color, 0, 0);
308
+ }
288
309
  /** Cylinder lying along x (`axis` 'x') or z (`axis` 'z'), centered at (x, y, z), length `len`. */
289
310
  rod(m, axis, x, y, z, r, len, color, shape) {
290
311
  if (axis === "x") this.cyl(m, x, y, z, r, len, color, shape, 0, Math.PI / 2);
@@ -414,7 +435,7 @@ var Ctx = class {
414
435
  this.collider("body", -this.hw, this.y0, -this.hd, this.hw, this.y0 + this.h, this.hd);
415
436
  }
416
437
  const body = DESTRUCTION[this.type]?.body;
417
- if (body && !this.spec.destruction) this.spec.destruction = { ...body };
438
+ if (body && !this.spec.destruction) this.spec.destruction = body.reinforcement ? { ...body, reinforcement: { ...body.reinforcement } } : { ...body };
418
439
  for (const k of Object.keys(s)) if (Array.isArray(s[k]) && s[k].length === 0) delete s[k];
419
440
  return this.spec;
420
441
  }
@@ -1831,7 +1852,8 @@ var types_default = [
1831
1852
  h: 0.7,
1832
1853
  y: 1.4,
1833
1854
  solid: true,
1834
- massKg: 15
1855
+ massKg: 15,
1856
+ fixed: true
1835
1857
  },
1836
1858
  {
1837
1859
  id: "pantry",
@@ -1916,7 +1938,8 @@ var types_default = [
1916
1938
  h: 1.2,
1917
1939
  y: 0,
1918
1940
  solid: true,
1919
- massKg: 40
1941
+ massKg: 40,
1942
+ fixed: true
1920
1943
  },
1921
1944
  {
1922
1945
  id: "sink_bathroom",
@@ -1926,7 +1949,8 @@ var types_default = [
1926
1949
  h: 1.05,
1927
1950
  y: 0,
1928
1951
  solid: true,
1929
- massKg: 25
1952
+ massKg: 25,
1953
+ fixed: true
1930
1954
  },
1931
1955
  {
1932
1956
  id: "shower",
@@ -1936,7 +1960,8 @@ var types_default = [
1936
1960
  h: 2.1,
1937
1961
  y: 0,
1938
1962
  solid: true,
1939
- massKg: 90
1963
+ massKg: 90,
1964
+ fixed: true
1940
1965
  },
1941
1966
  {
1942
1967
  id: "toilet",
@@ -1946,7 +1971,8 @@ var types_default = [
1946
1971
  h: 0.8,
1947
1972
  y: 0,
1948
1973
  solid: true,
1949
- massKg: 30
1974
+ massKg: 30,
1975
+ fixed: true
1950
1976
  },
1951
1977
  {
1952
1978
  id: "utility_sink",
@@ -1956,7 +1982,8 @@ var types_default = [
1956
1982
  h: 1.2,
1957
1983
  y: 0,
1958
1984
  solid: true,
1959
- massKg: 25
1985
+ massKg: 25,
1986
+ fixed: true
1960
1987
  },
1961
1988
  {
1962
1989
  id: "wall_socket",
@@ -1986,7 +2013,8 @@ var types_default = [
1986
2013
  h: 6.5,
1987
2014
  y: 0,
1988
2015
  solid: true,
1989
- massKg: 60
2016
+ massKg: 320,
2017
+ fixed: true
1990
2018
  },
1991
2019
  {
1992
2020
  id: "service_mast",
@@ -2607,8 +2635,12 @@ function serviceEntrance(c) {
2607
2635
  const mx = 0.19;
2608
2636
  const my = 1.45;
2609
2637
  const mz = 0.14;
2610
- c.b("metal", -mx, my, mz - 0.06, mx, my + 0.5, mz + 0.06, 9080466);
2611
- c.b("plain", -mx + 0.02, my + 0.02, mz + 0, mx - 0.02, my + 0.48, mz + 0.06, 13948630);
2638
+ c.b("metal", -mx, my, mz - 0.06, mx, my + 0.5, mz, 9080466);
2639
+ c.b("metal", -mx, my, mz, mx, my + 0.02, mz + 0.06, 9080466);
2640
+ c.b("metal", -mx, my + 0.48, mz, mx, my + 0.5, mz + 0.06, 9080466);
2641
+ c.b("metal", -mx, my + 0.02, mz, -mx + 0.02, my + 0.48, mz + 0.06, 9080466);
2642
+ c.b("metal", mx - 0.02, my + 0.02, mz, mx, my + 0.48, mz + 0.06, 9080466);
2643
+ c.b("plain", -mx + 0.02, my + 0.02, mz, mx - 0.02, my + 0.48, mz + 3e-3, 13948630);
2612
2644
  c.cyl("plain", 0, my + 0.28, mz + 0.03, 0.09, 0.02, 15921904, "cyl");
2613
2645
  c.rod("plain", "z", 0, my + 0.28, mz + 0.045, 0.07, 4e-3, 15263968);
2614
2646
  for (let i = 0; i < 4; i++) c.b("plain", -0.06 + i * 0.03, my + 0.34, mz + 0.047, -0.04 + i * 0.03, my + 0.37, mz + 0.05, 2763306);
@@ -2706,11 +2738,11 @@ function microwave(c) {
2706
2738
  const sh = shell(c, { x0: -hw, x1: hw, y0: y0 + 0.012, y1, z0: -hd, z1: zb, color: body, inner: 15264492, t: 0.014, tBack: 0.012, material: "plain" });
2707
2739
  for (const sx of [-1, 1]) c.b("plain", sx * (hw - 0.04) - 0.02, y0, -hd + 0.04, sx * (hw - 0.04) + 0.02, y0 + 0.012, zb - 0.04, 2763308);
2708
2740
  const px = hw * 0.55;
2709
- c.b("plain", px, y0 + 0.012, zb - 2e-3, hw - 0.014, y1 - 0.014, zf, shade(body, 0.7));
2710
- c.cyl("metal", (sh.ix0 + px) / 2, y0 + 0.026, (sh.iz0 + zb) / 2, 0.14, 0.012, 13623526, "cyl");
2711
- c.cyl("plain", (sh.ix0 + px) / 2, y0 + 0.014, (sh.iz0 + zb) / 2, 0.03, 0.012, 8948364, "cyl6");
2741
+ c.b("plain", px, y0 + 0.014, zb, hw - 0.014, y1 - 0.016, zf, shade(body, 0.7));
2742
+ c.cyl("metal", (sh.ix0 + px) / 2, sh.iy0 + 2e-3, (sh.iz0 + zb) / 2, 0.14, 0.012, 13623526, "cyl");
2743
+ c.cyl("plain", (sh.ix0 + px) / 2, sh.iy0 - 6e-3, (sh.iz0 + zb) / 2, 0.03, 8e-3, 8948364, "cyl6");
2712
2744
  for (let i = 0; i < 6; i++) c.b("plain", px + 0.02, y1 - 0.06 - i * 0.034, zf, hw - 0.04, y1 - 0.04 - i * 0.034, zf + 4e-3, i === 5 ? 4885066 : 4869200);
2713
- c.b("plain", px + 0.02, y1 - 0.045, zf, hw - 0.04, y1 - 0.024, zf + 2e-3, 793104);
2745
+ c.b("plain", px + 0.02, y1 - 0.038, zf, hw - 0.04, y1 - 0.024, zf + 2e-3, 793104);
2714
2746
  hingedDoor(c, {
2715
2747
  id: "door",
2716
2748
  x0: sh.ix0 - 0.014 + 3e-3,
@@ -2770,10 +2802,10 @@ function washingMachine(c) {
2770
2802
  [-R - 0.03, cy, dz],
2771
2803
  { kind: "hinge", axis: [0, 1, 0], angle: -1.7 },
2772
2804
  () => {
2773
- c.rod("plain", "z", 0, cy, dz + 0.02, R + 0.03, 0.04, 14869990);
2774
- c.rod("plain", "z", 0, cy, dz + 0.0405, R - 0.02, 1e-3, 9080466);
2805
+ c.rod("plain", "z", 0, cy, dz + 0.018, R + 0.03, 0.036, 14869990);
2806
+ c.rod("plain", "z", 0, cy, dz + 0.0375, R - 0.02, 3e-3, 9080466);
2775
2807
  c.rod("glass", "z", 0, cy, dz + 0.042, R - 0.035, 3e-3, 8296612);
2776
- c.b("plain", R - 0, cy - 0.04, dz + 0.02, R + 0.045, cy + 0.04, dz + 0.04, 13488338);
2808
+ c.b("plain", R - 0, cy - 0.04, dz + 0.02, R + 0.045, cy + 0.04, dz + 0.039, 13488338);
2777
2809
  },
2778
2810
  { label: "prompt.washing_door", at: [0, cy, dz + 0.06], radius: 1.3 }
2779
2811
  );
@@ -2891,7 +2923,7 @@ function powerMeter(c) {
2891
2923
  var STOVE_WALL_GAP = 0.04;
2892
2924
  var STEEL = 11843772;
2893
2925
  var CHROME = 13817562;
2894
- function tap2(c, x, y, z, id, partId) {
2926
+ function tap2(c, x, y, z, id, partId, basin) {
2895
2927
  c.cyl("metal", x, y - 2e-3, z, 0.03, 0.022, STEEL, "cyl");
2896
2928
  c.cyl("metal", x, y + 0.02, z, 0.017, 0.19, CHROME, "cyl");
2897
2929
  c.cyl("metal", x, y + 0.2, z, 0.021, 0.02, STEEL, "cyl");
@@ -2910,7 +2942,7 @@ function tap2(c, x, y, z, id, partId) {
2910
2942
  );
2911
2943
  const outlet = [round3(x), round3(y + 0.185), round3(z + 0.18)];
2912
2944
  c.add("fixtures", { id, kind: "tap", outlet, dir: [0, -1, 0], flow: 7, part: partId, tank: "auto" });
2913
- c.add("emitters", { id: `${id}_water`, kind: "water", pos: outlet, dir: [0, -1, 0], source: id, size: 0.02, reach: 0.3 });
2945
+ c.add("emitters", { id: `${id}_water`, kind: "water", pos: outlet, dir: [0, -1, 0], source: id, size: 0.02, ...streamInto(basin, outlet) });
2914
2946
  c.interact(`use_${id}`, [round3(x + 0.05), round3(y + 0.126), round3(z)], { do: "toggle_fixture", fixture: id }, "prompt.tap", 1.3);
2915
2947
  return outlet;
2916
2948
  }
@@ -2938,7 +2970,7 @@ function stove(c) {
2938
2970
  c.b("plain", ox0 + 0.01, oy0 + 0.01, -hd + 0.03, ox1 - 0.01, oy1 - 0.01, -hd + 0.04, 7237490);
2939
2971
  for (const y of [0.28, 0.46]) c.b("metal", ox0 + 0.01, y, -hd + 0.04, ox1 - 0.01, y + 6e-3, zb - 0.03, 10133154);
2940
2972
  c.b("plain", -hw + 0.02, oy1 + 3e-3, zb, hw - 0.02, top, zf, body);
2941
- c.b("plain", -hw + 0.02, oy1 + 3e-3, zf - 4e-3, hw - 0.02, oy1 + 0.012, zf, shade(body, 0.8));
2973
+ c.b("plain", -hw + 0.02, oy1 + 5e-3, zf - 4e-3, hw - 0.02, oy1 + 0.012, zf + 2e-3, shade(body, 0.8));
2942
2974
  dropDoor(c, {
2943
2975
  id: "oven_door",
2944
2976
  x0: -hw + 0.012,
@@ -2955,7 +2987,7 @@ function stove(c) {
2955
2987
  label: "prompt.oven_door",
2956
2988
  extra: () => {
2957
2989
  c.b("plain", -hw + 0.07, 0.15, zf - 2e-3, hw - 0.07, 0.56, zf + 2e-3, shade(body, 0.8));
2958
- c.plane("glass", 0, 0.355, zf + 25e-4, c.w - 0.2, 0.36, 1842722);
2990
+ c.plane("glass", 0, 0.355, zf + 45e-4, c.w - 0.2, 0.36, 1842722);
2959
2991
  }
2960
2992
  });
2961
2993
  const bx = [-0.14, 0.14];
@@ -2975,7 +3007,7 @@ function stove(c) {
2975
3007
  c.cyl("metal", x, topY + 0.015, z, r * 0.4, 6e-3, 9079952, "cyl");
2976
3008
  for (const s of [-1, 1]) {
2977
3009
  c.b("metal", x - r - 0.03, topY + 0.02, z + s * r - 6e-3, x + r + 0.03, topY + 0.032, z + s * r + 6e-3, 2236964);
2978
- c.b("metal", x + s * r - 6e-3, topY + 0.02, z - r - 0.03, x + s * r + 6e-3, topY + 0.032, z + r + 0.03, 2236964);
3010
+ c.b("metal", x + s * r - 6e-3, topY + 0.018, z - r - 0.03, x + s * r + 6e-3, topY + 0.03, z + r + 0.03, 2236964);
2979
3011
  }
2980
3012
  const knobId = `knob_${n}`;
2981
3013
  const kx = knobXs[n - 1];
@@ -3022,7 +3054,7 @@ function gasBottle(c) {
3022
3054
  c.b("metal", gr - 8e-3, H - 0.034, -gr + 8e-3, gr + 8e-3, H - 0.022, gr - 8e-3, shade(col, 0.7));
3023
3055
  c.cyl("metal", 0, H - 0.17, 0, 0.032, 0.1, 13148746, "cyl");
3024
3056
  c.cyl("metal", 0, H - 0.075, 0, 0.022, 0.03, 10255410, "cyl6");
3025
- c.b("metal", 0.02, H - 0.1, -0.012, 0.075, H - 0.07, 0.012, 11569716);
3057
+ c.b("metal", 0.02, H - 0.1, -0.012, 0.075, H - 0.072, 0.012, 11569716);
3026
3058
  c.part(
3027
3059
  "valve",
3028
3060
  [0, H - 0.045, 0],
@@ -3046,6 +3078,11 @@ function gasBottle(c) {
3046
3078
  c.spec.colliders = [];
3047
3079
  c.collider("body", -R, 0, -R, R, H, R);
3048
3080
  }
3081
+ function streamInto(basin, outlet) {
3082
+ const [x, , z] = outlet;
3083
+ const radius = Math.max(0.01, Math.min(x - basin.from[0], basin.to[0] - x, z - basin.from[2], basin.to[2] - z));
3084
+ return { reach: round3(outlet[1] - basin.from[1]), bowl: { radius: round3(radius), depth: round3(basin.to[1] - basin.from[1]) } };
3085
+ }
3049
3086
  function counterWithBasin(c, o) {
3050
3087
  const { hw, hd } = c;
3051
3088
  const y0 = o.top - 0.04;
@@ -3070,10 +3107,16 @@ function counterWithBasin(c, o) {
3070
3107
  c.b(mat, o.bx0 - 0.02, o.top, o.bz1, o.bx1 + 0.02, o.top + 4e-3, o.bz1 + 0.02, wall);
3071
3108
  c.b(mat, o.bx0 - 0.02, o.top, o.bz0, o.bx0, o.top + 4e-3, o.bz1, wall);
3072
3109
  c.b(mat, o.bx1, o.top, o.bz0, o.bx1 + 0.02, o.top + 4e-3, o.bz1, wall);
3110
+ const basin = { id: "basin", from: [round3(o.bx0), round3(yb + 0.01), round3(o.bz0)], to: [round3(o.bx1), round3(o.top), round3(o.bz1)] };
3111
+ c.add("basins", basin);
3112
+ return basin;
3073
3113
  }
3074
- function pipes(c, x, top, z) {
3114
+ var KITCHEN_BASIN_DEPTH = 0.2;
3115
+ var BATHROOM_BASIN_DEPTH = 0.14;
3116
+ var TAILPIECE_GAP = 2e-3;
3117
+ function pipes(c, x, bottom, z) {
3075
3118
  const wall = -c.hd + 2e-3;
3076
- c.cyl("metal", x, 0.2, z, 0.02, top - 0.2 - 0.12, 13159632, "cyl6");
3119
+ c.cyl("metal", x, 0.2, z, 0.02, bottom - 0.2 - TAILPIECE_GAP, 13159632, "cyl6");
3077
3120
  c.rod("plain", "x", x + 0.06, 0.2, z, 0.02, 0.14, 15263976, "cyl6");
3078
3121
  c.cyl("plain", x + 0.13, 0.07, z, 0.022, 0.15, 15263976, "cyl6");
3079
3122
  c.rod("plain", "z", x + 0.13, 0.09, (z + wall) / 2, 0.02, z - wall, 15263976, "cyl6");
@@ -3093,10 +3136,10 @@ function sinkKitchen(c) {
3093
3136
  const bx1 = -hw * 0.05;
3094
3137
  const bz0 = -hd * 0.65;
3095
3138
  const bz1 = hd * 0.45;
3096
- counterWithBasin(c, { top, bx0, bx1, bz0, bz1, depth: 0.2, counter: 8157816, steel: true });
3139
+ const basin = counterWithBasin(c, { top, bx0, bx1, bz0, bz1, depth: KITCHEN_BASIN_DEPTH, counter: 8157816, steel: true });
3097
3140
  for (let i = 0; i < 7; i++) c.b("metal", bx1 + 0.06, top, bz0 + 0.04 + i * 0.07, hw - 0.06, top + 4e-3, bz0 + 0.052 + i * 0.07, 10133154);
3098
- tap2(c, (bx0 + bx1) / 2, top, -hd + 0.07, "tap", "tap_handle");
3099
- pipes(c, (bx0 + bx1) / 2, top, -hd + 0.17);
3141
+ tap2(c, (bx0 + bx1) / 2, top, -hd + 0.07, "tap", "tap_handle", basin);
3142
+ pipes(c, (bx0 + bx1) / 2, top - KITCHEN_BASIN_DEPTH, (bz0 + bz1) / 2);
3100
3143
  const mid = 15e-4;
3101
3144
  hingedDoor(c, { id: "door_1", x0: -hw + 3e-3, x1: -mid, y0: 0.103, y1: top - 0.043, zf, t, side: "left", color: front, inner: lining, handle: "bar_v", handleLen: 0.22, label: "prompt.door" });
3102
3145
  hingedDoor(c, { id: "door_2", x0: mid, x1: hw - 3e-3, y0: 0.103, y1: top - 0.043, zf, t, side: "right", color: front, inner: lining, handle: "bar_v", handleLen: 0.22, label: "prompt.door" });
@@ -3121,10 +3164,12 @@ function sinkBathroom(c) {
3121
3164
  const zr = zf - t - 3e-3;
3122
3165
  const sh = shell(c, { x0: -hw, x1: hw, y0: 0.08, y1: top - 0.04, z0: -hd, z1: zr, color: body, inner: lining, t: 0.016, noTop: true, material: "plain" });
3123
3166
  c.b("plain", -hw + 0.01, 0, -hd + 0.03, hw - 0.01, 0.08, zr - 0.04, 3815478);
3124
- counterWithBasin(c, { top, bx0: -hw * 0.6, bx1: hw * 0.6, bz0: -hd * 0.5, bz1: hd * 0.55, depth: 0.14, counter: 15328474, steel: false });
3167
+ const bz0 = -hd * 0.5;
3168
+ const bz1 = hd * 0.55;
3169
+ const basin = counterWithBasin(c, { top, bx0: -hw * 0.6, bx1: hw * 0.6, bz0, bz1, depth: BATHROOM_BASIN_DEPTH, counter: 15328474, steel: false });
3125
3170
  c.b("plain", -hw, top, -hd, hw, top + 0.08, -hd + 0.015, 15328474);
3126
- tap2(c, 0, top, -hd + 0.07, "tap", "tap_handle");
3127
- pipes(c, 0, top, -hd + 0.17);
3171
+ tap2(c, 0, top, -hd + 0.07, "tap", "tap_handle", basin);
3172
+ pipes(c, 0, top - BATHROOM_BASIN_DEPTH, (bz0 + bz1) / 2);
3128
3173
  hingedDoor(c, { id: "door", x0: -hw + 3e-3, x1: hw - 3e-3, y0: 0.083, y1: top - 0.043, zf, t, side: c.M.hinge ?? "left", color: body, inner: lining, style: "flat", handle: "knob", label: "prompt.door" });
3129
3174
  c.container({
3130
3175
  id: "under_sink",
@@ -3154,7 +3199,9 @@ function utilitySink(c) {
3154
3199
  c.b("plain", x0 + 0.03, tubTop - 0.278, z0 + 0.03, x1 - 0.03, tubTop - 0.276, z1 - 0.03, 15527662);
3155
3200
  c.cyl("metal", 0, tubTop - 0.276, 0, 0.035, 4e-3, 6975090, "cyl");
3156
3201
  c.b("plain", x0 + 0.04, tubTop - 0.27, z1 - 0.2, x0 + 0.04 + (x1 - x0) * 0.4, tubTop - 0.1, z1 - 0.06, 14343644, 0, 0.5);
3157
- tap2(c, 0, tubTop + 0.08, -hd + 0.08, "tap", "tap_handle");
3202
+ const tub = { id: "basin", from: [round3(x0 + 0.03), round3(tubTop - 0.276), round3(z0 + 0.03)], to: [round3(x1 - 0.03), tubTop, round3(z1 - 0.03)] };
3203
+ c.add("basins", tub);
3204
+ tap2(c, 0, tubTop + 0.08, -hd + 0.08, "tap", "tap_handle", tub);
3158
3205
  c.add("fixtures", { id: "basin", kind: "utility_sink", outlet: [0, round3(tubTop - 0.1), 0], dir: [0, -1, 0], flow: 12, tank: "auto" });
3159
3206
  }
3160
3207
  function shower(c) {
@@ -3166,15 +3213,15 @@ function shower(c) {
3166
3213
  for (let i = 0; i < 4; i++) c.b("plain", -0.04, 0.076, -0.03 + i * 0.02, 0.04, 0.078, -0.022 + i * 0.02, 6975090);
3167
3214
  c.b("plain", -hw, 0.07, -hd, hw, h, -hd + 0.03, tile);
3168
3215
  c.b("plain", -hw, 0.07, -hd + 0.03, -hw + 0.03, h, hd - 0.05, tile);
3216
+ const f = 0.02;
3169
3217
  for (let y = 0.4; y < h - 0.2; y += 0.3) {
3170
- c.b("plain", -hw + 0.03, y, -hd + 0.03, hw, y + 6e-3, -hd + 0.033, 12764872);
3218
+ c.b("plain", -hw + 0.03, y, -hd + 0.03, hw - f, y + 6e-3, -hd + 0.033, 12764872);
3171
3219
  c.b("plain", -hw + 0.03, y, -hd + 0.033, -hw + 0.033, y + 6e-3, hd - 0.05, 12764872);
3172
3220
  }
3173
- c.b("plain", -hw + 0.03, 1, -hd + 0.033, hw, 1.12, -hd + 0.036, 9086644);
3174
- const f = 0.02;
3175
- c.b("metal", -hw + 0.03, h - f, hd - 0.05, hw, h, hd, 12896460);
3221
+ c.b("plain", -hw + 0.03, 1, -hd + 0.033, hw - f, 1.12, -hd + 0.036, 9086644);
3222
+ c.b("metal", -hw + 0.03, h - f, hd - 0.05, hw - f, h, hd, 12896460);
3176
3223
  c.b("metal", hw - f, 0.07, -hd + 0.03, hw, h, hd, 12896460);
3177
- c.b("metal", -hw + 0.03, h - f, -hd + 0.03, hw, h, -hd + 0.03 + 1e-3, 12896460);
3224
+ c.b("metal", -hw + 0.03, h - f, -hd + 0.03, hw - f, h, -hd + 0.04, 12896460);
3178
3225
  const hy = 1.95;
3179
3226
  c.b("metal", -0.015, hy, -hd + 0.03, 0.015, hy + 0.02, -hd + 0.2, CHROME);
3180
3227
  c.cyl("metal", 0, hy - 0.02, -hd + 0.2, 0.075, 0.03, 15264492, "cyl");
@@ -3203,7 +3250,7 @@ function shower(c) {
3203
3250
  [dx1 - dw / 2, gy, zSlide],
3204
3251
  { kind: "slide", axis: [-1, 0, 0], distance: round3(dw - 0.06) },
3205
3252
  () => {
3206
- c.b("glass", dx1 - dw, gy, zSlide - 4e-3, dx1, gy + gh, zSlide + 4e-3, gl);
3253
+ c.b("glass", dx1 - dw + 2e-3, gy + 2e-3, zSlide - 4e-3, dx1 - 2e-3, gy + gh - 2e-3, zSlide + 4e-3, gl);
3207
3254
  c.b("metal", dx1 - dw, gy, zSlide - 8e-3, dx1, gy + 0.015, zSlide + 8e-3, 12896460);
3208
3255
  c.b("metal", dx1 - dw, gy + gh - 0.015, zSlide - 8e-3, dx1, gy + gh, zSlide + 8e-3, 12896460);
3209
3256
  c.b("metal", dx1 - dw, gy + gh * 0.45, zSlide + 4e-3, dx1 - dw + 0.02, gy + gh * 0.45 + 0.3, zSlide + 0.024, 12896460);
@@ -3217,31 +3264,45 @@ function shower(c) {
3217
3264
  c.collider("wall_back", -hw, 0, -hd, hw, h, -hd + 0.03);
3218
3265
  c.collider("wall_left", -hw, 0, -hd + 0.03, -hw + 0.03, h, hd - 0.05);
3219
3266
  }
3267
+ var FLUSH_TRAVEL = 8e-3;
3268
+ var BOWL_Z = 0.12;
3269
+ var BOWL_PROFILE = [
3270
+ [0, 0],
3271
+ [0.12, 0],
3272
+ [0.11, 0.16],
3273
+ [0.15, 0.24],
3274
+ [0.185, 0.31],
3275
+ [0.19, 0.36],
3276
+ [0.19, 0.4],
3277
+ [0.15, 0.4],
3278
+ [0.145, 0.37],
3279
+ [0.12, 0.32],
3280
+ [0.08, 0.28],
3281
+ [0.04, 0.255],
3282
+ [0, 0.25]
3283
+ ];
3284
+ var SEAT_PROFILE = [[0.135, 0.4], [0.2, 0.4], [0.2, 0.425], [0.135, 0.425], [0.135, 0.4]];
3220
3285
  function toilet(c) {
3221
3286
  const { hd } = c;
3222
3287
  const w = c.main(16053748);
3223
3288
  const sh = shade(w, 0.94);
3224
- c.cyl("plain", 0, 0, -0.02, 0.13, 0.28, sh, "cyl");
3225
- c.cyl("plain", 0, 0.2, 0.02, 0.19, 0.2, w, "sphere");
3226
- c.b("plain", -0.17, 0.36, -0.2, 0.17, 0.4, -0.02, w);
3227
- c.cyl("plain", 0, 0.36, 0.12, 0.19, 0.04, w, "cyl");
3228
- c.cyl("plain", 0, 0.395, 0.12, 0.14, 5e-3, 14674156, "cyl");
3289
+ c.lathe("plain", 0, 0, BOWL_Z, BOWL_PROFILE, w);
3290
+ c.b("plain", -0.17, 0.362, -0.2, 0.17, 0.398, -0.04, sh);
3229
3291
  const ty = 0.42;
3230
3292
  const th = 0.8 - ty - 0.025;
3231
3293
  c.b("plain", -0.19, ty, -hd, 0.19, ty + th, -hd + 0.2, w);
3232
3294
  c.b("plain", -0.195, ty + th, -hd - 0, 0.195, ty + th + 0.025, -hd + 0.205, sh);
3233
3295
  c.b("plain", -0.185, ty + 0.01, -hd + 0.2, 0.185, ty + 0.03, -hd + 0.215, sh);
3234
3296
  const seatY = 0.4;
3235
- c.cyl("plain", 0, seatY, 0.12, 0.2, 0.025, 15659248, "cyl");
3236
- c.cyl("plain", 0, seatY + 0.025, 0.12, 0.13, 2e-3, 14674156, "cyl");
3237
- c.b("plain", -0.17, seatY, -0.07, 0.17, seatY + 0.025, 0, 15659248);
3297
+ c.lathe("plain", 0, 0, BOWL_Z, SEAT_PROFILE, 15659248);
3298
+ c.b("plain", -0.17, seatY + 2e-3, -0.07, 0.17, seatY + 0.023, -0.03, 15659248);
3238
3299
  c.part(
3239
3300
  "lid",
3240
3301
  [0, seatY + 0.025, -0.06],
3241
3302
  { kind: "hinge", axis: [1, 0, 0], angle: -1.65 },
3242
3303
  () => {
3243
3304
  c.cyl("plain", 0, seatY + 0.027, 0.12, 0.2, 0.012, w, "cyl");
3244
- c.b("plain", -0.17, seatY + 0.027, -0.07, 0.17, seatY + 0.039, 0, w);
3305
+ c.b("plain", -0.17, seatY + 0.029, -0.07, 0.17, seatY + 0.037, 0, w);
3245
3306
  c.cyl("plain", 0, seatY + 0.039, 0.12, 0.17, 3e-3, shade(w, 1.02), "cyl");
3246
3307
  },
3247
3308
  { label: "prompt.toilet_lid", at: [0, seatY + 0.05, 0.14] }
@@ -3249,15 +3310,18 @@ function toilet(c) {
3249
3310
  c.part(
3250
3311
  "flush_button",
3251
3312
  [0, ty + th + 0.025, -hd + 0.1],
3252
- { kind: "slide", axis: [0, -1, 0], distance: 0.012 },
3313
+ { kind: "slide", axis: [0, -1, 0], distance: FLUSH_TRAVEL },
3253
3314
  () => {
3254
3315
  c.cyl("metal", 0, ty + th + 0.025, -hd + 0.1, 0.04, 0.012, 13817562, "cyl");
3255
3316
  c.cyl("metal", 0, ty + th + 0.037, -hd + 0.1, 0.03, 2e-3, 15133422, "cyl");
3256
3317
  },
3257
3318
  { label: "prompt.flush", at: false, noSweep: true }
3258
3319
  );
3259
- c.add("fixtures", { id: "flush", kind: "flush", outlet: [0, 0.36, 0.12], dir: [0, -1, 0], volume: 6, part: "flush_button", tank: "auto" });
3260
- c.add("emitters", { id: "flush_water", kind: "water", pos: [0, 0.38, 0.12], dir: [0, -1, 0], source: "flush", size: 0.2, reach: 0.12 });
3320
+ c.add("fixtures", { id: "flush", kind: "flush", outlet: [0, 0.36, BOWL_Z], dir: [0, -1, 0], volume: 6, part: "flush_button", tank: "auto" });
3321
+ const bowl = { id: "bowl", from: [-0.12, 0.26, BOWL_Z - 0.12], to: [0.12, 0.36, BOWL_Z + 0.12], shape: "round" };
3322
+ c.add("basins", bowl);
3323
+ const rim = [0, 0.385, BOWL_Z];
3324
+ c.add("emitters", { id: "flush_water", kind: "water", pos: rim, dir: [0, -1, 0], source: "flush", size: 0.08, ...streamInto(bowl, rim) });
3261
3325
  c.interact("use_flush", [0, ty + th + 0.05, -hd + 0.1], { do: "toggle_fixture", fixture: "flush" }, "prompt.flush");
3262
3326
  c.add("damage", { target: "self", kind: "plastic", hp: 60 });
3263
3327
  }
@@ -3446,7 +3510,7 @@ function span(role, u0, v0, u1, v1, color, o = {}) {
3446
3510
  function sleeve(side, u, v, len, width, angle, color) {
3447
3511
  const du = Math.sin(angle) * side;
3448
3512
  const dv = -Math.cos(angle);
3449
- return piece("sleeve", u + du * len / 2, v + dv * len / 2, width, len, color, { t: CLOTH - 1e-3, tilt: side * angle });
3513
+ return piece("sleeve", u + du * len / 2, v + dv * len / 2, width, len, color, { t: CLOTH - 4e-3, tilt: side * angle });
3450
3514
  }
3451
3515
  function tshirt(col) {
3452
3516
  const p = [];
@@ -3455,9 +3519,9 @@ function tshirt(col) {
3455
3519
  p.push(span("body", -bw, TOP - 0.07, bw, -0.6, col));
3456
3520
  for (const s of [-1, 1]) p.push(span("shoulder", s * 0.045, TOP, s * (bw + 0.01), TOP - 0.07, col, { t: 0.014 }));
3457
3521
  p.push(span("inside", -0.045, TOP - 5e-3, 0.045, TOP - 0.05, shade(col, 0.55), { n: -CLOTH }));
3458
- p.push(span("collar", -0.052, TOP - 0.045, 0.052, TOP - 0.06, trim, { t: 0.015 }));
3522
+ p.push(span("collar", -0.052, TOP - 0.045, 0.052, TOP - 0.06, trim, { t: 0.018 }));
3459
3523
  for (const s of [-1, 1]) p.push(sleeve(s, s * (bw + 5e-3), TOP - 0.04, 0.2, 0.115, 0.95, shade(col, 0.96)));
3460
- p.push(span("trim", -bw, -0.585, bw, -0.6, trim, { t: 0.014 }));
3524
+ p.push(span("trim", -bw, -0.585, bw, -0.602, trim, { t: 0.016 }));
3461
3525
  p.push(span("pocket", 0.05, -0.2, 0.13, -0.27, shade(col, 0.9), { t: 0.016 }));
3462
3526
  return { kind: "tshirt", pieces: p, width: 0.62, height: 0.6, pegs: [-0.16, 0.16] };
3463
3527
  }
@@ -3466,7 +3530,7 @@ function shirt(col) {
3466
3530
  g.kind = "shirt";
3467
3531
  g.pieces = g.pieces.filter((q) => q.role !== "sleeve" && q.role !== "pocket");
3468
3532
  for (const s of [-1, 1]) g.pieces.push(sleeve(s, s * 0.205, TOP - 0.04, 0.5, 0.085, 0.16, shade(col, 0.96)));
3469
- g.pieces.push(span("trim", -0.01, -0.07, 0.01, -0.6, shade(col, 0.78), { t: 0.016 }));
3533
+ g.pieces.push(span("trim", -0.01, -0.07, 0.01, -0.604, shade(col, 0.78), { t: 0.024 }));
3470
3534
  g.width = 0.5;
3471
3535
  return g;
3472
3536
  }
@@ -3477,7 +3541,7 @@ function jacket(col) {
3477
3541
  g.pieces = g.pieces.filter((q) => q.role !== "trim");
3478
3542
  g.pieces.push(span("trim", -0.205, -0.7, 0.205, -0.72, dark, { t: 0.017 }));
3479
3543
  g.pieces.push(span("body", -0.2, -0.6, 0.2, -0.7, col));
3480
- g.pieces.push(span("trim", -0.012, -0.07, 0.012, -0.72, dark, { t: 0.018 }));
3544
+ g.pieces.push(span("trim", -0.012, -0.07, 0.012, -0.724, dark, { t: 0.022 }));
3481
3545
  for (const s of [-1, 1]) g.pieces.push(span("trim", s * 0.07, -0.34, s * 0.16, -0.4, dark, { t: 0.018 }));
3482
3546
  g.height = 0.72;
3483
3547
  return g;
@@ -3488,10 +3552,10 @@ function trousers(col) {
3488
3552
  p.push(span("waist", -0.17, TOP, 0.17, TOP - 0.05, dark, { t: 0.015 }));
3489
3553
  p.push(span("crotch", -0.16, TOP - 0.05, 0.16, TOP - 0.2, col));
3490
3554
  for (const s of [-1, 1]) {
3491
- p.push(piece("leg", s * 0.085, TOP - 0.2 - 0.27, 0.155, 0.54, s > 0 ? col : shade(col, 0.94), { tilt: s * 0.02 }));
3555
+ p.push(piece("leg", s * 0.085, TOP - 0.2 - 0.27, 0.155, 0.54, s > 0 ? col : shade(col, 0.94), { tilt: s * 0.02, t: CLOTH - 4e-3 }));
3492
3556
  p.push(span("trim", s * 0.01 + s * 0, -0.74, s * 0.165, -0.76, dark, { t: 0.015 }));
3493
3557
  }
3494
- p.push(span("seam", -4e-3, TOP - 0.05, 4e-3, TOP - 0.2, dark, { t: 0.016 }));
3558
+ p.push(span("seam", -4e-3, TOP - 0.052, 4e-3, TOP - 0.198, dark, { t: 0.016 }));
3495
3559
  for (const s of [-1, 1]) p.push(span("trim", s * 0.09, TOP - 0.08, s * 0.15, TOP - 0.15, shade(col, 0.88), { t: 0.016 }));
3496
3560
  return { kind: "trousers", pieces: p, width: 0.34, height: 0.76, pegs: [-0.14, 0.14] };
3497
3561
  }
@@ -3500,15 +3564,15 @@ function towel(col) {
3500
3564
  const stripe = mix(col, 16777215, 0.55);
3501
3565
  p.push(span("body", -0.25, TOP, 0.25, -0.82, col, { t: 0.014, n: 9e-3 }));
3502
3566
  p.push(span("body", -0.25, TOP, 0.25, -0.74, shade(col, 0.93), { t: 0.014, n: -9e-3 }));
3503
- p.push(span("trim", -0.25, -0.62, 0.25, -0.67, stripe, { t: 0.017, n: 9e-3 }));
3504
- p.push(span("trim", -0.25, -0.7, 0.25, -0.72, stripe, { t: 0.017, n: 9e-3 }));
3567
+ p.push(span("trim", -0.252, -0.62, 0.252, -0.67, stripe, { t: 0.017, n: 9e-3 }));
3568
+ p.push(span("trim", -0.252, -0.7, 0.252, -0.72, stripe, { t: 0.017, n: 9e-3 }));
3505
3569
  for (let i = 0; i < 12; i++) p.push(span("fringe", -0.245 + i * 0.0417, -0.82, -0.215 + i * 0.0417, -0.86, shade(col, 1.04), { t: 0.01, n: 9e-3 }));
3506
3570
  return { kind: "towel", pieces: p, width: 0.5, height: 0.86, pegs: [-0.2, 0.2] };
3507
3571
  }
3508
3572
  function dress(col) {
3509
3573
  const p = [];
3510
3574
  const trim = shade(col, 0.8);
3511
- for (const s of [-1, 1]) p.push(span("strap", s * 0.05, TOP, s * 0.075, TOP - 0.12, trim, { t: 0.01 }));
3575
+ for (const s of [-1, 1]) p.push(span("strap", s * 0.05, TOP, s * 0.075, TOP - 0.12, trim, { t: 8e-3 }));
3512
3576
  p.push(span("body", -0.1, TOP - 0.1, 0.1, -0.34, col));
3513
3577
  p.push(span("trim", -0.105, -0.34, 0.105, -0.37, trim, { t: 0.015 }));
3514
3578
  const steps = 11;
@@ -3529,8 +3593,8 @@ function socks(col) {
3529
3593
  p.push(span("cuff", u - 0.037, TOP, u + 0.037, TOP - 0.035, toe, { t: 0.014 }));
3530
3594
  p.push(span("leg", u - 0.033, TOP - 0.035, u + 0.033, -0.17, c));
3531
3595
  p.push(span("foot", u - 0.033 * s, -0.17, u + 0.105 * s, -0.235, c));
3532
- p.push(span("toe", u + 0.07 * s, -0.17, u + 0.105 * s, -0.235, toe, { t: 0.014 }));
3533
- p.push(span("heel", u - 0.033 * s, -0.17, u - 1e-3 * s, -0.235, shade(c, 0.8), { t: 0.014 }));
3596
+ p.push(span("toe", u + 0.07 * s, -0.168, u + 0.107 * s, -0.237, toe, { t: 0.016 }));
3597
+ p.push(span("heel", u - 0.035 * s, -0.168, u - 1e-3 * s, -0.237, shade(c, 0.8), { t: 0.016 }));
3534
3598
  }
3535
3599
  return { kind: "socks", pieces: p, width: 0.36, height: 0.235, pegs: [-0.075, 0.075] };
3536
3600
  }
@@ -3565,8 +3629,8 @@ function garment(kind, color) {
3565
3629
  function pegs(g, color) {
3566
3630
  const out = [];
3567
3631
  for (const u of g.pegs) {
3568
- out.push({ m: "plain", u, v: TOP / 2 - 0.012, w: 0.018, h: 0.065, t: 0.032, color, role: "peg" });
3569
- out.push({ m: "plain", u, v: TOP / 2 + 0.017, w: 0.022, h: 0.012, t: 0.036, color: shade(color, 0.8), role: "peg" });
3632
+ out.push({ m: "plain", u, v: TOP / 2 - 0.012, w: 0.018, h: 0.065, t: 0.036, color, role: "peg" });
3633
+ out.push({ m: "plain", u, v: TOP / 2 + 0.017, w: 0.022, h: 0.012, t: 0.04, color: shade(color, 0.8), role: "peg" });
3570
3634
  }
3571
3635
  return out;
3572
3636
  }
@@ -3577,13 +3641,14 @@ function hanger(width) {
3577
3641
  const len = Math.hypot(half, rise);
3578
3642
  const ang = Math.atan2(rise, half);
3579
3643
  const out = [
3580
- { m: "metal", u: 0, v: -0.03, w: 5e-3, h: 0.06, t: 5e-3, color: col, role: "hanger" },
3644
+ { m: "metal", u: 0, v: -0.03, w: 5e-3, h: 0.06, t: 8e-3, color: col, role: "hanger" },
3645
+ // thicker than the wires it meets (CLAUDE.md §13)
3581
3646
  { m: "metal", u: 0, v: 0.013, w: 0.026, h: 5e-3, t: 5e-3, color: col, role: "hanger" }
3582
3647
  ];
3583
3648
  for (const s of [-1, 1]) {
3584
3649
  out.push({ m: "metal", u: s * half / 2, v: -0.06 - rise / 2, w: len, h: 4e-3, t: 4e-3, color: col, tilt: s > 0 ? -ang : ang, role: "hanger" });
3585
3650
  }
3586
- out.push({ m: "metal", u: 0, v: -0.06 - rise, w: half * 2, h: 4e-3, t: 4e-3, color: col, role: "hanger" });
3651
+ out.push({ m: "metal", u: 0, v: -0.06 - rise, w: half * 2, h: 4e-3, t: 8e-3, color: col, role: "hanger" });
3587
3652
  return out;
3588
3653
  }
3589
3654
  function drawPieces(c, pieces, f) {
@@ -3726,7 +3791,7 @@ function fridgeCompact(c) {
3726
3791
  label: "prompt.fridge_door",
3727
3792
  extra: () => doorLedge(c, dx0 + 0.04, dx1 - 0.04, trayY, zdi, 0.08, 15003376)
3728
3793
  });
3729
- dropDoor(c, { id: "door_freezer", x0: dx0, x1: dx1, y0: yd + 0.015 + 2e-3, y1: h - 4e-3, zf, t: dt, color: shade(body, 0.97), inner: lining, angle: 1.45, handle: "bar_h", handleLen: 0.16, label: "prompt.freezer_door" });
3794
+ dropDoor(c, { id: "door_freezer", x0: dx0 + 2e-3, x1: dx1 - 2e-3, y0: yd + 0.015 + 2e-3, y1: h - 4e-3, zf, t: dt, color: shade(body, 0.97), inner: lining, angle: 1.45, handle: "bar_h", handleLen: 0.16, label: "prompt.freezer_door" });
3730
3795
  const slots = [
3731
3796
  ...c.row(sh.ix0 + 0.02, sh.ix1 - 0.02, fy0, zc, 1, [0.4, 0.2, 0.3]),
3732
3797
  ...c.row(sh.ix0 + 0.02, sh.ix1 - 0.02, mid, zc, 1, [0.4, yd - mid - 0.02, 0.3]),
@@ -4164,7 +4229,8 @@ function bbq(c) {
4164
4229
  const px = ix0 + 0.05 + c.rnd() * (ix1 - ix0 - 0.14);
4165
4230
  const pz = iz0 + 0.05 + c.rnd() * (iz1 - iz0 - 0.14);
4166
4231
  const s = 0.04 + c.rnd() * 0.04;
4167
- c.b("plain", px, bedY + 0.03, pz, px + s, bedY + 0.03 + s * 0.8, pz + s, c.rnd() < 0.3 ? 5592405 : 1842206, c.rnd() * 3, 0, 0);
4232
+ const sink = 1e-3 + i * 14e-4;
4233
+ c.b("plain", px, bedY + 0.03 - sink, pz, px + s, bedY + 0.03 + 0.032 + i * 17e-4, pz + s, c.rnd() < 0.3 ? 5592405 : 1842206, c.rnd() * 3, 0, 0);
4168
4234
  }
4169
4235
  const gy = 0.88;
4170
4236
  for (const s of [-1, 1]) c.b("metal", s < 0 ? ix0 : ix1 - 0.015, gy - 0.02, iz0, s < 0 ? ix0 + 0.015 : ix1, gy, iz1, 2763824);
@@ -4184,7 +4250,7 @@ function bbq(c) {
4184
4250
  bricks(c, sx0, topChamber + 0.36, -hd, sx1, stackTop, -hd + 0.32, brick);
4185
4251
  c.b("plain", sx0 - 0.02, stackTop, -hd - 0, sx1 + 0.02, stackTop + 0.03, -hd + 0.34, 14209732);
4186
4252
  c.cyl("metal", (sx0 + sx1) / 2, stackTop + 0.03, -hd + 0.16, 0.085, h - stackTop - 0.03, 6975090, "cyl");
4187
- c.cyl("metal", (sx0 + sx1) / 2, stackTop + 0.03, -hd + 0.16, 0.06, h - stackTop - 0.028, 1842206, "cyl");
4253
+ c.cyl("metal", (sx0 + sx1) / 2, stackTop + 0.032, -hd + 0.16, 0.06, h - stackTop - 0.03, 1842206, "cyl");
4188
4254
  const topC = 0.9;
4189
4255
  bricks(c, cx0, 0, -hd, cx1, topC - 0.04, -hd + 0.1, brick);
4190
4256
  bricks(c, cx0, 0, -hd + 0.1, cx0 + 0.08, topC - 0.04, zf, brick);
@@ -4200,7 +4266,7 @@ function bbq(c) {
4200
4266
  c.b("plain", lx0, 0.05, lz0, lx1, topC - 0.12, lz0 + 4e-3, 14210248);
4201
4267
  c.b("plain", lx0, 0.05, lz0 + 4e-3, lx0 + 4e-3, topC - 0.12, lz1, 13157560);
4202
4268
  c.b("plain", lx1 - 4e-3, 0.05, lz0 + 4e-3, lx1, topC - 0.12, lz1, 13157560);
4203
- c.b("plain", lx0, 0.4, lz0, lx1, 0.416, lz1, 13157560);
4269
+ c.b("plain", lx0 + 4e-3, 0.4, lz0 + 4e-3, lx1 - 4e-3, 0.416, lz1 - 4e-3, 13157560);
4204
4270
  hingedDoor(c, {
4205
4271
  id: "counter_door",
4206
4272
  x0: lx0 + 2e-3,
@@ -4331,17 +4397,18 @@ function cooler(c) {
4331
4397
  c.b("plain", -hw + 0.02, 0, hd - 0.07, -hw + 0.07, 0.015, hd - 0.02, DARK);
4332
4398
  c.b("plain", hw - 0.07, 0, hd - 0.07, hw - 0.02, 0.015, hd - 0.02, DARK);
4333
4399
  for (const s of [-1, 1]) c.b("plain", s * hw, top - 0.1, -0.1, s * hw + s * 0.015, top - 0.07, 0.1, DARK);
4334
- c.b("plain", hw - 3e-3, 0.05, hd - 0.14, hw, 0.09, hd - 0.1, DARK);
4400
+ c.b("plain", hw - 2e-3, 0.05, hd - 0.14, hw + 4e-3, 0.09, hd - 0.1, DARK);
4335
4401
  c.part(
4336
4402
  "lid",
4337
4403
  [0, h, -hd],
4338
4404
  { kind: "hinge", axis: [1, 0, 0], angle: -1.5 },
4339
4405
  () => {
4340
4406
  c.b("plain", -hw, top, -hd, hw, h, hd, white);
4341
- c.b("plain", -hw + 0.02, top - 0.012, -hd + 0.02, hw - 0.02, top, hd - 0.02, shade(white, 0.92));
4342
- c.b("plain", -0.09, h - 0.012, hd - 0.05, 0.09, h, hd, shade(body, 0.8));
4343
- c.b("plain", -hw + 0.04, h - 6e-3, -hd + 0.04, -hw + 0.07, h, hd - 0.04, shade(white, 0.9));
4344
- c.b("plain", hw - 0.07, h - 6e-3, -hd + 0.04, hw - 0.04, h, hd - 0.04, shade(white, 0.9));
4407
+ const rim = t + 4e-3 + 2e-3;
4408
+ c.b("plain", -hw + rim, top - 0.012, -hd + rim, hw - rim, top, hd - rim, shade(white, 0.92));
4409
+ c.b("plain", -0.09, h - 0.012, hd - 0.05, 0.09, h + 3e-3, hd + 4e-3, shade(body, 0.8));
4410
+ c.b("plain", -hw + 0.04, h - 2e-3, -hd + 0.04, -hw + 0.07, h + 4e-3, hd - 0.04, shade(white, 0.9));
4411
+ c.b("plain", hw - 0.07, h - 2e-3, -hd + 0.04, hw - 0.04, h + 4e-3, hd - 0.04, shade(white, 0.9));
4345
4412
  },
4346
4413
  { label: "prompt.cooler_lid", at: [0, h, hd - 0.03], radius: 1.6 }
4347
4414
  );
@@ -4364,7 +4431,8 @@ function campfire(c) {
4364
4431
  const px = Math.sin(a) * r;
4365
4432
  const pz = Math.cos(a) * r;
4366
4433
  const s = 0.17 + c.rnd() * 0.06;
4367
- c.box("plain", px, 0, pz, s, 0.13 + c.rnd() * 0.05, s * 0.9, shade(9275778, 0.7 + c.rnd() * 0.5), a + c.rnd() * 0.5);
4434
+ const sink = i % 5 * 2e-3;
4435
+ c.box("plain", px, -sink, pz, s, sink + 0.13 + i % 5 * 0.011 + c.rnd() * 4e-3, s * 0.9, shade(9275778, 0.7 + c.rnd() * 0.5), a + c.rnd() * 0.5);
4368
4436
  if (i % 3 === 0) c.box("plain", px * 0.96, 0.13, pz * 0.96, s * 0.8, 0.08, s * 0.7, shade(9275778, 0.8 + c.rnd() * 0.4), a);
4369
4437
  }
4370
4438
  c.cyl("plain", 0, 1e-3, 0, ringR - 0.1, 0.03, 3815478, "cyl");
@@ -4419,7 +4487,7 @@ function campStove(c) {
4419
4487
  for (const a of [0, 2.094, 4.189]) {
4420
4488
  const px = Math.sin(a) * 0.085;
4421
4489
  const pz = Math.cos(a) * 0.085;
4422
- c.b("metal", px - 8e-3, burnerY + 0.02, pz - 8e-3, px + 8e-3, Y + h - 5e-3, pz + 8e-3, DARK);
4490
+ c.b("metal", px - 8e-3, burnerY + 0.02, pz - 8e-3, px + 8e-3, Y + h - 2e-3, pz + 8e-3, DARK);
4423
4491
  }
4424
4492
  c.cyl("metal", 0, Y + h - 0.012, 0, 0.1, 8e-3, DARK, "cyl6");
4425
4493
  c.b("metal", -hw + 5e-3, burnerY, -hd + 5e-3, -hw + 0.012, Y + h - 0.01, zf - 0.04, shade(steel, 0.9));
@@ -4456,7 +4524,7 @@ function gasCanister(c) {
4456
4524
  const col = Number.parseInt(g.color.replace("#", ""), 16);
4457
4525
  c.cyl("metal", 0, Y + 1e-3, 0, R * 0.96, 0.011, 6975090, "cyl");
4458
4526
  c.cyl("metal", 0, Y + 0.012, 0, R, H - 0.012 - 0.045, col, "cyl");
4459
- c.cyl("metal", 0, Y + 0.012 + (H - 0.057) * 0.35, 0, R + 1e-3, (H - 0.057) * 0.3, 15789280, "cyl");
4527
+ c.cyl("metal", 0, Y + 0.012 + (H - 0.057) * 0.35, 0, R + 2e-3, (H - 0.057) * 0.3, 15789280, "cyl");
4460
4528
  c.cyl("metal", 0, Y + H - 0.075, 0, R * 0.96, 0.04, col, "sphere");
4461
4529
  c.cyl("metal", 0, Y + H - 0.05, 0, R * 0.45, 0.012, 10133154, "cyl");
4462
4530
  c.cyl("metal", 0, Y + H - 0.04, 0, R * 0.3, 0.02, 11569716, "cyl6");
@@ -4640,7 +4708,7 @@ function woodStove(c) {
4640
4708
  c.b("plain", x0 + t, by0 + 0.03, zb + t, x1 - t, top - 5e-3, zb + t + 0.015, brick);
4641
4709
  c.b("plain", x0 + t, by0 + 0.03, zb + t + 0.015, x0 + t + 0.015, top - 5e-3, zf - 0.03, mix(brick, 16777215, 0.08));
4642
4710
  c.b("plain", x1 - t - 0.015, by0 + 0.03, zb + t + 0.015, x1 - t, top - 5e-3, zf - 0.03, mix(brick, 16777215, 0.08));
4643
- c.b("plain", x0 + t, top - 0.02, zb + t + 0.015, x1 - t, top - 5e-3, zf - 0.03, mix(brick, 0, 0.2));
4711
+ c.b("plain", x0 + t + 0.015, top - 0.02, zb + t + 0.015, x1 - t - 0.015, top - 7e-3, zf - 0.032, mix(brick, 0, 0.2));
4644
4712
  c.b("plain", x0 + t + 0.03, by0 + 0.03, zb + t + 0.03, x1 - t - 0.03, by0 + 0.06, zf - 0.08, 5917250);
4645
4713
  for (let i = 0; i < 5; i++) c.b("metal", x0 + t + 0.03, by0 + 0.06, zb + t + 0.04 + i * 0.06, x1 - t - 0.03, by0 + 0.07, zb + t + 0.05 + i * 0.06, shade(iron, 1.4));
4646
4714
  const potX = 0;
@@ -4652,7 +4720,7 @@ function woodStove(c) {
4652
4720
  c.cyl("metal", fx, pipeBase, fz, 0.07, flueTop - pipeBase, shade(iron, 1.1), "cyl");
4653
4721
  for (let y = pipeBase + 0.25; y < flueTop - 0.12; y += 0.45) c.cyl("metal", fx, y, fz, 0.076, 0.03, shade(iron, 1.5), "cyl");
4654
4722
  c.cyl("metal", fx, flueTop - 0.05, fz, 0.1, 0.03, shade(iron, 0.9), "cyl");
4655
- c.cyl("metal", fx, flueTop - 2e-3, fz, 0.052, 2e-3, 4866106, "cyl");
4723
+ c.cyl("metal", fx, flueTop - 1e-3, fz, 0.052, 3e-3, 4866106, "cyl");
4656
4724
  c.b("metal", fx + 0.07, pipeBase + 0.2, fz - 8e-3, fx + 0.17, pipeBase + 0.212, fz + 8e-3, shade(iron, 1.6));
4657
4725
  const side = c.M.hinge ?? "left";
4658
4726
  const dx0 = ox0 + 6e-3;
@@ -4671,7 +4739,7 @@ function woodStove(c) {
4671
4739
  c.b("metal", dx0, dy0, zf, dx1, dy1, zf + dt, iron);
4672
4740
  c.b("metal", dx0 + 0.025, dy0 + 0.025, zf + dt, dx1 - 0.025, dy1 - 0.025, zf + dt + 4e-3, shade(iron, 1.5));
4673
4741
  c.plane("glass", (dx0 + dx1) / 2, (dy0 + dy1) / 2, zf + dt + 65e-4, dx1 - dx0 - 0.07, dy1 - dy0 - 0.07, 5913130);
4674
- c.b("metal", hx - 8e-3, (dy0 + dy1) / 2 - 0.05, zf + dt, hx + 8e-3, (dy0 + dy1) / 2 + 0.05, zf + dt + 0.03, 11843772);
4742
+ c.b("metal", hx - 8e-3, (dy0 + dy1) / 2 - 0.05, zf + dt + 2e-3, hx + 8e-3, (dy0 + dy1) / 2 + 0.05, zf + dt + 0.03, 11843772);
4675
4743
  },
4676
4744
  { label: "prompt.firebox_door", at: [(dx0 + dx1) / 2, (dy0 + dy1) / 2, zf + dt + HANDLE] }
4677
4745
  );
@@ -4784,8 +4852,8 @@ function outhouse(c) {
4784
4852
  c.b("wood", xa, 0.05, bz0 + t + i * bd + 2e-3, xa + t, wallTop, bz0 + t + (i + 1) * bd - 2e-3, col);
4785
4853
  }
4786
4854
  }
4787
- boards(c, -bx, dx0, 0.05, wallTop, bz1 - t, t, wood);
4788
- boards(c, dx1, bx, 0.05, wallTop, bz1 - t, t, wood);
4855
+ boards(c, -bx + t, dx0, 0.05, wallTop, bz1 - t, t, wood);
4856
+ boards(c, dx1, bx - t, 0.05, wallTop, bz1 - t, t, wood);
4789
4857
  boards(c, dx0, dx1, doorTop, wallTop, bz1 - t, t, wood);
4790
4858
  const roofY = wallTop + 0.07;
4791
4859
  c.b("wood", -hw, roofY, -hd, hw, roofY + 0.04, hd, shade(wood, 0.8), 0, -0.08);
@@ -4795,8 +4863,8 @@ function outhouse(c) {
4795
4863
  const sz1 = sz0 + 0.46;
4796
4864
  const sx = bx - t;
4797
4865
  c.b("wood", -sx, 0.05, sz1 - 0.025, sx, seatY - 0.03, sz1, shade(wood, 1.05));
4798
- c.b("wood", -sx, 0.05, sz0, -sx + 0.025, seatY - 0.03, sz1, shade(wood, 0.95));
4799
- c.b("wood", sx - 0.025, 0.05, sz0, sx, seatY - 0.03, sz1, shade(wood, 0.95));
4866
+ c.b("wood", -sx, 0.05, sz0, -sx + 0.025, seatY - 0.03, sz1 - 0.025, shade(wood, 0.95));
4867
+ c.b("wood", sx - 0.025, 0.05, sz0, sx, seatY - 0.03, sz1 - 0.025, shade(wood, 0.95));
4800
4868
  c.b("plain", -sx + 0.025, 0.05, sz0, sx - 0.025, 0.07, sz1 - 0.025, 3878695);
4801
4869
  const hc = (sz0 + sz1) / 2;
4802
4870
  const hr = 0.14;
@@ -4907,22 +4975,25 @@ function well(c) {
4907
4975
  const a = (i + course * 0.5) / n * Math.PI * 2;
4908
4976
  const px = Math.sin(a) * rMid;
4909
4977
  const pz = Math.cos(a) * rMid;
4910
- c.box("plain", px, course * 0.45 + 4e-3, pz, bwid, 0.442, 0.17, shade(stoneCol, 0.85 + c.rnd() * 0.3), Math.atan2(px, pz));
4978
+ const k = i % 2 ? 2e-3 : 0;
4979
+ c.box("plain", px, course * 0.45 + 4e-3 + k, pz, bwid, 0.442 - 2 * k, 0.17, shade(stoneCol, 0.85 + c.rnd() * 0.3), Math.atan2(px, pz));
4911
4980
  }
4912
4981
  }
4913
4982
  for (let i = 0; i < n; i++) {
4914
4983
  const a = (i + 0.25) / n * Math.PI * 2;
4915
4984
  const px = Math.sin(a) * 0.47;
4916
4985
  const pz = Math.cos(a) * 0.47;
4917
- c.box("plain", px, rim, pz, bwid + 0.03, 0.05, 0.25, shade(stoneCol, 1.05 + c.rnd() * 0.12), Math.atan2(px, pz));
4986
+ const k = i % 2 ? 2e-3 : 0;
4987
+ c.box("plain", px, rim + k, pz, bwid + 0.03, 0.05 - 2 * k, 0.25, shade(stoneCol, 1.05 + c.rnd() * 0.12), Math.atan2(px, pz));
4918
4988
  }
4919
4989
  c.cyl("plain", 0, 0, 0, rIn + 0.01, 0.1, 4867906, "cyl");
4920
4990
  c.cyl("water", 0, 0.1, 0, rIn, 0.01, 3828358, "cyl");
4921
- for (const s of [-1, 1]) c.b("wood", s * 0.62 - 0.05, 0, -0.05, s * 0.62 + 0.05, 1.9, 0.05, wood);
4991
+ for (const s of [-1, 1]) c.b("wood", s * 0.62 - 0.05, 0, -0.05, s * 0.62 + 0.05, 1.898, 0.05, wood);
4922
4992
  c.b("wood", -0.68, 1.8, -0.06, 0.68, 1.9, 0.06, shade(wood, 0.9));
4923
4993
  for (const s of [-1, 1]) {
4924
- c.box("wood", 0, 1.99, s * 0.33, 1.46, 0.04, 0.8, shade(wood, 0.85), 0, s * 0.5);
4925
- c.box("plain", 0, 2.02, s * 0.33, 1.44, 0.01, 0.78, 5654074, 0, s * 0.5);
4994
+ const e = s > 0 ? 0 : 4e-3;
4995
+ c.box("wood", 0, 1.99, s * 0.33, 1.46 - e, 0.04, 0.8, shade(wood, 0.85), 0, s * 0.5);
4996
+ c.box("plain", 0, 2.02, s * 0.33, 1.44 - e, 0.01, 0.78, 5654074, 0, s * 0.5);
4926
4997
  }
4927
4998
  c.b("wood", -0.69, 2.05, -0.03, 0.69, 2.12, 0.03, shade(wood, 0.7));
4928
4999
  const tz0 = 0.58;
@@ -4943,7 +5014,7 @@ function well(c) {
4943
5014
  () => {
4944
5015
  c.rod("wood", "x", 0, spindleY, 0, 0.045, 1.24, shade(wood, 1.1));
4945
5016
  c.b("wood", 0.62, spindleY - 0.01, -0.025, 0.69, spindleY + 0.01, 0.025, shade(wood, 0.9));
4946
- c.b("wood", 0.66, spindleY - 0.01, -0.025, 0.69, spindleY + 0.2, 0.025, shade(wood, 0.9));
5017
+ c.b("wood", 0.662, spindleY - 8e-3, -0.023, 0.688, spindleY + 0.2, 0.023, shade(wood, 0.9));
4947
5018
  c.rod("wood", "x", 0.7, spindleY + 0.2, 0, 0.022, 0.08, shade(wood, 0.7));
4948
5019
  },
4949
5020
  { label: "prompt.well_crank", at: false, noSweep: true, group: "draw" }
@@ -5024,8 +5095,8 @@ function trashBin(c) {
5024
5095
  const { hw, hd, h } = c;
5025
5096
  const col = c.main(4157004);
5026
5097
  const rim = h - 0.04;
5027
- const b = binBody(c, { x0: -hw, x1: hw, z0: -hd, z1: hd, y0: 0, y1: rim, t: 0.02, color: col, inner: 11120820 });
5028
- frame(c, -hw - 6e-3, -hd - 6e-3, hw + 6e-3, hd + 6e-3, rim - 0.03, rim, 0.026, shade(col, 1.12));
5098
+ const b = binBody(c, { x0: -hw, x1: hw, z0: -hd, z1: hd, y0: 6e-3, y1: rim - 4e-3, t: 0.02, color: col, inner: 11120820 });
5099
+ frame(c, -hw - 6e-3, -hd - 6e-3, hw + 6e-3, hd + 6e-3, rim - 0.03, rim, 0.022, shade(col, 1.12));
5029
5100
  c.b("plain", -hw + 0.04, 0, -hd + 0.04, hw - 0.04, 0.012, hd - 0.04, 1974306);
5030
5101
  const hy = h - 0.04;
5031
5102
  const top = hy + 0.036;
@@ -5050,17 +5121,23 @@ function wheelieBin(c) {
5050
5121
  const col = c.main(3103370);
5051
5122
  const rim = h - 0.08;
5052
5123
  const t = 0.025;
5053
- const b = binBody(c, { x0: -hw + 0.03, x1: hw - 0.03, z0: -hd + 0.05, z1: hd, y0: 0.08, y1: rim, t, color: col, inner: 8293010 });
5054
- frame(c, -hw, -hd + 0.03, hw, hd, rim - 0.06, rim, 0.05, shade(col, 1.1));
5055
- for (let i = 0; i < 3; i++) c.b("plain", -hw + 0.1 + i * ((c.w - 0.2) / 2) - 0.01, 0.2, hd - 3e-3, -hw + 0.1 + i * ((c.w - 0.2) / 2) + 0.01, rim - 0.1, hd, shade(col, 0.85));
5124
+ const lip = 0.016;
5125
+ const zBody = hd - 0.028;
5126
+ const b = binBody(c, { x0: -hw + 0.03, x1: hw - 0.03, z0: -hd + 0.05, z1: zBody, y0: 0.08, y1: rim - 4e-3, t, color: col, inner: 8293010 });
5127
+ frame(c, -hw + lip, -hd + 0.03, hw - lip, hd - lip, rim - 0.06, rim, 0.05, shade(col, 1.1));
5128
+ for (let i = 0; i < 3; i++) {
5129
+ const rx = -hw + 0.1 + i * ((c.w - 0.2) / 2);
5130
+ c.b("plain", rx - 0.01, 0.2, zBody - 3e-3, rx + 0.01, rim - 0.1, zBody + 6e-3, shade(col, 0.85));
5131
+ }
5056
5132
  c.rod("metal", "x", 0, 0.1, -hd + 0.1, 0.012, c.w - 0.04, 9080466);
5057
5133
  for (const s of [-1, 1]) {
5058
- c.rod("plain", "x", s * (hw - 0.03), 0.1, -hd + 0.1, 0.1, 0.05, 1842206);
5059
- c.rod("plain", "x", s * (hw - 0.03), 0.1, -hd + 0.1, 0.05, 0.056, 9080466);
5134
+ c.rod("plain", "x", s * (hw - 0.026), 0.1, -hd + 0.1, 0.1, 0.05, 1842206);
5135
+ c.rod("plain", "x", s * (hw - 0.026), 0.1, -hd + 0.1, 0.05, 0.056, 9080466);
5060
5136
  }
5061
5137
  c.b("plain", -hw + 0.06, rim - 0.05, -hd + 0, hw - 0.06, rim - 0.01, -hd + 0.05, shade(col, 0.7));
5062
- c.b("plain", -0.1, 0.05, hd - 0.1, 0.1, 0.1, hd, 1842206);
5138
+ c.b("plain", -0.1, 0.05, zBody - 0.07, 0.1, 0.1, zBody + 0.01, 1842206);
5063
5139
  const hy = rim;
5140
+ const sk = lip - 2e-3;
5064
5141
  c.part(
5065
5142
  "lid",
5066
5143
  [0, hy, -hd + 0.06],
@@ -5068,9 +5145,9 @@ function wheelieBin(c) {
5068
5145
  () => {
5069
5146
  c.b("plain", -hw, hy, -hd + 0.05, hw, hy + 0.03, hd, shade(col, 1.04));
5070
5147
  c.b("plain", -hw + 0.04, hy + 0.03, -hd + 0.09, hw - 0.04, hy + 0.045, hd - 0.04, shade(col, 1.2));
5071
- c.b("plain", -hw, hy - 0.04, -hd + 0.05, -hw + 0.02, hy, hd, shade(col, 0.9));
5072
- c.b("plain", hw - 0.02, hy - 0.04, -hd + 0.05, hw, hy, hd, shade(col, 0.9));
5073
- c.b("plain", -hw, hy - 0.04, hd - 0.02, hw, hy, hd, shade(col, 0.9));
5148
+ c.b("plain", -hw, hy - 0.04, -hd + 0.05, -hw + sk, hy, hd, shade(col, 0.9));
5149
+ c.b("plain", hw - sk, hy - 0.04, -hd + 0.05, hw, hy, hd, shade(col, 0.9));
5150
+ c.b("plain", -hw + sk, hy - 0.04, hd - sk, hw - sk, hy, hd, shade(col, 0.9));
5074
5151
  },
5075
5152
  { label: "prompt.bin_lid", at: [0, hy + 0.05, hd - 0.1], radius: 1.8 }
5076
5153
  );
@@ -5087,9 +5164,9 @@ function mailbox(c) {
5087
5164
  const bh = 0.24;
5088
5165
  const bw = Math.min(c.w, 0.3) - (style === "post" ? 0.04 : 0);
5089
5166
  const zf = hd - HANDLE - 0.01;
5090
- c.b(style === "post" ? "wood" : "metal", -0.035, 1e-3, -0.035 - hd + 0.18, 0.035, by, 0.035 - hd + 0.18, postCol);
5167
+ c.b(style === "post" ? "wood" : "metal", -0.035, 1e-3, -0.035 - hd + 0.18, 0.035, by - 4e-3, 0.035 - hd + 0.18, postCol);
5091
5168
  c.b("plain", -0.1, 0, -hd + 0.08, 0.1, 0.06, -hd + 0.28, 9079428);
5092
- c.b(style === "post" ? "wood" : "metal", -0.035, by - 0.06, -hd + 0.18 - 0.035, 0.035, by, hd - 0.1, shade(postCol, 0.9));
5169
+ c.b(style === "post" ? "wood" : "metal", -0.03, by - 0.06, -hd + 0.18 - 0.03, 0.03, by, hd - 0.1, shade(postCol, 0.9));
5093
5170
  const t = 0.012;
5094
5171
  const x0 = -bw / 2;
5095
5172
  const x1 = bw / 2;
@@ -5099,9 +5176,9 @@ function mailbox(c) {
5099
5176
  c.b("metal", x1 - t, by + t, z0, x1, by + bh, zf, col);
5100
5177
  c.b("metal", x0 + t, by + t, z0, x1 - t, by + bh, z0 + t, shade(col, 0.9));
5101
5178
  const lin = 14343388;
5102
- c.b("plain", x0 + t, by + t, z0 + t, x1 - t, by + t + 3e-3, zf, lin);
5103
- c.b("plain", x0 + t, by + t + 3e-3, z0 + t, x0 + t + 3e-3, by + bh - 0.01, zf, lin);
5104
- c.b("plain", x1 - t - 3e-3, by + t + 3e-3, z0 + t, x1 - t, by + bh - 0.01, zf, lin);
5179
+ c.b("plain", x0 + t, by + t, z0 + t, x1 - t, by + t + 3e-3, zf - 4e-3, lin);
5180
+ c.b("plain", x0 + t, by + t + 3e-3, z0 + t, x0 + t + 3e-3, by + bh - 0.01, zf - 4e-3, lin);
5181
+ c.b("plain", x1 - t - 3e-3, by + t + 3e-3, z0 + t, x1 - t, by + bh - 0.01, zf - 4e-3, lin);
5105
5182
  if (style === "post") {
5106
5183
  c.rod("metal", "z", 0, by + bh - bw / 2, (z0 + zf) / 2, bw / 2, zf - z0, col, "cyl");
5107
5184
  c.b("metal", x0, by + t, z0, x1, by + bh - bw / 2, zf, col);
@@ -5157,6 +5234,7 @@ function dogHouse(c) {
5157
5234
  const trim = 15260864;
5158
5235
  const inner = 14204042;
5159
5236
  const floorCol = 13215092;
5237
+ const roofCol = 5917242;
5160
5238
  const bw = c.w - 0.12;
5161
5239
  const x0 = -bw / 2;
5162
5240
  const x1 = bw / 2;
@@ -5164,61 +5242,70 @@ function dogHouse(c) {
5164
5242
  const z1 = hd - 0.22;
5165
5243
  const y0 = 0.06;
5166
5244
  const wallH = 0.58;
5245
+ const wallTop = y0 + wallH;
5167
5246
  const t = 0.03;
5168
- for (const sx of [-1, 1]) for (const sz of [0, 1]) c.b("wood", sx < 0 ? x0 : x1 - 0.06, 0, sz ? z1 - 0.06 : z0, sx < 0 ? x0 + 0.06 : x1, y0, sz ? z1 : z0 + 0.06, 5914664);
5247
+ const l = 4e-3;
5248
+ for (const sx of [-1, 1]) for (const sz of [0, 1]) c.b("wood", sx < 0 ? x0 : x1 - 0.06, 0, sz ? z1 - 0.06 : z0, sx < 0 ? x0 + 0.06 : x1, y0 - 0.02, sz ? z1 : z0 + 0.06, 5914664);
5169
5249
  c.b("wood", x0 - 0.01, y0 - 0.02, z0 - 0.01, x1 + 0.01, y0, z1 + 0.01, 8018490);
5170
5250
  c.b("wood", x0 + t, y0, z0 + t, x1 - t, y0 + 0.012, z1 - t, floorCol);
5171
- for (let i = 1; i < 6; i++) c.b("wood", x0 + t, y0 + 0.012, z0 + t + i * ((z1 - z0 - 2 * t) / 6) - 2e-3, x1 - t, y0 + 0.0125, z0 + t + i * ((z1 - z0 - 2 * t) / 6) + 2e-3, shade(floorCol, 0.85));
5172
- c.b("wood", x0, y0, z0, x1, y0 + wallH, z0 + t, paint);
5173
- c.b("wood", x0, y0, z0 + t, x0 + t, y0 + wallH, z1, shade(paint, 0.96));
5174
- c.b("wood", x1 - t, y0, z0 + t, x1, y0 + wallH, z1, shade(paint, 0.96));
5251
+ const pitch = (z1 - z0 - 2 * t) / 6;
5252
+ for (let i = 1; i < 6; i++) c.b("wood", x0 + t + l, y0 + 0.012, z0 + t + i * pitch - 2e-3, x1 - t - l, y0 + 0.014, z0 + t + i * pitch + 2e-3, shade(floorCol, 0.85));
5253
+ c.b("wood", x0 + t, y0, z0, x1 - t, wallTop, z0 + t, paint);
5254
+ c.b("wood", x0, y0, z0, x0 + t, wallTop + 4e-3, z1, shade(paint, 0.96));
5255
+ c.b("wood", x1 - t, y0, z0, x1, wallTop + 4e-3, z1, shade(paint, 0.96));
5175
5256
  const ow = 0.36;
5176
5257
  const oh = 0.46;
5177
- c.b("wood", x0 + t, y0, z1 - t, -ow / 2, y0 + wallH, z1, paint);
5178
- c.b("wood", ow / 2, y0, z1 - t, x1 - t, y0 + wallH, z1, paint);
5179
- c.b("wood", -ow / 2, y0 + oh, z1 - t, ow / 2, y0 + wallH, z1, paint);
5180
- c.b("wood", x0, y0, z1 - t, x0 + t, y0 + wallH, z1, shade(paint, 0.96));
5181
- c.b("wood", x1 - t, y0, z1 - t, x1, y0 + wallH, z1, shade(paint, 0.96));
5182
- c.b("wood", -ow / 2 - 0.025, y0, z1, -ow / 2, y0 + oh + 0.025, z1 + 0.012, trim);
5183
- c.b("wood", ow / 2, y0, z1, ow / 2 + 0.025, y0 + oh + 0.025, z1 + 0.012, trim);
5258
+ c.b("wood", x0 + t, y0, z1 - t, -ow / 2, wallTop, z1, paint);
5259
+ c.b("wood", ow / 2, y0, z1 - t, x1 - t, wallTop, z1, paint);
5260
+ c.b("wood", -ow / 2, y0 + oh, z1 - t, ow / 2, wallTop, z1, paint);
5261
+ c.b("wood", -ow / 2 - 0.025, y0, z1, -ow / 2, y0 + oh, z1 + 0.012, trim);
5262
+ c.b("wood", ow / 2, y0, z1, ow / 2 + 0.025, y0 + oh, z1 + 0.012, trim);
5184
5263
  c.b("wood", -ow / 2 - 0.025, y0 + oh, z1, ow / 2 + 0.025, y0 + oh + 0.025, z1 + 0.012, trim);
5185
- const l = 4e-3;
5186
- c.b("plain", x0 + t, y0 + 0.012, z0 + t, x1 - t, y0 + wallH, z0 + t + l, inner);
5187
- c.b("plain", x0 + t, y0 + 0.012, z0 + t + l, x0 + t + l, y0 + wallH, z1 - t, mix(inner, paint, 0.1));
5188
- c.b("plain", x1 - t - l, y0 + 0.012, z0 + t + l, x1 - t, y0 + wallH, z1 - t, mix(inner, paint, 0.1));
5189
- c.b("plain", x0 + t + l, y0 + 0.012, z1 - t - l, -ow / 2, y0 + wallH, z1 - t, shade(inner, 0.95));
5190
- c.b("plain", ow / 2, y0 + 0.012, z1 - t - l, x1 - t - l, y0 + wallH, z1 - t, shade(inner, 0.95));
5191
- c.b("plain", -ow / 2, y0 + oh - l, z1 - t - l, ow / 2, y0 + wallH, z1 - t, shade(inner, 0.95));
5192
- const rise = h - 0.02 - (y0 + wallH);
5193
- const steps = 5;
5194
- for (let i = 0; i < steps; i++) {
5195
- const f = 1 - (i + 0.5) / steps;
5196
- const gx = bw / 2 * f;
5197
- const yy = y0 + wallH + i * rise / steps;
5198
- c.b("wood", -gx, yy, z1 - t, gx, yy + rise / steps + 2e-3, z1, shade(paint, 0.98));
5199
- c.b("wood", -gx, yy, z0, gx, yy + rise / steps + 2e-3, z0 + t, shade(paint, 0.98));
5200
- }
5201
- const half = Math.min(hw - 0.015, bw / 2 + 0.05);
5202
- const run = half;
5264
+ c.b("plain", x0 + t, y0 + 0.012, z0 + t, x1 - t, wallTop, z0 + t + l, inner);
5265
+ c.b("plain", x0 + t, y0 + 0.012, z0 + t + l, x0 + t + l, wallTop, z1 - t, mix(inner, paint, 0.1));
5266
+ c.b("plain", x1 - t - l, y0 + 0.012, z0 + t + l, x1 - t, wallTop, z1 - t, mix(inner, paint, 0.1));
5267
+ c.b("plain", x0 + t + l, y0 + 0.012, z1 - t - l, -ow / 2, wallTop, z1 - t, shade(inner, 0.95));
5268
+ c.b("plain", ow / 2, y0 + 0.012, z1 - t - l, x1 - t - l, wallTop, z1 - t, shade(inner, 0.95));
5269
+ c.b("plain", -ow / 2, y0 + oh - l, z1 - t - l, ow / 2, wallTop, z1 - t, shade(inner, 0.95));
5270
+ const top = h - 0.02;
5271
+ const rise = top - wallTop;
5272
+ const run = Math.min(hw - 0.015, bw / 2 + 0.05);
5203
5273
  const L = Math.hypot(run, rise);
5204
5274
  const ang = Math.atan2(rise, run);
5275
+ const sin = Math.sin(ang);
5276
+ const cos = Math.cos(ang);
5205
5277
  const roofT = 0.03;
5206
5278
  const rz0 = z0 - 0.04;
5207
5279
  const rz1 = z1 + 0.06;
5280
+ const onSlope = (m, s, u0, u1, v0, v1, za, zb, color) => {
5281
+ const u = (u0 + u1) / 2;
5282
+ const v = (v0 + v1) / 2;
5283
+ const cx = s * (u * cos + v * sin);
5284
+ const cy = top - u * sin + v * cos;
5285
+ c.box(m, cx, cy - (v1 - v0) / 2, (za + zb) / 2, u1 - u0, v1 - v0, zb - za, color, 0, 0, -s * ang);
5286
+ };
5287
+ const cut = roofT / 2 * Math.tan(ang);
5208
5288
  for (const s of [-1, 1]) {
5209
- const cx = s * run / 2;
5210
- const cy = y0 + wallH + rise / 2 + roofT / 2;
5211
- c.box("wood", cx, cy - roofT / 2, (rz0 + rz1) / 2, L, roofT, rz1 - rz0, 5917242, 0, 0, -s * ang);
5212
- for (let i = 1; i < 5; i++) c.box("wood", cx, cy - roofT / 2 + 0.017, rz0 + i * ((rz1 - rz0) / 5), L - 0.02, 4e-3, 6e-3, shade(5917242, 0.8), 0, 0, -s * ang);
5289
+ onSlope("wood", s, cut, L, -roofT / 2, roofT / 2, rz0, rz1, roofCol);
5290
+ for (let i = 1; i < 5; i++) {
5291
+ const zz = rz0 + i * ((rz1 - rz0) / 5);
5292
+ onSlope("wood", s, cut + 0.03, L - 0.01, roofT / 2, roofT / 2 + 4e-3, zz - 3e-3, zz + 3e-3, shade(roofCol, 0.8));
5293
+ }
5294
+ const g = s < 0 ? 2e-3 : 4e-3;
5295
+ const vTop = -roofT / 2 - 2e-3;
5296
+ const vBottom = -rise * cos - 5e-3;
5297
+ const uEnd = (bw / 2 - vTop * sin) / cos;
5298
+ onSlope("wood", s, 0, uEnd, vBottom, vTop, z1 - t + g, z1 - g, shade(paint, 0.98));
5299
+ onSlope("wood", s, 0, uEnd, vBottom, vTop, z0 + g, z0 + t - g, shade(paint, 0.98));
5213
5300
  }
5214
- c.b("wood", -0.03, y0 + wallH + rise - 5e-3, rz0, 0.03, y0 + wallH + rise + 0.03, rz1, shade(5917242, 0.7));
5215
- c.b("fabric", x0 + t + 0.03, y0 + 0.012, z0 + t + 0.03, x1 - t - 0.03, y0 + 0.07, z1 - t - 0.2, c.accent(4876954));
5301
+ c.b("wood", -0.03, top - 5e-3, rz0 - 0.01, 0.03, top + roofT / 2 / cos + 0.012, rz1 + 0.01, shade(roofCol, 0.7));
5302
+ c.b("fabric", x0 + t + 0.03, y0 + 0.014, z0 + t + 0.03, x1 - t - 0.03, y0 + 0.07, z1 - t - 0.2, c.accent(4876954));
5216
5303
  c.b("fabric", x0 + t + 0.05, y0 + 0.07, z0 + t + 0.05, x1 - t - 0.05, y0 + 0.075, z1 - t - 0.22, mix(c.accent(4876954), 16777215, 0.15));
5217
5304
  if (c.M.variant !== "no_bowl") {
5218
5305
  const bx = x1 - 0.1;
5219
5306
  const bz = z1 + 0.11;
5220
5307
  c.cyl("metal", bx, 0, bz, 0.085, 0.045, 11843772, "cyl");
5221
- c.cyl("plain", bx, 0.04, bz, 0.07, 6e-3, 8018480, "cyl");
5308
+ c.cyl("plain", bx, 0.045, bz, 0.07, 4e-3, 8018480, "cyl");
5222
5309
  }
5223
5310
  }
5224
5311
 
@@ -5325,6 +5412,7 @@ function createRecorder() {
5325
5412
  leaf: (M, x, y, z, w, h, color, ry, rx) => push({ kind: "leaf", M, x, y, z, w, h, color, ry, rx }),
5326
5413
  plane: (M, material, x, y, z, w, h, color, ry, rx, rz, uv) => push({ kind: "plane", M, material, x, y, z, w, h, color, ry, rx, rz, uv }),
5327
5414
  light: (M, x, y, z, color, range, lightKind) => push({ kind: "light", M, x, y, z, color, range, lightKind }),
5415
+ lathe: (M, material, x, y, z, points, color) => push({ kind: "lathe", M, material, x, y, z, points, color }),
5328
5416
  part(id, pivot, ry, draw) {
5329
5417
  const rec = { id, pivot, ry, primitives: [] };
5330
5418
  parts[id] = rec;