Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

feat(society): sculpt agent companions as real 3D solids with shaded profile symbols

rubenluetke10-beepe32ce4ebe46c
diff --git a/art/studies/agent-symbol-companions/brief.md b/art/studies/agent-symbol-companions/brief.md
index 11315a011a..1582c02901 100644
--- a/art/studies/agent-symbol-companions/brief.md
+++ b/art/studies/agent-symbol-companions/brief.md
@@ -5,8 +5,13 @@ follow the independently configurable agent character. Profile and companion
share shape, colour and eyes. Preserve character recipes, imported bodies and
wardrobe choices. Gigi keeps the existing graphite-and-gold first-party identity.
-The bodies retain the SVG silhouettes with a modest rounded extrusion, plain
-PBR materials, two eyes and no human facial features. Blender is the editable
+The bodies are real solids whose front view matches the SVG silhouette
+(2026-10): circle = sphere, squircle = rounded cube, pill = capsule,
+triangle = square pyramid, hexagon = six-sided crystal, cloud = fused puffs,
+drop = teardrop of revolution (`scripts/art/companion_bodies.py`). Plain PBR
+materials, two eyes on the curved surface and no human facial features. The
+flat profile symbol draws the same volume as light: a key light from the upper
+left, a gloss spot, and the lit facets of the pyramid and the crystal. Blender is the editable
mesh source. No image model, external texture, provider request or task/audio
authority is introduced. The runtime target is the current Three.js map.
@@ -18,7 +23,11 @@ motion removes the small walking bob, while deliberate following remains usable.
Rebuild authoring input with `node scripts/art/capture_companion_shapes.mjs`,
then `python scripts/art/sample_companion_outlines.py`. Run
-`scripts/art/build_agent_companions.py` inside background Blender. The manifest
+`scripts/art/build_agent_companions.py` inside background Blender; it also
+writes `source/body_depths.json`, the body surface depth under each accessory
+slot. Then run `python scripts/art/companion_accessories.py` and
+`scripts/art/build_companion_accessories.py` (Blender) so the catalog and the
+clothing follow the bodies. The manifest
exporter can regenerate the GLB from `source/companions.blend`; its named export
collection is `Collection`. The Gigi master uses `GigiExport`.
@@ -38,5 +47,9 @@ Wearables extend the same family without changing a body: one item per slot
authors every item as small primitives around a per-shape slot anchor and
writes the shared catalog; `scripts/art/build_companion_accessories.py` builds
`source/accessories.blend` and `exports/accessories.glb` from it. Clothing is a
-patch of the body outline, clipped per silhouette. The GLB loads only when a
+patch cut from the body surface itself and floated a few millimetres above it;
+a hood is the grown body above the neckline, opened toward the face. Free
+parts worn on the body (outfit, neck, face) ship per shape as
+`acc_<id>__<shape>__fit`, bent onto that surface; head, mouth and back items
+rest at the measured slot depth. The GLB loads only when a
companion wears something.
diff --git a/art/studies/agent-symbol-companions/exports/accessories.glb b/art/studies/agent-symbol-companions/exports/accessories.glb
index effaf96ec3..f3a5882de0 100644
Binary files a/art/studies/agent-symbol-companions/exports/accessories.glb and b/art/studies/agent-symbol-companions/exports/accessories.glb differ
diff --git a/art/studies/agent-symbol-companions/exports/companions.glb b/art/studies/agent-symbol-companions/exports/companions.glb
index 2cbd01136e..abfcd3656a 100644
Binary files a/art/studies/agent-symbol-companions/exports/companions.glb and b/art/studies/agent-symbol-companions/exports/companions.glb differ
diff --git a/art/studies/agent-symbol-companions/source/body_depths.json b/art/studies/agent-symbol-companions/source/body_depths.json
new file mode 100644
index 0000000000..2fd636203a
--- /dev/null
+++ b/art/studies/agent-symbol-companions/source/body_depths.json
@@ -0,0 +1,65 @@
+{
+ "circle": {
+ "back": -0.4986,
+ "face": 0.4914,
+ "head": 0.0,
+ "held": 0.166,
+ "mouth": 0.4837,
+ "neck": 0.4936,
+ "outfit": 0.4936
+ },
+ "cloud": {
+ "back": -0.2984,
+ "face": 0.3595,
+ "head": 0.0,
+ "held": 0.1432,
+ "mouth": 0.3143,
+ "neck": 0.3564,
+ "outfit": 0.3564
+ },
+ "drop": {
+ "back": -0.3654,
+ "face": 0.3654,
+ "head": 0.0,
+ "held": 0.1275,
+ "mouth": 0.3485,
+ "neck": 0.3636,
+ "outfit": 0.3636
+ },
+ "hexagon": {
+ "back": -0.3805,
+ "face": 0.3805,
+ "head": 0.0,
+ "held": 0.1378,
+ "mouth": 0.3805,
+ "neck": 0.3805,
+ "outfit": 0.3805
+ },
+ "pill": {
+ "back": -0.4993,
+ "face": 0.4847,
+ "head": 0.0,
+ "held": 0.1706,
+ "mouth": 0.4689,
+ "neck": 0.4902,
+ "outfit": 0.4902
+ },
+ "squircle": {
+ "back": -0.46,
+ "face": 0.46,
+ "head": 0.0,
+ "held": 0.1819,
+ "mouth": 0.4599,
+ "neck": 0.46,
+ "outfit": 0.46
+ },
+ "triangle": {
+ "back": -0.3367,
+ "face": 0.3571,
+ "head": 0.0,
+ "held": 0.2082,
+ "mouth": 0.482,
+ "neck": 0.4592,
+ "outfit": 0.4592
+ }
+}
diff --git a/jarvis/ui/web/frontend/src/assets/society/companions/accessories.glb b/jarvis/ui/web/frontend/src/assets/society/companions/accessories.glb
index effaf96ec3..f3a5882de0 100644
Binary files a/jarvis/ui/web/frontend/src/assets/society/companions/accessories.glb and b/jarvis/ui/web/frontend/src/assets/society/companions/accessories.glb differ
diff --git a/jarvis/ui/web/frontend/src/assets/society/companions/companions.glb b/jarvis/ui/web/frontend/src/assets/society/companions/companions.glb
index 2cbd01136e..abfcd3656a 100644
Binary files a/jarvis/ui/web/frontend/src/assets/society/companions/companions.glb and b/jarvis/ui/web/frontend/src/assets/society/companions/companions.glb differ
diff --git a/jarvis/ui/web/frontend/src/components/society/AgentSymbol.test.tsx b/jarvis/ui/web/frontend/src/components/society/AgentSymbol.test.tsx
index fdcd6f6288..ae62b4113e 100644
--- a/jarvis/ui/web/frontend/src/components/society/AgentSymbol.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/AgentSymbol.test.tsx
@@ -29,3 +29,18 @@ describe("symbol gaze and thinking", () => {
expect(container.querySelector(".agent-symbol-orbit, .agent-symbol-thoughts")).toBeNull();
});
});
+
+describe("symbol volume shading", () => {
+ it.each(COMPANION_SHAPES)("lights %s inside its own silhouette", shape => {
+ const { container } = render(<AgentSymbol shape={shape} color="#8b5cf6" size={48} />);
+ const shading = container.querySelector("[data-agent-shading]")!;
+ const masked = shading.querySelector("g[mask]")!;
+ const id = masked.getAttribute("mask")!.match(/url\(#(.+)\)/)![1]!;
+ const mask = container.querySelector(`mask[id="${id}"]`)!;
+ // A mask nested inside the element it masks would leave the light unclipped.
+ expect(masked.contains(mask)).toBe(false);
+ expect(mask.querySelector("path, circle")).not.toBeNull();
+ expect(masked.querySelector("ellipse")).not.toBeNull();
+ });
+});
+
diff --git a/jarvis/ui/web/frontend/src/components/society/AgentSymbol.tsx b/jarvis/ui/web/frontend/src/components/society/AgentSymbol.tsx
index 5781b404a9..44bedaab35 100644
--- a/jarvis/ui/web/frontend/src/components/society/AgentSymbol.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/AgentSymbol.tsx
@@ -59,6 +59,73 @@ function SymbolBody({ shape, color, grow = 0 }: { shape: SymbolShape; color: str
}
}
+type Facet = [points: string, tone: "light" | "dark", opacity: number];
+interface ShadingRecipe {
+ /** Key light from the upper left: bright centre, darker toward the far edges. */
+ light: [cx: number, cy: number, r: number, strength: number];
+ /** A soft specular spot: cx, cy, rx, ry, rotation. */
+ gloss: [number, number, number, number, number];
+ /** Flat faces of the solid, brighter toward the light. */
+ facets?: Facet[];
+}
+
+/**
+ * The volume of each 3D companion body, drawn as light on the flat symbol:
+ * the sphere and the puffs read round, the pyramid shows its lit left face,
+ * the crystal its cut facets. Overlays are white or black over the body
+ * colour, so every identity colour and both app themes keep their hue.
+ */
+const SHADING: Record<SymbolShape, ShadingRecipe> = {
+ circle: { light: [14, 12.5, 25, 1], gloss: [13.4, 11.2, 4.4, 2.6, -38] },
+ squircle: { light: [13.5, 12, 27, 0.9], gloss: [12.6, 9.6, 5.2, 2.1, -16] },
+ pill: { light: [15, 12, 25, 0.9], gloss: [15.5, 12.6, 8.2, 1.9, -4] },
+ drop: { light: [14.5, 22, 22, 1], gloss: [12.9, 24.2, 2.1, 4.6, 24] },
+ cloud: { light: [15, 12, 27, 0.9], gloss: [15.6, 9.8, 4.2, 2.1, -18] },
+ triangle: {
+ light: [15, 17, 24, 0.75], gloss: [13.2, 19, 1.4, 4.6, 30],
+ facets: [["20,5.5 8,38 -4,38 -4,0 20,0", "light", 0.2]],
+ },
+ hexagon: {
+ light: [15, 13, 26, 0.65], gloss: [11.6, 9.4, 3.2, 1.1, -30],
+ facets: [
+ ["20,3.5 11.5,11.75 0,11.75 0,0 20,0", "light", 0.3],
+ ["20,3.5 11.5,11.75 28.5,11.75", "light", 0.2],
+ ["20,3.5 28.5,11.75 40,11.75 40,0 20,0", "light", 0.08],
+ ["11.5,11.75 0,11.75 0,28.25 11.5,28.25", "light", 0.1],
+ ["28.5,11.75 40,11.75 40,28.25 28.5,28.25", "dark", 0.14],
+ ["11.5,28.25 0,28.25 0,40 20,40 20,36.5", "dark", 0.06],
+ ["11.5,28.25 28.5,28.25 20,36.5", "dark", 0.13],
+ ["28.5,28.25 40,28.25 40,40 20,40 20,36.5", "dark", 0.24],
+ ],
+ },
+};
+
+/** Light, facets and gloss, masked to the body silhouette. */
+function SymbolShading({ shape, uid }: { shape: SymbolShape; uid: string }) {
+ const { light: [cx, cy, r, strength], gloss: [gx, gy, grx, gry, turn], facets = [] } = SHADING[shape];
+ // The mask lives beside the shaded group: a mask inside the element it masks never applies.
+ return <g data-agent-shading pointerEvents="none">
+ <defs>
+ <mask id={`${uid}-shape`} maskUnits="userSpaceOnUse" x={-20} y={-20} width={80} height={84}><SymbolBody shape={shape} color="#ffffff" /></mask>
+ <radialGradient id={`${uid}-light`} gradientUnits="userSpaceOnUse" cx={cx} cy={cy} r={r}>
+ <stop offset="0" stopColor="#ffffff" stopOpacity={0.3 * strength} />
+ <stop offset="0.4" stopColor="#ffffff" stopOpacity={0} />
+ <stop offset="0.64" stopColor="#000000" stopOpacity={0} />
+ <stop offset="1" stopColor="#000000" stopOpacity={0.3 * strength} />
+ </radialGradient>
+ <radialGradient id={`${uid}-gloss`}>
+ <stop offset="0" stopColor="#ffffff" stopOpacity={0.72} />
+ <stop offset="1" stopColor="#ffffff" stopOpacity={0} />
+ </radialGradient>
+ </defs>
+ <g mask={`url(#${uid}-shape)`}>
+ {facets.map(([points, tone, opacity]) => <polygon key={points} points={points} fill={tone === "light" ? "#ffffff" : "#000000"} opacity={opacity} />)}
+ <rect x={-4} y={-4} width={48} height={52} fill={`url(#${uid}-light)`} />
+ <ellipse cx={gx} cy={gy} rx={grx} ry={gry} transform={`rotate(${turn} ${gx} ${gy})`} fill={`url(#${uid}-gloss)`} />
+ </g>
+ </g>;
+}
+
/** A monochrome thinking interlude, using the agent's own identity colour. */
export function SymbolThinkingDots({ color }: { color: string }) {
return <g className="agent-symbol-thoughts" fill={color}>
@@ -171,6 +238,7 @@ export function AgentSymbol({ shape, color, size, eyes = "lines", thinking = fal
<mask id={maskId} maskUnits="userSpaceOnUse" x={-20} y={-20} width={80} height={84}><SymbolBody shape={shape} color="#ffffff" /></mask>
<g mask={`url(#${maskId})`}>{draw(worn, true)}</g>
</>}
+ <SymbolShading shape={shape} uid={`${maskId}-light`} />
{draw(worn.filter(item => item.slot === "outfit" || item.slot === "neck"))}
<g className="agent-symbol-gaze">
<g data-agent-eyes fill={ink.eye} transform={faceTransform}>
diff --git a/jarvis/ui/web/frontend/src/components/society/companion/AgentFollower.tsx b/jarvis/ui/web/frontend/src/components/society/companion/AgentFollower.tsx
index a53759a11c..dfdbc53217 100644
--- a/jarvis/ui/web/frontend/src/components/society/companion/AgentFollower.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/companion/AgentFollower.tsx
@@ -6,7 +6,7 @@ import { useReducedMotion } from "framer-motion";
import companionModels from "@/assets/society/companions/companions.glb";
import gigiModel from "@/assets/society/companions/gigi.glb";
import accessoryModels from "@/assets/society/companions/accessories.glb";
-import { ACCESSORY_CATALOG, resolveFill, wornAccessories } from "./accessories";
+import { ACCESSORY_CATALOG, resolveFill, slotDepthM, wornAccessories } from "./accessories";
import { companionEyeColors, type CompanionAppearance } from "./appearance";
import { advancePetTrail, createPetTrail, petDisplayPosition, recordOwner, type PetTrail, type TrailPoint } from "./trail";
@@ -27,7 +27,8 @@ export function CompanionModel({ appearance, lead = false }: { appearance: Compa
const materials: MeshStandardMaterial[] = [];
if (!lead) {
const ink = companionEyeColors(appearance.color);
- const body = new MeshStandardMaterial({ color: appearance.color, roughness: 0.82 });
+ // A soft vinyl sheen lets the light show the volume of each body.
+ const body = new MeshStandardMaterial({ color: appearance.color, roughness: 0.62 });
const eyes = new MeshStandardMaterial({ color: ink.eye, roughness: 1 });
const shine = new MeshStandardMaterial({ color: ink.highlight, roughness: 1 });
materials.push(body, eyes, shine);
@@ -95,11 +96,14 @@ function CompanionAccessories({ appearance }: { appearance: CompanionAppearance
const meta = ACCESSORY_CATALOG.shapes[appearance.shape];
const unit = 1 / (meta.bottom - meta.top);
for (const item of wornAccessories(appearance.accessories)) {
- const free = scene.getObjectByName(`acc_${item.id}`);
+ // Items worn on the body come pre-fitted to each silhouette's curved surface.
+ const fitted = scene.getObjectByName(`acc_${item.id}__${appearance.shape}__fit`);
+ const free = fitted ? undefined : scene.getObjectByName(`acc_${item.id}`);
+ if (fitted) group.add(fitted.clone(true));
if (free) {
const [x, y, k] = meta.anchors[item.slot];
const node = free.clone(true);
- node.position.set((x - 20) * unit, (meta.bottom - y) * unit, ACCESSORY_CATALOG.slotDepth[item.slot] * ACCESSORY_CATALOG.frontDepthM);
+ node.position.set((x - 20) * unit, (meta.bottom - y) * unit, slotDepthM(appearance.shape, item.slot));
node.rotation.set(0, 0, 0);
node.scale.setScalar(k * (item.scale ?? 1) * unit);
group.add(node);
@@ -125,7 +129,7 @@ function CompanionAccessories({ appearance }: { appearance: CompanionAppearance
for (const item of wornAccessories(appearance.accessories)) {
const [x, y, k] = meta.anchors[item.slot];
const size = k * (item.scale ?? 1) * unit;
- const depth = ACCESSORY_CATALOG.slotDepth[item.slot] * ACCESSORY_CATALOG.frontDepthM;
+ const depth = slotDepthM(appearance.shape, item.slot);
item.parts.forEach((part, index) => {
if (part.t !== "smoke") return;
plumes.push({
diff --git a/jarvis/ui/web/frontend/src/components/society/companion/accessories.json b/jarvis/ui/web/frontend/src/components/society/companion/accessories.json
index 323844fa16..2b44b6c3b7 100644
--- a/jarvis/ui/web/frontend/src/components/society/companion/accessories.json
+++ b/jarvis/ui/web/frontend/src/components/society/companion/accessories.json
@@ -1 +1 @@
-{"schema":2,"slots":["back","outfit","neck","mouth","face","head","held"],"slotDepth":{"back":-1,"outfit":1,"neck":1,"mouth":1,"face":1,"head":0,"held":0.4},"slotFlatShift":{"outfit":1.0,"neck":1.0},"frontDepthM":0.25,"shapes":{"circle":{"top":3.8,"bottom":36.2,"eyeY":17.2,"anchors":{"head":[20,5.2,1],"neck":[20,22.4,1.0],"held":[33.5,29,1.35],"back":[20,20,1],"outfit":[20,22.4,1.0],"face":[20,17.2,1],"mouth":[20,24.0,1.15]}},"squircle":{"top":3.8,"bottom":36.2,"eyeY":17.2,"anchors":{"head":[20,4.4,1],"neck":[20,22.4,1.0],"held":[34,29,1.35],"back":[20,20,1],"outfit":[20,22.4,1.0],"face":[20,17.2,1],"mouth":[20,24.0,1.15]}},"pill":{"top":8.48,"bottom":31.52,"eyeY":17.2,"anchors":{"head":[20,9.6,0.95],"neck":[20,22.2,0.85],"held":[35.5,26,1.282],"back":[20,20,0.95],"outfit":[20,22.2,0.85],"face":[20,17.2,1],"mouth":[20,24.0,1.15]}},"triangle":{"top":5.5,"bottom":33.5,"eyeY":23,"anchors":{"head":[20,8.6,0.72],"neck":[20,28.0,0.8],"held":[32.5,31,1.215],"back":[20,22,0.9],"outfit":[20,28.0,0.8],"face":[20,23,0.9],"mouth":[20,29.12,1.035]}},"hexagon":{"top":3.5,"bottom":36.5,"eyeY":17.2,"anchors":{"head":[20,5.8,0.9],"neck":[20,22.4,0.95],"held":[33,29,1.282],"back":[20,20,0.95],"outfit":[20,22.4,0.95],"face":[20,17.2,1],"mouth":[20,24.0,1.15]}},"cloud":{"top":5.028,"bottom":32,"eyeY":23,"anchors":{"head":[19.2,6.6,0.95],"neck":[20,27.6,0.7],"held":[37,27.5,1.215],"back":[21,20,1],"outfit":[20,27.6,0.7],"face":[20,23,0.9],"mouth":[20,29.12,1.035]}},"drop":{"top":3,"bottom":40.5,"eyeY":25,"anchors":{"head":[20,9.6,0.72],"neck":[20,30.0,0.95],"held":[32.5,34,1.282],"back":[20,25,0.95],"outfit":[20,30.0,0.95],"face":[20,25,1],"mouth":[20,31.8,1.15]}}},"items":[{"id":"suit","slot":"outfit","scale":1,"bounds":[-8.42,-0.4,8.42,10.62],"regions":true,"parts":[{"t":"region","pts":[[-20,7.0],[-15,3.2],[-10,1.0],[-5,-0.2],[5,-0.2],[10,1.0],[15,3.2],[20,7.0],[60,60.0],[-60,60.0]],"mode":"wrap","fill":"#2c3a55"},{"t":"region","pts":[[8.0,1.2],[60,1.2],[60,60],[11.5,60]],"mode":"front","fill":"#05070d","opacity":0.16,"only":"2d"},{"t":"region","pts":[[-60,0.0],[-9.5,0.8],[-12.5,60],[-60,60]],"mode":"front","fill":"#ffffff","opacity":0.05,"only":"2d"},{"t":"region","pts":[[-4.6,-0.4],[4.6,-0.4],[0,8.8]],"mode":"front","fill":"#f4f6f8"},{"t":"region","pts":[[-4.4,-0.4],[-0.9,0.2],[-2.6,2.8]],"mode":"front","fill":"#dfe4ea"},{"t":"region","pts":[[4.4,-0.4],[2.6,2.8],[0.9,0.2]],"mode":"front","fill":"#dfe4ea"},{"t":"region","pts":[[-4.6,-0.4],[4.6,-0.4],[3.6,1.3],[-3.6,1.3]],"mode":"front","fill":"#05070d","opacity":0.2,"only":"2d"},{"t":"region","pts":[[-1.0,2.0],[1.0,2.0],[2.1,8.2],[0,10.4],[-2.1,8.2]],"mode":"front","fill":"#b3243b"},{"t":"region","pts":[[-1.1,3.9],[1.2,3.1],[1.32,3.75],[-1.2,4.55]],"mode":"front","fill":"#86182b"},{"t":"region","pts":[[-1.6,6.7],[1.75,5.6],[1.85,6.3],[-1.65,7.4]],"mode":"front","fill":"#86182b"},{"t":"poly","pts":[[-1.55,-0.4],[1.55,-0.4],[1.0,2.1],[-1.0,2.1]],"z":0.9,"d":0.9,"smooth":false,"fill":"#b3243b"},{"t":"region","pts":[[-4.6,-0.4],[0,8.8],[-1.3,10.4],[-6.9,3.4],[-8.2,0.2]],"mode":"front","fill":"#212b42"},{"t":"region","pts":[[8.2,0.2],[6.9,3.4],[1.3,10.4],[0,8.8],[4.6,-0.4]],"mode":"front","fill":"#212b42"},{"t":"tube","pts":[[-8.2,0.2,0.3],[-6.9,3.4,0.3],[-1.3,10.4,0.3]],"w":0.45,"smooth":false,"fill":"#ffffff","opacity":0.16,"only":"2d"},{"t":"tube","pts":[[8.2,0.2,0.3],[6.9,3.4,0.3],[1.3,10.4,0.3]],"w":0.45,"smooth":false,"fill":"#ffffff","opacity":0.1,"only":"2d"},{"t":"region","pts":[[0.739,12.006],[0.306,12.439],[-0.306,12.439],[-0.739,12.006],[-0.739,11.394],[-0.306,10.961],[0.306,10.961],[0.739,11.394]],"mode":"front","fill":"#18202f"},{"t":"region","pts":[[0.739,14.706],[0.306,15.139],[-0.306,15.139],[-0.739,14.706],[-0.739,14.094],[-0.306,13.661],[0.306,13.661],[0.739,14.094]],"mode":"front","fill":"#18202f"},{"t":"region","pts":[[5.0,4.0],[8.8,4.0],[8.8,4.5],[5.0,4.5]],"mode":"front","fill":"#18202f"},{"t":"region","pts":[[5.4,4.0],[6.9,4.0],[6.0,2.3]],"mode":"front","fill":"#f4f6f8"},{"t":"region","pts":[[6.4,4.0],[8.2,4.0],[7.6,2.5]],"mode":"front","fill":"#f4f6f8"}]},{"id":"tuxedo","slot":"outfit","scale":1,"bounds":[-8.42,-1.5,8.42,11.62],"regions":true,"parts":[{"t":"region","pts":[[-20,7.0],[-15,3.2],[-10,1.0],[-5,-0.2],[5,-0.2],[10,1.0],[15,3.2],[20,7.0],[60,60.0],[-60,60.0]],"mode":"wrap","fill":"#22232b"},{"t":"region","pts":[[8.0,1.2],[60,1.2],[60,60],[11.5,60]],"mode":"front","fill":"#05070d","opacity":0.22,"only":"2d"},{"t":"region","pts":[[-60,0.0],[-9.5,0.8],[-12.5,60],[-60,60]],"mode":"front","fill":"#ffffff","opacity":0.06,"only":"2d"},{"t":"region","pts":[[-4.4,-0.4],[4.4,-0.4],[0,9.8]],"mode":"front","fill":"#f4f6f8"},{"t":"region","pts":[[-4.4,-0.4],[4.4,-0.4],[3.4,1.3],[-3.4,1.3]],"mode":"front","fill":"#05070d","opacity":0.2,"only":"2d"},{"t":"region","pts":[[-1.85,3.0],[-1.5,3.0],[-1.5,7.6],[-1.85,7.6]],"mode":"front","fill":"#dfe4ea"},{"t":"region","pts":[[1.5,3.0],[1.85,3.0],[1.85,7.6],[1.5,7.6]],"mode":"front","fill":"#dfe4ea"},{"t":"region","pts":[[0.462,3.791],[0.191,4.062],[-0.191,4.062],[-0.462,3.791],[-0.462,3.409],[-0.191,3.138],[0.191,3.138],[0.462,3.409]],"mode":"front","fill":"#101014"},{"t":"region","pts":[[0.462,5.991],[0.191,6.262],[-0.191,6.262],[-0.462,5.991],[-0.462,5.609],[-0.191,5.338],[0.191,5.338],[0.462,5.609]],"mode":"front","fill":"#101014"},{"t":"region","pts":[[0.416,8.172],[0.172,8.416],[-0.172,8.416],[-0.416,8.172],[-0.416,7.828],[-0.172,7.584],[0.172,7.584],[0.416,7.828]],"mode":"front","fill":"#101014"},{"t":"region","pts":[[-4.6,-0.4],[0,9.8],[-1.3,11.4],[-6.9,3.4],[-8.2,0.2]],"mode":"front","fill":"#3a3c48","gloss":true},{"t":"region","pts":[[8.2,0.2],[6.9,3.4],[1.3,11.4],[0,9.8],[4.6,-0.4]],"mode":"front","fill":"#3a3c48","gloss":true},{"t":"tube","pts":[[-8.2,0.2,0.3],[-6.9,3.4,0.3],[-1.3,11.4,0.3]],"w":0.45,"smooth":false,"fill":"#ffffff","opacity":0.16,"only":"2d"},{"t":"tube","pts":[[8.2,0.2,0.3],[6.9,3.4,0.3],[1.3,11.4,0.3]],"w":0.45,"smooth":false,"fill":"#ffffff","opacity":0.1,"only":"2d"},{"t":"poly","pts":[[0,-0.1],[3.6,-1.5],[4.1,0.9],[3.6,2.7],[0,1.3],[-3.6,2.7],[-4.1,0.9],[-3.6,-1.5]],"z":0.9,"d":1.0,"smooth":false,"fill":"#22232b"},{"t":"sphere","c":[0,0.6,1.4],"r":[1.1,1.3,0.7],"fill":"#26272f"},{"t":"region","pts":[[5.0,4.0],[8.8,4.0],[8.8,4.5],[5.0,4.5]],"mode":"front","fill":"#0d0d10"},{"t":"region","pts":[[5.4,4.0],[6.9,4.0],[6.0,2.3]],"mode":"front","fill":"#f4f6f8"},{"t":"region","pts":[[6.4,4.0],[8.2,4.0],[7.6,2.5]],"mode":"front","fill":"#f4f6f8"}]},{"id":"lab_coat","slot":"outfit","scale":1,"bounds":[-9.03,-0.4,9.03,9.42],"regions":true,"parts":[{"t":"region","pts":[[-20,7.0],[-15,3.2],[-10,1.0],[-5,-0.2],[5,-0.2],[10,1.0],[15,3.2],[20,7.0],[60,60.0],[-60,60.0]],"mode":"wrap","fill":"#f2f4f7"},{"t":"region","pts":[[8.0,1.2],[60,1.2],[60,60],[11.5,60]],"mode":"front","fill":"#05070d","opacity":0.08,"only":"2d"},{"t":"region","pts":[[-4.0,-0.4],[4.0,-0.4],[0,7.6]],"mode":"front","fill":"#a9c8ef"},{"t":"region","pts":[[-4.0,-0.4],[4.0,-0.4],[3.0,1.3],[-3.0,1.3]],"mode":"front","fill":"#05070d","opacity":0.2,"only":"2d"},{"t":"region","pts":[[-0.9,1.8],[0.9,1.8],[1.8,6.6],[0,8.4],[-1.8,6.6]],"mode":"front","fill":"#0f766e"},{"t":"poly","pts":[[-1.4,-0.4],[1.4,-0.4],[0.9,1.9],[-0.9,1.9]],"z":0.9,"d":0.8,"smooth":false,"fill":"#0f766e"},{"t":"region","pts":[[-4.6,-0.4],[0,7.6],[-1.3,9.2],[-7.5,3.4],[-8.8,0.2]],"mode":"front","fill":"#dde2e9"},{"t":"region","pts":[[8.8,0.2],[7.5,3.4],[1.3,9.2],[0,7.6],[4.6,-0.4]],"mode":"front","fill":"#dde2e9"},{"t":"tube","pts":[[-8.8,0.2,0.3],[-7.5,3.4,0.3],[-1.3,9.2,0.3]],"w":0.45,"smooth":false,"fill":"#ffffff","opacity":0.16,"only":"2d"},{"t":"tube","pts":[[8.8,0.2,0.3],[7.5,3.4,0.3],[1.3,9.2,0.3]],"w":0.45,"smooth":false,"fill":"#ffffff","opacity":0.1,"only":"2d"},{"t":"region","pts":[[-0.2,9.2],[0.25,9.2],[0.25,40],[-0.2,40]],"mode":"front","fill":"#dde2e9"},{"t":"region","pts":[[5.6,1.8],[6.3,1.8],[6.3,4.6],[5.6,4.6]],"mode":"front","fill":"#2f6fe0"},{"t":"region","pts":[[6.9,2.3],[7.6,2.3],[7.6,4.6],[6.9,4.6]],"mode":"front","fill":"#e0483e"},{"t":"region","pts":[[4.6,3.8],[8.8,3.8],[8.8,7.6],[4.6,7.6]],"mode":"front","fill":"#dde2e9"},{"t":"region","pts":[[-8.8,4.4],[-5.0,4.4],[-5.0,8.8],[-8.8,8.8]],"mode":"front","fill":"#ffffff"},{"t":"region","pts":[[-8.8,4.4],[-5.0,4.4],[-5.0,5.5],[-8.8,5.5]],"mode":"front","fill":"#0f766e"},{"t":"region","pts":[[-8.2,6.4],[-5.6,6.4],[-5.6,6.8],[-8.2,6.8]],"mode":"front","fill":"#c5ccd6"},{"t":"region","pts":[[-8.2,7.4],[-6.4,7.4],[-6.4,7.8],[-8.2,7.8]],"mode":"front","fill":"#c5ccd6"}]},{"id":"hoodie","slot":"outfit","scale":1,"bounds":[-2.55,1.85,8.47,7.7],"regions":true,"parts":[{"t":"rim","w":1.9,"fill":"#4a5160","maxY":4.0},{"t":"rim","w":0.75,"fill":"#3a404c","maxY":4.0,"only":"2d"},{"t":"region","pts":[[-20,7.8],[-15,4.0],[-10,1.8],[-5,0.6],[5,0.6],[10,1.8],[15,4.0],[20,7.8],[60,60.8],[-60,60.8]],"mode":"wrap","fill":"#4a5160"},{"t":"region","pts":[[8.0,2.0],[60,2.0],[60,60.8],[11.5,60.8]],"mode":"front","fill":"#05070d","opacity":0.18,"only":"2d"},{"t":"region","pts":[[-5.2,0.8],[5.2,0.8],[4.0,2.7],[0,3.3],[-4.0,2.7]],"mode":"front","fill":"#3a404c"},{"t":"region","pts":[[-6.4,7.6],[6.4,7.6],[7.8,13.0],[-7.8,13.0]],"mode":"front","fill":"#3a404c"},{"t":"tube","pts":[[2.2,2.2,0.7],[1.9,6.6,0.7]],"w":0.7,"smooth":false,"fill":"#e5e7eb"},{"t":"sphere","c":[1.9,7.0,0.8],"r":[0.45,0.7,0.45],"fill":"#9ca3af"},{"t":"tube","pts":[[-2.2,2.2,0.7],[-1.9,6.6,0.7]],"w":0.7,"smooth":false,"fill":"#e5e7eb"},{"t":"sphere","c":[-1.9,7.0,0.8],"r":[0.45,0.7,0.45],"fill":"#9ca3af"},{"t":"tube","pts":[[5.2,2.6,0.5],[4.2,3.5,0.5],[5.2,4.4,0.5]],"w":0.55,"smooth":false,"fill":"#34d399"},{"t":"tube","pts":[[6.6,2.4,0.5],[5.8,4.6,0.5]],"w":0.55,"smooth":false,"fill":"#34d399"},{"t":"tube","pts":[[7.2,2.6,0.5],[8.2,3.5,0.5],[7.2,4.4,0.5]],"w":0.55,"smooth":false,"fill":"#34d399"}]},{"id":"crown","slot":"head","scale":1.15,"bounds":[-10.3,-12.23,10.3,2.6],"regions":false,"parts":[{"t":"sphere","c":[0,0.9,0],"r":[8.8,1.7,0.1],"fill":"#05070d","opacity":0.22,"only":"2d"},{"t":"dome","c":[0,-1.6,0],"r":[7.2,6.0,7.2],"fill":"#a61e36"},{"t":"cyl","c":[0,-1.8,0],"r":[8.0,8.5],"h":4.4,"dz":1.0,"fill":"#f2c14e","metal":true},{"t":"cyl","c":[0,0.25,0],"r":[8.15,8.15],"h":0.9,"dz":1.0,"fill":"#c8922a","metal":true},{"t":"cyl","c":[0,-3.75,0],"r":[8.55,8.55],"h":0.7,"dz":1.0,"fill":"#c8922a","metal":true},{"t":"cyl","c":[4.82,-6.5,6.634],"r":[2.5,0],"h":5.6,"dz":1.0,"fill":"#f2c14e","metal":true},{"t":"sphere","c":[4.82,-9.7,6.634],"r":[1.05,1.05,1.05],"fill":"#ffe08a","metal":true},{"t":"cyl","c":[7.799,-6.5,-2.534],"r":[2.5,0],"h":5.6,"dz":1.0,"fill":"#f2c14e","metal":true},{"t":"sphere","c":[7.799,-9.7,-2.534],"r":[1.05,1.05,1.05],"fill":"#ffe08a","metal":true},{"t":"cyl","c":[0.0,-6.5,-8.2],"r":[2.5,0],"h":5.6,"dz":1.0,"fill":"#f2c14e","metal":true},{"t":"sphere","c":[0.0,-9.7,-8.2],"r":[1.05,1.05,1.05],"fill":"#ffe08a","metal":true},{"t":"cyl","c":[-7.799,-6.5,-2.534],"r":[2.5,0],"h":5.6,"dz":1.0,"fill":"#f2c14e","metal":true},{"t":"sphere","c":[-7.799,-9.7,-2.534],"r":[1.05,1.05,1.05],"fill":"#ffe08a","metal":true},{"t":"cyl","c":[-4.82,-6.5,6.634],"r":[2.5,0],"h":5.6,"dz":1.0,"fill":"#f2c14e","metal":true},{"t":"sphere","c":[-4.82,-9.7,6.634],"r":[1.05,1.05,1.05],"fill":"#ffe08a","metal":true},{"t":"sphere","c":[0,-1.9,8.6],"r":[1.7,1.7,0.8],"fill":"#d7263d","gloss":true},{"t":"sphere","c":[-6.317,-1.9,5.688],"r":[1.1,1.1,0.6],"fill":"#2f6fe0"},{"t":"sphere","c":[6.317,-1.9,5.688],"r":[1.1,1.1,0.6],"fill":"#2f6fe0"},{"t":"sphere","c":[-0.55,-2.5,9.5],"r":[0.5,0.4,0.1],"fill":"#ffffff","opacity":0.85,"only":"2d"},{"t":"sphere","c":[0,-7.8,0],"r":[1.25,1.25,1.25],"fill":"#f2c14e","metal":true},{"t":"tube","pts":[[0,-8.8,0],[0,-11.8,0]],"w":0.85,"smooth":false,"fill":"#f2c14e","metal":true},{"t":"tube","pts":[[-1.1,-10.7,0],[1.1,-10.7,0]],"w":0.85,"smooth":false,"fill":"#f2c14e","metal":true},{"t":"box","c":[-3.2,-2.9,8.9],"s":[4.2,0.6,0.1],"round":0.3,"fill":"#ffe39b","only":"2d"}]},{"id":"top_hat","slot":"head","scale":1.12,"bounds":[-13.82,-13.84,13.63,3.79],"regions":false,"parts":[{"t":"sphere","c":[0.105,1.795,0],"r":[10.8,1.7,0.1],"fill":"#05070d","opacity":0.24,"only":"2d","rot":-6.0},{"t":"cyl","c":[-0.052,0.303,0],"r":[12.4,12.4],"h":1.4,"dz":1.0,"fill":"#1e1f26","rot":-6.0},{"t":"sphere","c":[-12.227,1.18,0],"r":[1.6,1.2,4.2],"fill":"#1e1f26","only":"2d","rot":-6.0},{"t":"sphere","c":[12.039,-1.37,0],"r":[1.6,1.2,4.2],"fill":"#1e1f26","only":"2d","rot":-6.0},{"t":"cyl","c":[-0.794,-6.758,0],"r":[7.4,7.8],"h":12.6,"dz":1.0,"fill":"#272832","rot":-6.0},{"t":"cyl","c":[-0.261,-1.686,0],"r":[7.5,7.55],"h":2.8,"dz":1.0,"fill":"#b3243b","gloss":true,"rot":-6.0},{"t":"box","c":[-5.275,-7.293,7.9],"s":[1.3,9.6,0.1],"round":0.6,"fill":"#3b3d4a","only":"2d","rot":-6.0}]},{"id":"cap","slot":"head","scale":1.15,"bounds":[-11.6,-7.8,11.6,6.1],"regions":false,"parts":[{"t":"sphere","c":[0,3.0,0],"r":[9.4,1.6,0.1],"fill":"#05070d","opacity":0.18,"only":"2d"},{"t":"dome","c":[0,1.8,0],"r":[9.4,8.4,9.4],"fill":"#2f6fe0"},{"t":"tube","pts":[[0,-6.2,0],[0,1.4,0]],"w":0.45,"smooth":false,"fill":"#2556b8","only":"2d"},{"t":"tube","pts":[[-4.8,-5.6,0],[-6.2,1.6,0]],"w":0.45,"smooth":true,"fill":"#2556b8","only":"2d"},{"t":"tube","pts":[[4.8,-5.6,0],[6.2,1.6,0]],"w":0.45,"smooth":true,"fill":"#2556b8","only":"2d"},{"t":"sphere","c":[0,-6.6,0],"r":[1.2,1.2,1.2],"fill":"#2556b8"},{"t":"poly","pts":[[0.0,-3.4],[0.529,-2.128],[1.902,-2.018],[0.856,-1.122],[1.176,0.218],[0.0,-0.5],[-1.176,0.218],[-0.856,-1.122],[-1.902,-2.018],[-0.529,-2.128]],"z":8.7,"d":0.4,"smooth":false,"fill":"#ffffff"},{"t":"sphere","c":[0,4.7,7.5],"r":[10.4,1.4,0.1],"fill":"#05070d","opacity":0.2,"only":"2d"},{"t":"sphere","c":[0,2.4,7.6],"r":[11.6,1.9,7.4],"fill":"#1f4aa0"},{"t":"box","c":[0,1.6,8.9],"s":[14,0.5,0.1],"round":0.25,"fill":"#3a6fd0","only":"2d"}]},{"id":"headphones","slot":"head","scale":1,"bounds":[-15.7,-9.8,15.7,12.6],"regions":false,"parts":[{"t":"tube","pts":[[-12.8,5.6,0],[-12.0,-1.8,0],[-6.8,-7.2,0],[0,-8.6,0],[6.8,-7.2,0],[12.0,-1.8,0],[12.8,5.6,0]],"w":2.4,"smooth":true,"fill":"#2b2d34"},{"t":"tube","pts":[[-5.4,-6.4,0.9],[0,-7.6,0.9],[5.4,-6.4,0.9]],"w":1.6,"smooth":true,"fill":"#454956"},{"t":"sphere","c":[11.4,7.4,0],"r":[1.4,4.6,4.2],"fill":"#f97316"},{"t":"sphere","c":[13.1,7.4,0],"r":[2.6,5.2,4.8],"fill":"#2b2d34"},{"t":"box","c":[14.0,7.4,0],"s":[1.2,4.4,3.2],"round":0.5,"fill":"#3d404a"},{"t":"sphere","c":[-11.4,7.4,0],"r":[1.4,4.6,4.2],"fill":"#f97316"},{"t":"sphere","c":[-13.1,7.4,0],"r":[2.6,5.2,4.8],"fill":"#2b2d34"},{"t":"box","c":[-14.0,7.4,0],"s":[1.2,4.4,3.2],"round":0.5,"fill":"#3d404a"}]},{"id":"sunglasses","slot":"face","scale":1,"bounds":[-11.8,-4.05,11.8,3.58],"regions":false,"parts":[{"t":"poly","pts":[[-9.638,-3.625],[-0.59,-3.625],[-0.706,0.335],[-1.402,2.495],[-2.91,3.455],[-6.854,3.575],[-8.594,2.615],[-9.406,0.575]],"z":0.7,"d":1.2,"smooth":false,"fill":"#0b0c10","gloss":true},{"t":"poly","pts":[[9.406,0.575],[8.594,2.615],[6.854,3.575],[2.91,3.455],[1.402,2.495],[0.706,0.335],[0.59,-3.625],[9.638,-3.625]],"z":0.7,"d":1.2,"smooth":false,"fill":"#0b0c10","gloss":true},{"t":"poly","pts":[[-9.0,-2.9],[-1.2,-2.9],[-1.3,0.4],[-1.9,2.2],[-3.2,3.0],[-6.6,3.1],[-8.1,2.3],[-8.8,0.6]],"z":1.0,"d":0.7,"smooth":false,"fill":"#243049","gloss":true,"gradient":["#151925","#3d4f78"]},{"t":"poly","pts":[[8.8,0.6],[8.1,2.3],[6.6,3.1],[3.2,3.0],[1.9,2.2],[1.3,0.4],[1.2,-2.9],[9.0,-2.9]],"z":1.0,"d":0.7,"smooth":false,"fill":"#243049","gloss":true,"gradient":["#151925","#3d4f78"]},{"t":"poly","pts":[[-7.0,-2.5],[-5.9,-2.5],[-7.7,1.9],[-8.4,1.0]],"z":1.5,"d":0.1,"smooth":false,"fill":"#ffffff","opacity":0.16,"only":"2d"},{"t":"poly","pts":[[-5.2,-2.5],[-4.75,-2.5],[-6.5,2.7],[-7.0,2.5]],"z":1.5,"d":0.1,"smooth":false,"fill":"#ffffff","opacity":0.1,"only":"2d"},{"t":"poly","pts":[[3.0,-2.5],[4.1,-2.5],[2.3,1.9],[1.6,1.0]],"z":1.5,"d":0.1,"smooth":false,"fill":"#ffffff","opacity":0.16,"only":"2d"},{"t":"poly","pts":[[4.8,-2.5],[5.25,-2.5],[3.5,2.7],[3.0,2.5]],"z":1.5,"d":0.1,"smooth":false,"fill":"#ffffff","opacity":0.1,"only":"2d"},{"t":"tube","pts":[[-9.7,-3.2,1.3],[9.7,-3.2,1.3]],"w":1.7,"smooth":false,"fill":"#0b0c10","gloss":true},{"t":"tube","pts":[[-8.9,-3.7,1.6],[8.9,-3.7,1.6]],"w":0.35,"smooth":false,"fill":"#626a7e","opacity":0.9,"only":"2d"},{"t":"tube","pts":[[-1.4,-1.7,1.1],[0,-2.4,1.1],[1.4,-1.7,1.1]],"w":1.0,"smooth":true,"fill":"#0b0c10","gloss":true},{"t":"tube","pts":[[-9.6,-2.7,0.8],[-11.3,-2.4,-1.2]],"w":1.0,"smooth":false,"fill":"#0b0c10","gloss":true},{"t":"tube","pts":[[9.6,-2.7,0.8],[11.3,-2.4,-1.2]],"w":1.0,"smooth":false,"fill":"#0b0c10","gloss":true},{"t":"sphere","c":[-8.9,-2.9,1.9],"r":[0.5,0.5,0.3],"fill":"#d5d9e2","metal":true},{"t":"sphere","c":[8.9,-2.9,1.9],"r":[0.5,0.5,0.3],"fill":"#d5d9e2","metal":true},{"t":"poly","pts":[[6.9,-3.2],[7.126,-1.726],[8.6,-1.5],[7.126,-1.274],[6.9,0.2],[6.674,-1.274],[5.2,-1.5],[6.674,-1.726]],"z":1.8,"d":0.1,"smooth":false,"fill":"#ffffff","only":"2d","anim":"twinkle"},{"t":"poly","pts":[[-3.6,-2.9],[-3.444,-2.056],[-2.6,-1.9],[-3.444,-1.744],[-3.6,-0.9],[-3.756,-1.744],[-4.6,-1.9],[-3.756,-2.056]],"z":1.8,"d":0.1,"smooth":false,"fill":"#ffffff","only":"2d","anim":"twinkle-late"}]},{"id":"cigar","slot":"mouth","scale":1,"bounds":[-1.04,-10.52,19.22,5.61],"regions":false,"parts":[{"t":"tube","pts":[[0.783,0.166,0.8],[10.368,2.204,0.8]],"w":3.2,"smooth":false,"fill":"#6f3f1f"},{"t":"tube","pts":[[1.309,-0.386,1.4],[10.504,1.568,1.4]],"w":1.0,"smooth":false,"fill":"#a8693a","opacity":0.55,"only":"2d"},{"t":"tube","pts":[[2.175,-0.611,1.6],[9.609,0.969,1.6]],"w":0.32,"smooth":false,"fill":"#e6ab72","opacity":0.45,"only":"2d"},{"t":"tube","pts":[[0.781,1.137,1.4],[10.366,3.175,1.4]],"w":0.9,"smooth":false,"fill":"#3d2110","opacity":0.5,"only":"2d"},{"t":"tube","pts":[[10.368,2.204,0.8],[10.76,2.287,0.8]],"w":3.2,"smooth":false,"fill":"#6f3f1f"},{"t":"tube","pts":[[5.192,-0.379,1.6],[5.382,2.575,1.6]],"w":0.22,"smooth":false,"fill":"#4a2812","opacity":0.5,"only":"2d"},{"t":"tube","pts":[[7.54,0.12,1.6],[7.73,3.074,1.6]],"w":0.22,"smooth":false,"fill":"#4a2812","opacity":0.5,"only":"2d"},{"t":"tube","pts":[[9.594,0.557,1.6],[9.784,3.511,1.6]],"w":0.22,"smooth":false,"fill":"#4a2812","opacity":0.5,"only":"2d"},{"t":"tube","pts":[[0.587,0.125,0.82],[1.467,0.312,0.84]],"w":3.25,"smooth":false,"fill":"#5a3519"},{"t":"cyl","c":[3.326,0.707,0.8],"r":[1.74,1.74],"h":1.8,"dz":1.0,"fill":"#f2c14e","rot":102,"metal":true},{"t":"cyl","c":[3.326,0.707,0.8],"r":[1.77,1.77],"h":0.55,"dz":1.0,"fill":"#b3243b","rot":102},{"t":"sphere","c":[3.326,0.707,2.6],"r":[0.62,0.62,0.3],"fill":"#ffe08a","metal":true,"rot":12.0},{"t":"tube","pts":[[2.848,-1.133,1.7],[2.141,2.193,1.7]],"w":0.2,"smooth":false,"fill":"#c8922a","opacity":0.9,"only":"2d","metal":true},{"t":"tube","pts":[[4.511,-0.779,1.7],[3.804,2.546,1.7]],"w":0.2,"smooth":false,"fill":"#c8922a","opacity":0.9,"only":"2d","metal":true},{"t":"cyl","c":[11.395,2.422,0.8],"r":[1.55,1.52],"h":1.3,"dz":1.0,"fill":"#9a9a9a","rot":102},{"t":"tube","pts":[[11.463,0.903,1.6],[10.839,3.837,1.6]],"w":0.25,"smooth":false,"fill":"#d0d0d0","opacity":0.75,"only":"2d"},{"t":"tube","pts":[[11.952,1.007,1.6],[11.328,3.941,1.6]],"w":0.25,"smooth":false,"fill":"#d0d0d0","opacity":0.75,"only":"2d"},{"t":"cyl","c":[12.227,2.599,0.8],"r":[1.5,1.35],"h":0.45,"dz":1.0,"fill":"#ff5a14","rot":102,"glow":true},{"t":"sphere","c":[12.52,2.661,1.0],"r":[3.0,3.0,0.1],"fill":"#ff7a2a","opacity":0.2,"only":"2d","anim":"ember","rot":12.0},{"t":"sphere","c":[12.52,2.661,1.1],"r":[1.7,1.9,0.1],"fill":"#ff9a3c","opacity":0.35,"only":"2d","anim":"ember","rot":12.0},{"t":"sphere","c":[12.569,2.672,1.2],"r":[0.45,1.2,0.4],"fill":"#ffd25a","glow":true,"anim":"ember","rot":12.0},{"t":"tube","pts":[[13.018,1.682,1.4],[14.518,-0.918,1.5],[13.118,-3.718,1.6],[14.818,-6.718,1.7]],"w":0.85,"smooth":true,"fill":"#d9dbe2","opacity":0.55,"only":"2d"},{"t":"tube","pts":[[13.818,0.482,1.4],[15.618,-1.318,1.5],[15.018,-3.518,1.6]],"w":0.55,"smooth":true,"fill":"#d9dbe2","opacity":0.4,"only":"2d"},{"t":"smoke","c":[13.218,1.482,1.5],"size":1.0,"fill":"#e4e6ec"}]}]}
+{"schema":2,"slots":["back","outfit","neck","mouth","face","head","held"],"slotDepth":{"back":-1,"outfit":1,"neck":1,"mouth":1,"face":1,"head":0,"held":0.4},"slotFlatShift":{"outfit":1.0,"neck":1.0},"frontDepthM":0.25,"shapes":{"circle":{"top":3.8,"bottom":36.2,"eyeY":17.2,"anchors":{"head":[20,5.2,1],"neck":[20,22.4,1.0],"held":[33.5,29,1.35],"back":[20,20,1],"outfit":[20,22.4,1.0],"face":[20,17.2,1],"mouth":[20,24.0,1.15]},"depth":{"back":-0.499,"face":0.491,"head":0.0,"held":0.166,"mouth":0.484,"neck":0.494,"outfit":0.494}},"squircle":{"top":3.8,"bottom":36.2,"eyeY":17.2,"anchors":{"head":[20,4.4,1],"neck":[20,22.4,1.0],"held":[34,29,1.35],"back":[20,20,1],"outfit":[20,22.4,1.0],"face":[20,17.2,1],"mouth":[20,24.0,1.15]},"depth":{"back":-0.46,"face":0.46,"head":0.0,"held":0.182,"mouth":0.46,"neck":0.46,"outfit":0.46}},"pill":{"top":8.48,"bottom":31.52,"eyeY":17.2,"anchors":{"head":[20,9.6,0.95],"neck":[20,22.2,0.85],"held":[35.5,26,1.282],"back":[20,20,0.95],"outfit":[20,22.2,0.85],"face":[20,17.2,1],"mouth":[20,24.0,1.15]},"depth":{"back":-0.499,"face":0.485,"head":0.0,"held":0.171,"mouth":0.469,"neck":0.49,"outfit":0.49}},"triangle":{"top":5.5,"bottom":33.5,"eyeY":23,"anchors":{"head":[20,8.6,0.72],"neck":[20,28.0,0.8],"held":[32.5,31,1.215],"back":[20,22,0.9],"outfit":[20,28.0,0.8],"face":[20,23,0.9],"mouth":[20,29.12,1.035]},"depth":{"back":-0.337,"face":0.357,"head":0.0,"held":0.208,"mouth":0.482,"neck":0.459,"outfit":0.459}},"hexagon":{"top":3.5,"bottom":36.5,"eyeY":17.2,"anchors":{"head":[20,5.8,0.9],"neck":[20,22.4,0.95],"held":[33,29,1.282],"back":[20,20,0.95],"outfit":[20,22.4,0.95],"face":[20,17.2,1],"mouth":[20,24.0,1.15]},"depth":{"back":-0.381,"face":0.381,"head":0.0,"held":0.138,"mouth":0.381,"neck":0.381,"outfit":0.381}},"cloud":{"top":5.028,"bottom":32,"eyeY":23,"anchors":{"head":[19.2,6.6,0.95],"neck":[20,27.6,0.7],"held":[37,27.5,1.215],"back":[21,20,1],"outfit":[20,27.6,0.7],"face":[20,23,0.9],"mouth":[20,29.12,1.035]},"depth":{"back":-0.298,"face":0.359,"head":0.0,"held":0.143,"mouth":0.314,"neck":0.356,"outfit":0.356}},"drop":{"top":3,"bottom":40.5,"eyeY":25,"anchors":{"head":[20,9.6,0.72],"neck":[20,30.0,0.95],"held":[32.5,34,1.282],"back":[20,25,0.95],"outfit":[20,30.0,0.95],"face":[20,25,1],"mouth":[20,31.8,1.15]},"depth":{"back":-0.365,"face":0.365,"head":0.0,"held":0.128,"mouth":0.348,"neck":0.364,"outfit":0.364}}},"items":[{"id":"suit","slot":"outfit","scale":1,"bounds":[-8.42,-0.4,8.42,10.62],"regions":true,"parts":[{"t":"region","pts":[[-20,7.0],[-15,3.2],[-10,1.0],[-5,-0.2],[5,-0.2],[10,1.0],[15,3.2],[20,7.0],[60,60.0],[-60,60.0]],"mode":"wrap","fill":"#2c3a55"},{"t":"region","pts":[[8.0,1.2],[60,1.2],[60,60],[11.5,60]],"mode":"front","fill":"#05070d","opacity":0.16,"only":"2d"},{"t":"region","pts":[[-60,0.0],[-9.5,0.8],[-12.5,60],[-60,60]],"mode":"front","fill":"#ffffff","opacity":0.05,"only":"2d"},{"t":"region","pts":[[-4.6,-0.4],[4.6,-0.4],[0,8.8]],"mode":"front","fill":"#f4f6f8"},{"t":"region","pts":[[-4.4,-0.4],[-0.9,0.2],[-2.6,2.8]],"mode":"front","fill":"#dfe4ea"},{"t":"region","pts":[[4.4,-0.4],[2.6,2.8],[0.9,0.2]],"mode":"front","fill":"#dfe4ea"},{"t":"region","pts":[[-4.6,-0.4],[4.6,-0.4],[3.6,1.3],[-3.6,1.3]],"mode":"front","fill":"#05070d","opacity":0.2,"only":"2d"},{"t":"region","pts":[[-1.0,2.0],[1.0,2.0],[2.1,8.2],[0,10.4],[-2.1,8.2]],"mode":"front","fill":"#b3243b"},{"t":"region","pts":[[-1.1,3.9],[1.2,3.1],[1.32,3.75],[-1.2,4.55]],"mode":"front","fill":"#86182b"},{"t":"region","pts":[[-1.6,6.7],[1.75,5.6],[1.85,6.3],[-1.65,7.4]],"mode":"front","fill":"#86182b"},{"t":"poly","pts":[[-1.55,-0.4],[1.55,-0.4],[1.0,2.1],[-1.0,2.1]],"z":0.9,"d":0.9,"smooth":false,"fill":"#b3243b"},{"t":"region","pts":[[-4.6,-0.4],[0,8.8],[-1.3,10.4],[-6.9,3.4],[-8.2,0.2]],"mode":"front","fill":"#212b42"},{"t":"region","pts":[[8.2,0.2],[6.9,3.4],[1.3,10.4],[0,8.8],[4.6,-0.4]],"mode":"front","fill":"#212b42"},{"t":"tube","pts":[[-8.2,0.2,0.3],[-6.9,3.4,0.3],[-1.3,10.4,0.3]],"w":0.45,"smooth":false,"fill":"#ffffff","opacity":0.16,"only":"2d"},{"t":"tube","pts":[[8.2,0.2,0.3],[6.9,3.4,0.3],[1.3,10.4,0.3]],"w":0.45,"smooth":false,"fill":"#ffffff","opacity":0.1,"only":"2d"},{"t":"region","pts":[[0.739,12.006],[0.306,12.439],[-0.306,12.439],[-0.739,12.006],[-0.739,11.394],[-0.306,10.961],[0.306,10.961],[0.739,11.394]],"mode":"front","fill":"#18202f"},{"t":"region","pts":[[0.739,14.706],[0.306,15.139],[-0.306,15.139],[-0.739,14.706],[-0.739,14.094],[-0.306,13.661],[0.306,13.661],[0.739,14.094]],"mode":"front","fill":"#18202f"},{"t":"region","pts":[[5.0,4.0],[8.8,4.0],[8.8,4.5],[5.0,4.5]],"mode":"front","fill":"#18202f"},{"t":"region","pts":[[5.4,4.0],[6.9,4.0],[6.0,2.3]],"mode":"front","fill":"#f4f6f8"},{"t":"region","pts":[[6.4,4.0],[8.2,4.0],[7.6,2.5]],"mode":"front","fill":"#f4f6f8"}]},{"id":"tuxedo","slot":"outfit","scale":1,"bounds":[-8.42,-1.5,8.42,11.62],"regions":true,"parts":[{"t":"region","pts":[[-20,7.0],[-15,3.2],[-10,1.0],[-5,-0.2],[5,-0.2],[10,1.0],[15,3.2],[20,7.0],[60,60.0],[-60,60.0]],"mode":"wrap","fill":"#22232b"},{"t":"region","pts":[[8.0,1.2],[60,1.2],[60,60],[11.5,60]],"mode":"front","fill":"#05070d","opacity":0.22,"only":"2d"},{"t":"region","pts":[[-60,0.0],[-9.5,0.8],[-12.5,60],[-60,60]],"mode":"front","fill":"#ffffff","opacity":0.06,"only":"2d"},{"t":"region","pts":[[-4.4,-0.4],[4.4,-0.4],[0,9.8]],"mode":"front","fill":"#f4f6f8"},{"t":"region","pts":[[-4.4,-0.4],[4.4,-0.4],[3.4,1.3],[-3.4,1.3]],"mode":"front","fill":"#05070d","opacity":0.2,"only":"2d"},{"t":"region","pts":[[-1.85,3.0],[-1.5,3.0],[-1.5,7.6],[-1.85,7.6]],"mode":"front","fill":"#dfe4ea"},{"t":"region","pts":[[1.5,3.0],[1.85,3.0],[1.85,7.6],[1.5,7.6]],"mode":"front","fill":"#dfe4ea"},{"t":"region","pts":[[0.462,3.791],[0.191,4.062],[-0.191,4.062],[-0.462,3.791],[-0.462,3.409],[-0.191,3.138],[0.191,3.138],[0.462,3.409]],"mode":"front","fill":"#101014"},{"t":"region","pts":[[0.462,5.991],[0.191,6.262],[-0.191,6.262],[-0.462,5.991],[-0.462,5.609],[-0.191,5.338],[0.191,5.338],[0.462,5.609]],"mode":"front","fill":"#101014"},{"t":"region","pts":[[0.416,8.172],[0.172,8.416],[-0.172,8.416],[-0.416,8.172],[-0.416,7.828],[-0.172,7.584],[0.172,7.584],[0.416,7.828]],"mode":"front","fill":"#101014"},{"t":"region","pts":[[-4.6,-0.4],[0,9.8],[-1.3,11.4],[-6.9,3.4],[-8.2,0.2]],"mode":"front","fill":"#3a3c48","gloss":true},{"t":"region","pts":[[8.2,0.2],[6.9,3.4],[1.3,11.4],[0,9.8],[4.6,-0.4]],"mode":"front","fill":"#3a3c48","gloss":true},{"t":"tube","pts":[[-8.2,0.2,0.3],[-6.9,3.4,0.3],[-1.3,11.4,0.3]],"w":0.45,"smooth":false,"fill":"#ffffff","opacity":0.16,"only":"2d"},{"t":"tube","pts":[[8.2,0.2,0.3],[6.9,3.4,0.3],[1.3,11.4,0.3]],"w":0.45,"smooth":false,"fill":"#ffffff","opacity":0.1,"only":"2d"},{"t":"poly","pts":[[0,-0.1],[3.6,-1.5],[4.1,0.9],[3.6,2.7],[0,1.3],[-3.6,2.7],[-4.1,0.9],[-3.6,-1.5]],"z":0.9,"d":1.0,"smooth":false,"fill":"#22232b"},{"t":"sphere","c":[0,0.6,1.4],"r":[1.1,1.3,0.7],"fill":"#26272f"},{"t":"region","pts":[[5.0,4.0],[8.8,4.0],[8.8,4.5],[5.0,4.5]],"mode":"front","fill":"#0d0d10"},{"t":"region","pts":[[5.4,4.0],[6.9,4.0],[6.0,2.3]],"mode":"front","fill":"#f4f6f8"},{"t":"region","pts":[[6.4,4.0],[8.2,4.0],[7.6,2.5]],"mode":"front","fill":"#f4f6f8"}]},{"id":"lab_coat","slot":"outfit","scale":1,"bounds":[-9.03,-0.4,9.03,9.42],"regions":true,"parts":[{"t":"region","pts":[[-20,7.0],[-15,3.2],[-10,1.0],[-5,-0.2],[5,-0.2],[10,1.0],[15,3.2],[20,7.0],[60,60.0],[-60,60.0]],"mode":"wrap","fill":"#f2f4f7"},{"t":"region","pts":[[8.0,1.2],[60,1.2],[60,60],[11.5,60]],"mode":"front","fill":"#05070d","opacity":0.08,"only":"2d"},{"t":"region","pts":[[-4.0,-0.4],[4.0,-0.4],[0,7.6]],"mode":"front","fill":"#a9c8ef"},{"t":"region","pts":[[-4.0,-0.4],[4.0,-0.4],[3.0,1.3],[-3.0,1.3]],"mode":"front","fill":"#05070d","opacity":0.2,"only":"2d"},{"t":"region","pts":[[-0.9,1.8],[0.9,1.8],[1.8,6.6],[0,8.4],[-1.8,6.6]],"mode":"front","fill":"#0f766e"},{"t":"poly","pts":[[-1.4,-0.4],[1.4,-0.4],[0.9,1.9],[-0.9,1.9]],"z":0.9,"d":0.8,"smooth":false,"fill":"#0f766e"},{"t":"region","pts":[[-4.6,-0.4],[0,7.6],[-1.3,9.2],[-7.5,3.4],[-8.8,0.2]],"mode":"front","fill":"#dde2e9"},{"t":"region","pts":[[8.8,0.2],[7.5,3.4],[1.3,9.2],[0,7.6],[4.6,-0.4]],"mode":"front","fill":"#dde2e9"},{"t":"tube","pts":[[-8.8,0.2,0.3],[-7.5,3.4,0.3],[-1.3,9.2,0.3]],"w":0.45,"smooth":false,"fill":"#ffffff","opacity":0.16,"only":"2d"},{"t":"tube","pts":[[8.8,0.2,0.3],[7.5,3.4,0.3],[1.3,9.2,0.3]],"w":0.45,"smooth":false,"fill":"#ffffff","opacity":0.1,"only":"2d"},{"t":"region","pts":[[-0.2,9.2],[0.25,9.2],[0.25,40],[-0.2,40]],"mode":"front","fill":"#dde2e9"},{"t":"region","pts":[[5.6,1.8],[6.3,1.8],[6.3,4.6],[5.6,4.6]],"mode":"front","fill":"#2f6fe0"},{"t":"region","pts":[[6.9,2.3],[7.6,2.3],[7.6,4.6],[6.9,4.6]],"mode":"front","fill":"#e0483e"},{"t":"region","pts":[[4.6,3.8],[8.8,3.8],[8.8,7.6],[4.6,7.6]],"mode":"front","fill":"#dde2e9"},{"t":"region","pts":[[-8.8,4.4],[-5.0,4.4],[-5.0,8.8],[-8.8,8.8]],"mode":"front","fill":"#ffffff"},{"t":"region","pts":[[-8.8,4.4],[-5.0,4.4],[-5.0,5.5],[-8.8,5.5]],"mode":"front","fill":"#0f766e"},{"t":"region","pts":[[-8.2,6.4],[-5.6,6.4],[-5.6,6.8],[-8.2,6.8]],"mode":"front","fill":"#c5ccd6"},{"t":"region","pts":[[-8.2,7.4],[-6.4,7.4],[-6.4,7.8],[-8.2,7.8]],"mode":"front","fill":"#c5ccd6"}]},{"id":"hoodie","slot":"outfit","scale":1,"bounds":[-2.55,1.85,8.47,7.7],"regions":true,"parts":[{"t":"rim","w":1.9,"fill":"#4a5160","maxY":4.0},{"t":"rim","w":0.75,"fill":"#3a404c","maxY":4.0,"only":"2d"},{"t":"region","pts":[[-20,7.8],[-15,4.0],[-10,1.8],[-5,0.6],[5,0.6],[10,1.8],[15,4.0],[20,7.8],[60,60.8],[-60,60.8]],"mode":"wrap","fill":"#4a5160"},{"t":"region","pts":[[8.0,2.0],[60,2.0],[60,60.8],[11.5,60.8]],"mode":"front","fill":"#05070d","opacity":0.18,"only":"2d"},{"t":"region","pts":[[-5.2,0.8],[5.2,0.8],[4.0,2.7],[0,3.3],[-4.0,2.7]],"mode":"front","fill":"#3a404c"},{"t":"region","pts":[[-6.4,7.6],[6.4,7.6],[7.8,13.0],[-7.8,13.0]],"mode":"front","fill":"#3a404c"},{"t":"tube","pts":[[2.2,2.2,0.7],[1.9,6.6,0.7]],"w":0.7,"smooth":false,"fill":"#e5e7eb"},{"t":"sphere","c":[1.9,7.0,0.8],"r":[0.45,0.7,0.45],"fill":"#9ca3af"},{"t":"tube","pts":[[-2.2,2.2,0.7],[-1.9,6.6,0.7]],"w":0.7,"smooth":false,"fill":"#e5e7eb"},{"t":"sphere","c":[-1.9,7.0,0.8],"r":[0.45,0.7,0.45],"fill":"#9ca3af"},{"t":"tube","pts":[[5.2,2.6,0.5],[4.2,3.5,0.5],[5.2,4.4,0.5]],"w":0.55,"smooth":false,"fill":"#34d399"},{"t":"tube","pts":[[6.6,2.4,0.5],[5.8,4.6,0.5]],"w":0.55,"smooth":false,"fill":"#34d399"},{"t":"tube","pts":[[7.2,2.6,0.5],[8.2,3.5,0.5],[7.2,4.4,0.5]],"w":0.55,"smooth":false,"fill":"#34d399"}]},{"id":"crown","slot":"head","scale":1.15,"bounds":[-10.3,-12.23,10.3,2.6],"regions":false,"parts":[{"t":"sphere","c":[0,0.9,0],"r":[8.8,1.7,0.1],"fill":"#05070d","opacity":0.22,"only":"2d"},{"t":"dome","c":[0,-1.6,0],"r":[7.2,6.0,7.2],"fill":"#a61e36"},{"t":"cyl","c":[0,-1.8,0],"r":[8.0,8.5],"h":4.4,"dz":1.0,"fill":"#f2c14e","metal":true},{"t":"cyl","c":[0,0.25,0],"r":[8.15,8.15],"h":0.9,"dz":1.0,"fill":"#c8922a","metal":true},{"t":"cyl","c":[0,-3.75,0],"r":[8.55,8.55],"h":0.7,"dz":1.0,"fill":"#c8922a","metal":true},{"t":"cyl","c":[4.82,-6.5,6.634],"r":[2.5,0],"h":5.6,"dz":1.0,"fill":"#f2c14e","metal":true},{"t":"sphere","c":[4.82,-9.7,6.634],"r":[1.05,1.05,1.05],"fill":"#ffe08a","metal":true},{"t":"cyl","c":[7.799,-6.5,-2.534],"r":[2.5,0],"h":5.6,"dz":1.0,"fill":"#f2c14e","metal":true},{"t":"sphere","c":[7.799,-9.7,-2.534],"r":[1.05,1.05,1.05],"fill":"#ffe08a","metal":true},{"t":"cyl","c":[0.0,-6.5,-8.2],"r":[2.5,0],"h":5.6,"dz":1.0,"fill":"#f2c14e","metal":true},{"t":"sphere","c":[0.0,-9.7,-8.2],"r":[1.05,1.05,1.05],"fill":"#ffe08a","metal":true},{"t":"cyl","c":[-7.799,-6.5,-2.534],"r":[2.5,0],"h":5.6,"dz":1.0,"fill":"#f2c14e","metal":true},{"t":"sphere","c":[-7.799,-9.7,-2.534],"r":[1.05,1.05,1.05],"fill":"#ffe08a","metal":true},{"t":"cyl","c":[-4.82,-6.5,6.634],"r":[2.5,0],"h":5.6,"dz":1.0,"fill":"#f2c14e","metal":true},{"t":"sphere","c":[-4.82,-9.7,6.634],"r":[1.05,1.05,1.05],"fill":"#ffe08a","metal":true},{"t":"sphere","c":[0,-1.9,8.6],"r":[1.7,1.7,0.8],"fill":"#d7263d","gloss":true},{"t":"sphere","c":[-6.317,-1.9,5.688],"r":[1.1,1.1,0.6],"fill":"#2f6fe0"},{"t":"sphere","c":[6.317,-1.9,5.688],"r":[1.1,1.1,0.6],"fill":"#2f6fe0"},{"t":"sphere","c":[-0.55,-2.5,9.5],"r":[0.5,0.4,0.1],"fill":"#ffffff","opacity":0.85,"only":"2d"},{"t":"sphere","c":[0,-7.8,0],"r":[1.25,1.25,1.25],"fill":"#f2c14e","metal":true},{"t":"tube","pts":[[0,-8.8,0],[0,-11.8,0]],"w":0.85,"smooth":false,"fill":"#f2c14e","metal":true},{"t":"tube","pts":[[-1.1,-10.7,0],[1.1,-10.7,0]],"w":0.85,"smooth":false,"fill":"#f2c14e","metal":true},{"t":"box","c":[-3.2,-2.9,8.9],"s":[4.2,0.6,0.1],"round":0.3,"fill":"#ffe39b","only":"2d"}]},{"id":"top_hat","slot":"head","scale":1.12,"bounds":[-13.82,-13.84,13.63,3.79],"regions":false,"parts":[{"t":"sphere","c":[0.105,1.795,0],"r":[10.8,1.7,0.1],"fill":"#05070d","opacity":0.24,"only":"2d","rot":-6.0},{"t":"cyl","c":[-0.052,0.303,0],"r":[12.4,12.4],"h":1.4,"dz":1.0,"fill":"#1e1f26","rot":-6.0},{"t":"sphere","c":[-12.227,1.18,0],"r":[1.6,1.2,4.2],"fill":"#1e1f26","only":"2d","rot":-6.0},{"t":"sphere","c":[12.039,-1.37,0],"r":[1.6,1.2,4.2],"fill":"#1e1f26","only":"2d","rot":-6.0},{"t":"cyl","c":[-0.794,-6.758,0],"r":[7.4,7.8],"h":12.6,"dz":1.0,"fill":"#272832","rot":-6.0},{"t":"cyl","c":[-0.261,-1.686,0],"r":[7.5,7.55],"h":2.8,"dz":1.0,"fill":"#b3243b","gloss":true,"rot":-6.0},{"t":"box","c":[-5.275,-7.293,7.9],"s":[1.3,9.6,0.1],"round":0.6,"fill":"#3b3d4a","only":"2d","rot":-6.0}]},{"id":"cap","slot":"head","scale":1.15,"bounds":[-11.6,-7.8,11.6,6.1],"regions":false,"parts":[{"t":"sphere","c":[0,3.0,0],"r":[9.4,1.6,0.1],"fill":"#05070d","opacity":0.18,"only":"2d"},{"t":"dome","c":[0,1.8,0],"r":[9.4,8.4,9.4],"fill":"#2f6fe0"},{"t":"tube","pts":[[0,-6.2,0],[0,1.4,0]],"w":0.45,"smooth":false,"fill":"#2556b8","only":"2d"},{"t":"tube","pts":[[-4.8,-5.6,0],[-6.2,1.6,0]],"w":0.45,"smooth":true,"fill":"#2556b8","only":"2d"},{"t":"tube","pts":[[4.8,-5.6,0],[6.2,1.6,0]],"w":0.45,"smooth":true,"fill":"#2556b8","only":"2d"},{"t":"sphere","c":[0,-6.6,0],"r":[1.2,1.2,1.2],"fill":"#2556b8"},{"t":"poly","pts":[[0.0,-3.4],[0.529,-2.128],[1.902,-2.018],[0.856,-1.122],[1.176,0.218],[0.0,-0.5],[-1.176,0.218],[-0.856,-1.122],[-1.902,-2.018],[-0.529,-2.128]],"z":8.7,"d":0.4,"smooth":false,"fill":"#ffffff"},{"t":"sphere","c":[0,4.7,7.5],"r":[10.4,1.4,0.1],"fill":"#05070d","opacity":0.2,"only":"2d"},{"t":"sphere","c":[0,2.4,7.6],"r":[11.6,1.9,7.4],"fill":"#1f4aa0"},{"t":"box","c":[0,1.6,8.9],"s":[14,0.5,0.1],"round":0.25,"fill":"#3a6fd0","only":"2d"}]},{"id":"headphones","slot":"head","scale":1,"bounds":[-15.7,-9.8,15.7,12.6],"regions":false,"parts":[{"t":"tube","pts":[[-12.8,5.6,0],[-12.0,-1.8,0],[-6.8,-7.2,0],[0,-8.6,0],[6.8,-7.2,0],[12.0,-1.8,0],[12.8,5.6,0]],"w":2.4,"smooth":true,"fill":"#2b2d34"},{"t":"tube","pts":[[-5.4,-6.4,0.9],[0,-7.6,0.9],[5.4,-6.4,0.9]],"w":1.6,"smooth":true,"fill":"#454956"},{"t":"sphere","c":[11.4,7.4,0],"r":[1.4,4.6,4.2],"fill":"#f97316"},{"t":"sphere","c":[13.1,7.4,0],"r":[2.6,5.2,4.8],"fill":"#2b2d34"},{"t":"box","c":[14.0,7.4,0],"s":[1.2,4.4,3.2],"round":0.5,"fill":"#3d404a"},{"t":"sphere","c":[-11.4,7.4,0],"r":[1.4,4.6,4.2],"fill":"#f97316"},{"t":"sphere","c":[-13.1,7.4,0],"r":[2.6,5.2,4.8],"fill":"#2b2d34"},{"t":"box","c":[-14.0,7.4,0],"s":[1.2,4.4,3.2],"round":0.5,"fill":"#3d404a"}]},{"id":"sunglasses","slot":"face","scale":1,"bounds":[-11.8,-4.05,11.8,3.58],"regions":false,"parts":[{"t":"poly","pts":[[-9.638,-3.625],[-0.59,-3.625],[-0.706,0.335],[-1.402,2.495],[-2.91,3.455],[-6.854,3.575],[-8.594,2.615],[-9.406,0.575]],"z":0.7,"d":1.2,"smooth":false,"fill":"#0b0c10","gloss":true},{"t":"poly","pts":[[9.406,0.575],[8.594,2.615],[6.854,3.575],[2.91,3.455],[1.402,2.495],[0.706,0.335],[0.59,-3.625],[9.638,-3.625]],"z":0.7,"d":1.2,"smooth":false,"fill":"#0b0c10","gloss":true},{"t":"poly","pts":[[-9.0,-2.9],[-1.2,-2.9],[-1.3,0.4],[-1.9,2.2],[-3.2,3.0],[-6.6,3.1],[-8.1,2.3],[-8.8,0.6]],"z":1.0,"d":0.7,"smooth":false,"fill":"#243049","gloss":true,"gradient":["#151925","#3d4f78"]},{"t":"poly","pts":[[8.8,0.6],[8.1,2.3],[6.6,3.1],[3.2,3.0],[1.9,2.2],[1.3,0.4],[1.2,-2.9],[9.0,-2.9]],"z":1.0,"d":0.7,"smooth":false,"fill":"#243049","gloss":true,"gradient":["#151925","#3d4f78"]},{"t":"poly","pts":[[-7.0,-2.5],[-5.9,-2.5],[-7.7,1.9],[-8.4,1.0]],"z":1.5,"d":0.1,"smooth":false,"fill":"#ffffff","opacity":0.16,"only":"2d"},{"t":"poly","pts":[[-5.2,-2.5],[-4.75,-2.5],[-6.5,2.7],[-7.0,2.5]],"z":1.5,"d":0.1,"smooth":false,"fill":"#ffffff","opacity":0.1,"only":"2d"},{"t":"poly","pts":[[3.0,-2.5],[4.1,-2.5],[2.3,1.9],[1.6,1.0]],"z":1.5,"d":0.1,"smooth":false,"fill":"#ffffff","opacity":0.16,"only":"2d"},{"t":"poly","pts":[[4.8,-2.5],[5.25,-2.5],[3.5,2.7],[3.0,2.5]],"z":1.5,"d":0.1,"smooth":false,"fill":"#ffffff","opacity":0.1,"only":"2d"},{"t":"tube","pts":[[-9.7,-3.2,1.3],[9.7,-3.2,1.3]],"w":1.7,"smooth":false,"fill":"#0b0c10","gloss":true},{"t":"tube","pts":[[-8.9,-3.7,1.6],[8.9,-3.7,1.6]],"w":0.35,"smooth":false,"fill":"#626a7e","opacity":0.9,"only":"2d"},{"t":"tube","pts":[[-1.4,-1.7,1.1],[0,-2.4,1.1],[1.4,-1.7,1.1]],"w":1.0,"smooth":true,"fill":"#0b0c10","gloss":true},{"t":"tube","pts":[[-9.6,-2.7,0.8],[-11.3,-2.4,-1.2]],"w":1.0,"smooth":false,"fill":"#0b0c10","gloss":true},{"t":"tube","pts":[[9.6,-2.7,0.8],[11.3,-2.4,-1.2]],"w":1.0,"smooth":false,"fill":"#0b0c10","gloss":true},{"t":"sphere","c":[-8.9,-2.9,1.9],"r":[0.5,0.5,0.3],"fill":"#d5d9e2","metal":true},{"t":"sphere","c":[8.9,-2.9,1.9],"r":[0.5,0.5,0.3],"fill":"#d5d9e2","metal":true},{"t":"poly","pts":[[6.9,-3.2],[7.126,-1.726],[8.6,-1.5],[7.126,-1.274],[6.9,0.2],[6.674,-1.274],[5.2,-1.5],[6.674,-1.726]],"z":1.8,"d":0.1,"smooth":false,"fill":"#ffffff","only":"2d","anim":"twinkle"},{"t":"poly","pts":[[-3.6,-2.9],[-3.444,-2.056],[-2.6,-1.9],[-3.444,-1.744],[-3.6,-0.9],[-3.756,-1.744],[-4.6,-1.9],[-3.756,-2.056]],"z":1.8,"d":0.1,"smooth":false,"fill":"#ffffff","only":"2d","anim":"twinkle-late"}]},{"id":"cigar","slot":"mouth","scale":1,"bounds":[-1.04,-10.52,19.22,5.61],"regions":false,"parts":[{"t":"tube","pts":[[0.783,0.166,0.8],[10.368,2.204,0.8]],"w":3.2,"smooth":false,"fill":"#6f3f1f"},{"t":"tube","pts":[[1.309,-0.386,1.4],[10.504,1.568,1.4]],"w":1.0,"smooth":false,"fill":"#a8693a","opacity":0.55,"only":"2d"},{"t":"tube","pts":[[2.175,-0.611,1.6],[9.609,0.969,1.6]],"w":0.32,"smooth":false,"fill":"#e6ab72","opacity":0.45,"only":"2d"},{"t":"tube","pts":[[0.781,1.137,1.4],[10.366,3.175,1.4]],"w":0.9,"smooth":false,"fill":"#3d2110","opacity":0.5,"only":"2d"},{"t":"tube","pts":[[10.368,2.204,0.8],[10.76,2.287,0.8]],"w":3.2,"smooth":false,"fill":"#6f3f1f"},{"t":"tube","pts":[[5.192,-0.379,1.6],[5.382,2.575,1.6]],"w":0.22,"smooth":false,"fill":"#4a2812","opacity":0.5,"only":"2d"},{"t":"tube","pts":[[7.54,0.12,1.6],[7.73,3.074,1.6]],"w":0.22,"smooth":false,"fill":"#4a2812","opacity":0.5,"only":"2d"},{"t":"tube","pts":[[9.594,0.557,1.6],[9.784,3.511,1.6]],"w":0.22,"smooth":false,"fill":"#4a2812","opacity":0.5,"only":"2d"},{"t":"tube","pts":[[0.587,0.125,0.82],[1.467,0.312,0.84]],"w":3.25,"smooth":false,"fill":"#5a3519"},{"t":"cyl","c":[3.326,0.707,0.8],"r":[1.74,1.74],"h":1.8,"dz":1.0,"fill":"#f2c14e","rot":102,"metal":true},{"t":"cyl","c":[3.326,0.707,0.8],"r":[1.77,1.77],"h":0.55,"dz":1.0,"fill":"#b3243b","rot":102},{"t":"sphere","c":[3.326,0.707,2.6],"r":[0.62,0.62,0.3],"fill":"#ffe08a","metal":true,"rot":12.0},{"t":"tube","pts":[[2.848,-1.133,1.7],[2.141,2.193,1.7]],"w":0.2,"smooth":false,"fill":"#c8922a","opacity":0.9,"only":"2d","metal":true},{"t":"tube","pts":[[4.511,-0.779,1.7],[3.804,2.546,1.7]],"w":0.2,"smooth":false,"fill":"#c8922a","opacity":0.9,"only":"2d","metal":true},{"t":"cyl","c":[11.395,2.422,0.8],"r":[1.55,1.52],"h":1.3,"dz":1.0,"fill":"#9a9a9a","rot":102},{"t":"tube","pts":[[11.463,0.903,1.6],[10.839,3.837,1.6]],"w":0.25,"smooth":false,"fill":"#d0d0d0","opacity":0.75,"only":"2d"},{"t":"tube","pts":[[11.952,1.007,1.6],[11.328,3.941,1.6]],"w":0.25,"smooth":false,"fill":"#d0d0d0","opacity":0.75,"only":"2d"},{"t":"cyl","c":[12.227,2.599,0.8],"r":[1.5,1.35],"h":0.45,"dz":1.0,"fill":"#ff5a14","rot":102,"glow":true},{"t":"sphere","c":[12.52,2.661,1.0],"r":[3.0,3.0,0.1],"fill":"#ff7a2a","opacity":0.2,"only":"2d","anim":"ember","rot":12.0},{"t":"sphere","c":[12.52,2.661,1.1],"r":[1.7,1.9,0.1],"fill":"#ff9a3c","opacity":0.35,"only":"2d","anim":"ember","rot":12.0},{"t":"sphere","c":[12.569,2.672,1.2],"r":[0.45,1.2,0.4],"fill":"#ffd25a","glow":true,"anim":"ember","rot":12.0},{"t":"tube","pts":[[13.018,1.682,1.4],[14.518,-0.918,1.5],[13.118,-3.718,1.6],[14.818,-6.718,1.7]],"w":0.85,"smooth":true,"fill":"#d9dbe2","opacity":0.55,"only":"2d"},{"t":"tube","pts":[[13.818,0.482,1.4],[15.618,-1.318,1.5],[15.018,-3.518,1.6]],"w":0.55,"smooth":true,"fill":"#d9dbe2","opacity":0.4,"only":"2d"},{"t":"smoke","c":[13.218,1.482,1.5],"size":1.0,"fill":"#e4e6ec"}]}]}
diff --git a/jarvis/ui/web/frontend/src/components/society/companion/accessories.test.tsx b/jarvis/ui/web/frontend/src/components/society/companion/accessories.test.tsx
index 4483844dde..6988794d4c 100644
--- a/jarvis/ui/web/frontend/src/components/society/companion/accessories.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/companion/accessories.test.tsx
@@ -6,7 +6,7 @@ import es from "@/i18n/locales/society/es.json";
import { AgentSymbol } from "../AgentSymbol";
import {
ACCESSORY_CATALOG, ACCESSORY_IDS_BY_SLOT, ACCESSORY_ITEMS, ACCESSORY_SLOTS, OFFERED_SLOTS, randomAccessories, resolveFill,
- symbolViewBox, wornAccessories,
+ slotDepthM, symbolViewBox, wornAccessories,
} from "./accessories";
import { COMPANION_SHAPES, companionSchema, resolveCompanion } from "./appearance";
@@ -91,3 +91,15 @@ describe("agent symbol accessories", () => {
}
});
});
+
+describe("accessory depth on the volumetric bodies", () => {
+ it.each(COMPANION_SHAPES)("rests every %s slot on the measured body surface", shape => {
+ const depth = ACCESSORY_CATALOG.shapes[shape].depth!;
+ for (const slot of ACCESSORY_SLOTS) expect(slotDepthM(shape, slot)).toBe(depth[slot]);
+ // Worn items sit on the front of a solid at least a third of a metre deep.
+ expect(depth.face!).toBeGreaterThan(0.2);
+ expect(depth.back!).toBeLessThan(-0.2);
+ expect(depth.head).toBe(0);
+ });
+});
+
diff --git a/jarvis/ui/web/frontend/src/components/society/companion/accessories.ts b/jarvis/ui/web/frontend/src/components/society/companion/accessories.ts
index a3308bf1fd..69e29925b2 100644
--- a/jarvis/ui/web/frontend/src/components/society/companion/accessories.ts
+++ b/jarvis/ui/web/frontend/src/components/society/companion/accessories.ts
@@ -55,10 +55,20 @@ export interface AccessoryItem {
}
/** [x, y, scale] in symbol coordinates. */
export type AnchorPoint = [number, number, number];
-export interface AccessoryShape { top: number; bottom: number; eyeY: number; anchors: Record<AccessorySlot, AnchorPoint> }
+export interface AccessoryShape {
+ top: number; bottom: number; eyeY: number; anchors: Record<AccessorySlot, AnchorPoint>;
+ /** Measured body surface depth (m, toward the viewer) under each slot anchor. */
+ depth?: Partial<Record<AccessorySlot, number>>;
+}
+
+/** Where a slot's free parts rest in front of (or behind) the body centre, in metres. */
+export function slotDepthM(shape: SymbolShape, slot: AccessorySlot): number {
+ return ACCESSORY_CATALOG.shapes[shape].depth?.[slot] ?? ACCESSORY_CATALOG.slotDepth[slot] * ACCESSORY_CATALOG.frontDepthM;
+}
interface Catalog {
schema: number;
slots: AccessorySlot[];
+ /** Fallback depth as a fraction of frontDepthM, for a shape without measured depths. */
slotDepth: Record<AccessorySlot, number>;
/** Flat-only x shift that recentres clothing under the tilted flat face. */
slotFlatShift: Partial<Record<AccessorySlot, number>>;
diff --git a/scripts/art/build_agent_companions.py b/scripts/art/build_agent_companions.py
index 0bd90f5b75..744f972838 100644
--- a/scripts/art/build_agent_companions.py
+++ b/scripts/art/build_agent_companions.py
@@ -1,99 +1,151 @@
-"""Author the approved flat bot silhouettes as small bevelled Blender figures.
+"""Author the flat bot silhouettes as small volumetric Blender figures.
-Input: source/outlines.json sampled from the actual AgentSymbol SVG geometry.
-Run inside Blender with --background --factory-startup --python this_file.
+Input: source/outlines.json sampled from the actual AgentSymbol SVG geometry,
+and the slot anchors of the accessory catalog. Run inside Blender with
+--background --factory-startup --python this_file.
+
+Every body is a real solid (see companion_bodies.py), not an extruded outline.
+The eyes sit on the curved front surface, turned along its normal. The script
+also writes source/body_depths.json: the surface depth under each accessory
+slot anchor, which companion_accessories.py copies into the catalog so worn
+items rest on the body instead of a fixed front plane.
The .blend remains editable; GLB uses ordinary meshes and PBR materials only.
"""
import json
+import shutil
+import sys
from pathlib import Path
import bmesh
import bpy
+from mathutils import Matrix, Vector
+
+sys.path.insert(0, str(Path(__file__).resolve().parent))
+from companion_bodies import EYE_X, EYE_Y, FACETED, Surface, build_body, frame # noqa: E402
ROOT = Path(__file__).resolve().parents[2]
STUDY = ROOT / "art/studies/agent-symbol-companions"
+CATALOG = ROOT / "jarvis/ui/web/frontend/src/components/society/companion/accessories.json"
+RUNTIME_COPY = ROOT / "jarvis/ui/web/frontend/src/assets/society/companions/companions.glb"
+# Eye radii in symbol units (x, y) and their thickness in metres.
+EYE_SIZE = {"Dots": (2.2, 2.3), "Lines": (1.3, 3.2)}
+EYE_THICKNESS_M = 0.024
-def material(name, color):
+def material(name, color, roughness):
mat = bpy.data.materials.new(name)
mat.diffuse_color = (*color, 1)
mat.use_nodes = True
bsdf = mat.node_tree.nodes.get("Principled BSDF")
bsdf.inputs["Base Color"].default_value = (*color, 1)
- bsdf.inputs["Roughness"].default_value = 0.78
+ bsdf.inputs["Roughness"].default_value = roughness
return mat
+def mesh_object(name, bm, parent, mat):
+ mesh = bpy.data.meshes.new(name)
+ bm.to_mesh(mesh)
+ bm.free()
+ obj = bpy.data.objects.new(name, mesh)
+ bpy.context.collection.objects.link(obj)
+ obj.parent = parent
+ obj.data.materials.append(mat)
+ return obj
+
+
+def surface_ellipsoid(location, normal, radii, segments=16):
+ """A flat ellipsoid lying on the surface: local Y follows the outward normal."""
+ bm = bmesh.new()
+ bmesh.ops.create_uvsphere(bm, u_segments=segments, v_segments=segments // 2, radius=1)
+ bmesh.ops.scale(bm, vec=radii, verts=bm.verts)
+ turn = Vector((0, -1, 0)).rotation_difference(normal).to_matrix().to_4x4()
+ bmesh.ops.transform(bm, matrix=Matrix.Translation(location) @ turn, verts=bm.verts)
+ for face in bm.faces:
+ face.smooth = True
+ return bm
+
+
+def slot_depths(surface, outline, anchors):
+ """Metres from the centre plane toward the viewer for each slot anchor."""
+ bottom, scale = frame(outline)
+
+ def at(slot, front=True, centre=False):
+ x, y, _ = anchors[slot]
+ return surface.depth_near(0 if centre else (x - 20) * scale, (bottom - y) * scale, front)
+
+ depths = {slot: round(at(slot), 4) for slot in ("face", "mouth", "neck", "outfit")}
+ depths["back"] = round(at("back", front=False), 4)
+ depths["head"] = 0.0
+ depths["held"] = round(0.4 * at("held", centre=True), 4)
+ return depths
+
+
def main():
bpy.ops.object.select_all(action="SELECT")
bpy.ops.object.delete(use_global=False)
outlines = json.loads((STUDY / "source/outlines.json").read_text(encoding="utf-8"))
- body_mat = material("Companion.Body", (0.62, 0.40, 0.93))
- eye_mat = material("Companion.Eyes", (0.01, 0.009, 0.015))
- shine_mat = material("Companion.Highlight", (1, 1, 1))
+ shapes = json.loads(CATALOG.read_text(encoding="utf-8"))["shapes"]
+ body_mat = material("Companion.Body", (0.62, 0.40, 0.93), 0.6)
+ eye_mat = material("Companion.Eyes", (0.01, 0.009, 0.015), 0.35)
+ shine_mat = material("Companion.Highlight", (1, 1, 1), 0.2)
+ depths = {}
for name, points in outlines.items():
parent = bpy.data.objects.new(name, None)
bpy.context.collection.objects.link(parent)
- low = min(y for _, y in points)
- high = max(y for _, y in points)
- scale = 1 / (high - low)
- contour = [((x - 20) * scale, (high - y) * scale) for x, y in points]
- count = len(contour)
- vertices = [(x, depth, z) for depth in (-0.25, 0.25) for x, z in contour]
- faces = [tuple(range(count)), tuple(range(count, count * 2))]
- faces += [(i, (i + 1) % count, (i + 1) % count + count, i + count) for i in range(count)]
- mesh = bpy.data.meshes.new(f"{name}.Body")
- mesh.from_pydata(vertices, [], faces)
- bm = bmesh.new()
- bm.from_mesh(mesh)
- bmesh.ops.recalc_face_normals(bm, faces=bm.faces)
- bm.to_mesh(mesh)
- bm.free()
- obj = bpy.data.objects.new(f"{name}.Body", mesh)
- bpy.context.collection.objects.link(obj)
- obj.parent = parent
- obj.data.materials.append(body_mat)
- bevel = obj.modifiers.new("Soft edge", "BEVEL")
- bevel.width = 0.065
- bevel.segments = 4
- obj.modifiers.new("Surface normals", "WEIGHTED_NORMAL")
- eye_y = 23 if name in ("cloud", "triangle") else 25 if name == "drop" else 17.2
- for style in ("Dots", "Lines"):
- for side, x in enumerate((15.4, 24.6)):
- bpy.ops.mesh.primitive_uv_sphere_add(
- segments=16,
- ring_count=8,
- location=((x - 20) * scale, -0.259, (high - eye_y) * scale),
- )
- eye = bpy.context.object
- eye.name = f"{name}.{style}.{side}"
- eye.parent = parent
- eye.scale = (
- (2.2 if style == "Dots" else 1.3) * scale,
- 0.023,
- (2.3 if style == "Dots" else 3.2) * scale,
- )
- eye.data.materials.append(eye_mat)
+ bottom, scale = frame(points)
+ body = build_body(name, points)
+ surface = Surface(body)
+ depths[name] = slot_depths(surface, points, shapes[name]["anchors"])
+ obj = mesh_object(f"{name}.Body", body, parent, body_mat)
+ if name in FACETED:
+ # Flat facets stay flat; the rounded bevels between them stay soft.
+ weighted = obj.modifiers.new("Surface normals", "WEIGHTED_NORMAL")
+ weighted.keep_sharp = True
+ eye_y = EYE_Y.get(name, 17.2)
+ for style, (rx, rz) in EYE_SIZE.items():
+ for side, x in enumerate(EYE_X):
+ found = surface.hit((x - 20) * scale, (bottom - eye_y) * scale)
+ if found is None:
+ raise RuntimeError(f"{name}: eye {side} misses the body")
+ location, normal = found
+ # Half sunk into the body, so the eye reads as painted on, not stuck on.
+ centre = location - normal * EYE_THICKNESS_M * 0.35
+ radii = (rx * scale, EYE_THICKNESS_M, rz * scale)
+ eye = surface_ellipsoid(centre, normal, radii)
+ mesh_object(f"{name}.{style}.{side}", eye, parent, eye_mat)
if style == "Dots":
- bpy.ops.mesh.primitive_uv_sphere_add(
- segments=12,
- ring_count=6,
- radius=0.65 * scale,
- location=((x - 20 - 0.6) * scale, -0.283, (high - eye_y + 0.7) * scale),
+ glint = surface.hit((x - 20.6) * scale, (bottom - eye_y + 0.7) * scale)
+ spot, spot_normal = glint or found
+ mesh_object(
+ f"{name}.Highlight.{side}",
+ surface_ellipsoid(
+ spot + spot_normal * EYE_THICKNESS_M * 0.75,
+ spot_normal,
+ (0.65 * scale, 0.3 * EYE_THICKNESS_M, 0.65 * scale),
+ segments=12,
+ ),
+ parent,
+ shine_mat,
)
- shine = bpy.context.object
- shine.name = f"{name}.Highlight.{side}"
- shine.parent = parent
- shine.data.materials.append(shine_mat)
+ (STUDY / "source/body_depths.json").write_text(
+ json.dumps(depths, indent=2, sort_keys=True) + "\n", encoding="utf-8"
+ )
bpy.context.preferences.filepaths.save_version = 0
bpy.ops.wm.save_as_mainfile(
filepath=str(STUDY / "source/companions.blend"), check_existing=False
)
+ export = STUDY / "exports/companions.glb"
bpy.ops.export_scene.gltf(
- filepath=str(STUDY / "exports/companions.glb"), export_format="GLB", export_animations=False
+ filepath=str(export),
+ export_format="GLB",
+ export_animations=False,
+ export_apply=True,
+ # Flat colours only: no texture coordinates to ship.
+ export_texcoords=False,
)
- print("COMPANION_GEOMETRY_EXPORTED", (STUDY / "exports/companions.glb").stat().st_size)
+ shutil.copyfile(export, RUNTIME_COPY)
+ print("COMPANION_GEOMETRY_EXPORTED", export.stat().st_size)
if __name__ == "__main__":
diff --git a/scripts/art/build_companion_accessories.py b/scripts/art/build_companion_accessories.py
index e4908ba86e..c9220b4530 100644
--- a/scripts/art/build_companion_accessories.py
+++ b/scripts/art/build_companion_accessories.py
@@ -1,14 +1,19 @@
"""Build the companion accessory meshes from the shared accessory catalog.
Input: jarvis/ui/web/frontend/src/components/society/companion/accessories.json
-(written by companion_accessories.py) and source/outlines.json.
+(written by companion_accessories.py) and source/outlines.json. The bodies are
+rebuilt with companion_bodies.py, exactly as in companions.glb.
Run inside Blender with --background --factory-startup --python this_file.
Output nodes in accessories.glb:
- acc_<id> free parts in symbol units around the slot anchor; the
- runtime places and scales them per shape.
- acc_<id>__<shape> clothing patches of the body surface, already in the
- shape's 1 m unit-master space (same frame as companions.glb).
+ acc_<id> free parts in symbol units around the slot anchor; the
+ runtime places and scales them per shape.
+ acc_<id>__<shape> clothing patches cut from the body surface itself, already
+ in the shape's 1 m unit-master space (same frame as
+ companions.glb).
+ acc_<id>__<shape>__fit the free parts of items worn on the body (outfit, neck,
+ face), placed on that shape and bent onto its surface;
+ the runtime uses it instead of placing acc_<id>.
Materials are named acc:<fill>[:glow]; fills body/bodyDark/bodyLight are tinted
from the agent colour at runtime.
"""
@@ -16,20 +21,24 @@ from the agent colour at runtime.
import json
import math
import shutil
+import sys
from pathlib import Path
import bmesh
import bpy
from mathutils import Matrix, Vector
+sys.path.insert(0, str(Path(__file__).resolve().parent))
+from companion_bodies import FACETED, Surface, build_body # noqa: E402
+
ROOT = Path(__file__).resolve().parents[2]
STUDY = ROOT / "art/studies/agent-symbol-companions"
CATALOG = ROOT / "jarvis/ui/web/frontend/src/components/society/companion/accessories.json"
RUNTIME_COPY = ROOT / "jarvis/ui/web/frontend/src/assets/society/companions/accessories.glb"
-FRONT_M = 0.25
-BODY_BEVEL_M = 0.065
SLOT_LIFT_M = {"outfit": 0.0, "neck": 0.006, "head": 0.006}
+# Items worn on the body surface get per-shape fitted free parts.
+FITTED_SLOTS = {"outfit", "neck", "face"}
# --- small geometry helpers ------------------------------------------------------
@@ -73,54 +82,6 @@ def signed_area(poly):
)
-def offset_polygon(poly, distance):
- """Move each vertex along its averaged outward edge normal (positive = grow)."""
- sign = 1 if signed_area(poly) > 0 else -1
- n = len(poly)
- out = []
- for i in range(n):
- prev, cur, nxt = poly[i - 1], poly[i], poly[(i + 1) % n]
- normals = []
- for a, b in ((prev, cur), (cur, nxt)):
- dx, dy = b[0] - a[0], b[1] - a[1]
- length = math.hypot(dx, dy) or 1
- normals.append((dy / length * sign, -dx / length * sign))
- nx, ny = normals[0][0] + normals[1][0], normals[0][1] + normals[1][1]
- length = math.hypot(nx, ny) or 1
- out.append((cur[0] + nx / length * distance, cur[1] + ny / length * distance))
- return out
-
-
-def clip_polygon(subject, clip):
- """Sutherland-Hodgman: subject may be concave, clip must be convex."""
- orient = 1 if signed_area(clip) > 0 else -1
-
- def inside(p, a, b):
- return orient * ((b[0] - a[0]) * (p[1] - a[1]) - (b[1] - a[1]) * (p[0] - a[0])) >= 0
-
- def cross_point(p, q, a, b):
- x1, y1, x2, y2 = p[0], p[1], q[0], q[1]
- x3, y3, x4, y4 = a[0], a[1], b[0], b[1]
- den = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4) or 1e-9
- t = ((x1 - x3) * (y3 - y4) - (y1 - y3) * (x3 - x4)) / den
- return (x1 + t * (x2 - x1), y1 + t * (y2 - y1))
-
- output = list(subject)
- for a, b in zip(clip, clip[1:] + clip[:1], strict=True):
- source, output = output, []
- for i, cur in enumerate(source):
- prev = source[i - 1]
- if inside(cur, a, b):
- if not inside(prev, a, b):
- output.append(cross_point(prev, cur, a, b))
- output.append(cur)
- elif inside(prev, a, b):
- output.append(cross_point(prev, cur, a, b))
- if not output:
- return []
- return output
-
-
def svg_to_blender(x, y, z):
"""Symbol units (y down, z toward viewer) to Blender (z up, -y toward viewer)."""
return Vector((x, -z, -y))
@@ -359,88 +320,119 @@ def assemble(name, pieces):
return obj
-def rim_piece(part, meta, anchor, outline):
- """A hood: one closed shell around the head, above maxY (symbol y).
+def master_point(meta, sx, sy):
+ """Symbol (x, y) on the shape's 1 m master: Blender (x, z)."""
+ scale = 1 / (meta["bottom"] - meta["top"])
+ return Vector(((sx - 20) * scale, 0, (meta["bottom"] - sy) * scale))
+
+
+def cut_to_prism(bm, meta, clip):
+ """Keep the body inside the convex clip polygon, extended through the depth axis."""
+ corners = [master_point(meta, x, y) for x, y in clip]
+ centre = sum(corners, Vector()) / len(corners)
+ for a, b in zip(corners, corners[1:] + corners[:1], strict=True):
+ edge = b - a
+ if edge.length < 1e-6:
+ continue
+ normal = Vector((edge.z, 0, -edge.x)).normalized()
+ if normal.dot(centre - a) > 0:
+ normal = -normal
+ geom = bm.verts[:] + bm.edges[:] + bm.faces[:]
+ bmesh.ops.bisect_plane(bm, geom=geom, plane_co=a, plane_no=normal, clear_outer=True)
+ bm.normal_update()
+
+
+def shell(bm, lift, thickness=0.008):
+ """Float a surface patch above the body and give it a little thickness."""
+ bm.normal_update()
+ normals = {vert: vert.normal.copy() for vert in bm.verts}
+ for vert, normal in normals.items():
+ vert.co += normal * (lift + thickness)
+ bmesh.ops.solidify(bm, geom=bm.faces[:], thickness=thickness)
+ for face in bm.faces:
+ face.smooth = True
+ return bm
+
+
+def rim_piece(part, meta, anchor, body):
+ """A hood: the body grown by w symbol units above maxY, open toward the face.
- The grown silhouette is extruded from just behind the face to past the
- back of the body. Inside the outline the body hides it; beyond it, it is
- the hood's edge, and its back face covers the back of the head. A closed
- solid has no open cut ends and no faces that vanish from behind.
+ A vertical cut through the front half leaves a clean opening on every
+ body, where a cut by surface normal would fray on an irregular mesh.
"""
- top, bottom = meta["top"], meta["bottom"]
- scale = 1 / (bottom - top)
+ scale = 1 / (meta["bottom"] - meta["top"])
_, ay, k = anchor
- limit = ay + part["maxY"] * k if "maxY" in part else 1e6
- above = [(-1e3, -1e3), (1e3, -1e3), (1e3, limit), (-1e3, limit)]
- area = clip_polygon(offset_polygon(outline, part["w"]), above)
- if len(area) < 3:
- return bmesh.new()
- flat = [((x - 20) * scale, (bottom - y) * scale) for x, y in area]
- bm = extrude_outline(flat, -0.12, FRONT_M + 0.05)
- bmesh.ops.bevel(
+ bm = body.copy()
+ bm.normal_update()
+ for vert in bm.verts:
+ vert.co += vert.normal * part["w"] * scale
+ if "maxY" in part:
+ limit = master_point(meta, 20, ay + part["maxY"] * k)
+ geom = bm.verts[:] + bm.edges[:] + bm.faces[:]
+ bmesh.ops.bisect_plane(
+ bm, geom=geom, plane_co=limit, plane_no=Vector((0, 0, -1)), clear_outer=True
+ )
+ front = -min(vert.co.y for vert in bm.verts)
+ geom = bm.verts[:] + bm.edges[:] + bm.faces[:]
+ bmesh.ops.bisect_plane(
bm,
- geom=bm.edges[:],
- offset=0.03,
- segments=2,
- affect="EDGES",
- profile=0.5,
- clamp_overlap=True,
+ geom=geom,
+ plane_co=Vector((0, -0.45 * front, 0)),
+ plane_no=Vector((0, -1, 0)),
+ clear_outer=True,
)
- for face in bm.faces:
- face.smooth = abs(face.normal.y) < 0.99
- return bm
+ return shell(bm, 0.0, thickness=0.02)
-def region_pieces(item, shape, meta, outline):
- top, bottom = meta["top"], meta["bottom"]
- scale = 1 / (bottom - top)
+def region_pieces(item, shape, meta, body):
+ """Clothing as patches of the actual body surface, layered in authoring order."""
ax, ay, k = meta["anchors"][item["slot"]]
lift = SLOT_LIFT_M.get(item["slot"], 0.006)
- body_inset = offset_polygon(outline, -(BODY_BEVEL_M + 0.006) / scale)
pieces = []
order = 0
for part in item["parts"]:
if part.get("only") == "2d":
continue
if part["t"] == "rim":
- pieces.append(
- (
- rim_piece(part, meta, meta["anchors"][item["slot"]], outline),
- material(part["fill"], False),
- )
- )
+ piece = rim_piece(part, meta, meta["anchors"][item["slot"]], body)
+ pieces.append((piece, material(part["fill"], False)))
continue
if part["t"] != "region":
continue
- clip = [(ax + x * k, ay + y * k) for x, y in part["pts"]]
- if part["mode"] == "wrap":
- area = clip_polygon(outline, clip)
- grow = 0.008 + lift + 0.003 * order
- if len(area) < 3:
- continue
- area = offset_polygon(area, (grow + 0.012) / scale)
- depth = (-(FRONT_M + grow), FRONT_M + grow)
- else:
- area = clip_polygon(body_inset, clip)
- if len(area) < 3:
- continue
- depth = (-(FRONT_M + 0.02 + lift + 0.003 * order), -(FRONT_M - 0.01))
+ bm = body.copy()
+ cut_to_prism(bm, meta, [(ax + x * k, ay + y * k) for x, y in part["pts"]])
+ if part["mode"] == "front":
+ facing_away = [f for f in bm.faces if f.normal.y > -0.25]
+ bmesh.ops.delete(bm, geom=facing_away, context="FACES")
+ bmesh.ops.delete(bm, geom=[v for v in bm.verts if not v.link_faces], context="VERTS")
+ if not bm.faces:
+ bm.free()
+ continue
+ base = 0.008 if part["mode"] == "wrap" else 0.016
+ patch = shell(bm, base + lift + 0.004 * order)
+ pieces.append((patch, material(part["fill"], part.get("glow", False))))
order += 1
- flat = [((x - 20) * scale, (bottom - y) * scale) for x, y in area]
- bm = extrude_outline(flat, depth[0], depth[1])
- if part["mode"] == "wrap":
- bmesh.ops.bevel(
- bm,
- geom=[e for e in bm.edges if not all(abs(v.co.y) < FRONT_M for v in e.verts)],
- offset=0.045,
- segments=2,
- affect="EDGES",
- profile=0.5,
- clamp_overlap=True,
- )
- for face in bm.faces:
- face.smooth = abs(face.normal.y) < 0.99
- pieces.append((bm, material(part["fill"], part.get("glow", False))))
+ return pieces
+
+
+def fitted_pieces(item, meta, depths, surface):
+ """Free parts placed on one shape and bent onto its surface, in master metres."""
+ ax, ay, k = meta["anchors"][item["slot"]]
+ scale = 1 / (meta["bottom"] - meta["top"])
+ size = k * item.get("scale", 1) * scale
+ anchor_depth = depths[item["slot"]]
+ origin = master_point(meta, ax, ay) + Vector((0, -anchor_depth, 0))
+ place = Matrix.Translation(origin) @ Matrix.Scale(size, 4)
+ pieces = []
+ for part in item["parts"]:
+ if part["t"] in ("region", "rim", "smoke") or part.get("only") == "2d":
+ continue
+ bm = BUILDERS[part["t"]](part)
+ bmesh.ops.transform(bm, matrix=place, verts=bm.verts)
+ for vert in bm.verts:
+ vert.co.y -= surface.depth_near(vert.co.x, vert.co.z) - anchor_depth
+ finish = (part.get("glow", False), part.get("metal", False), part.get("gloss", False))
+ pieces.append((bm, material(part["fill"], *finish)))
return pieces
@@ -449,6 +441,8 @@ def main():
bpy.ops.object.delete(use_global=False)
catalog = json.loads(CATALOG.read_text(encoding="utf-8"))
outlines = json.loads((STUDY / "source/outlines.json").read_text(encoding="utf-8"))
+ bodies = {shape: build_body(shape, outlines[shape], light=True) for shape in catalog["shapes"]}
+ surfaces = {shape: Surface(body) for shape, body in bodies.items()}
count = 0
for item in catalog["items"]:
pieces = [
@@ -464,14 +458,23 @@ def main():
if pieces:
assemble(f"acc_{item['id']}", pieces)
count += 1
- if item["regions"]:
- for shape, meta in catalog["shapes"].items():
- # Every second outline sample keeps the silhouette and halves clothing size.
- outline = [tuple(p) for p in outlines[shape][::2]]
- pieces = region_pieces(item, shape, meta, outline)
+ for shape, meta in catalog["shapes"].items():
+ made = []
+ if item["regions"]:
+ pieces = region_pieces(item, shape, meta, bodies[shape])
+ if pieces:
+ made.append(assemble(f"acc_{item['id']}__{shape}", pieces))
+ if item["slot"] in FITTED_SLOTS:
+ pieces = fitted_pieces(item, meta, meta["depth"], surfaces[shape])
if pieces:
- assemble(f"acc_{item['id']}__{shape}", pieces)
- count += 1
+ made.append(assemble(f"acc_{item['id']}__{shape}__fit", pieces))
+ for obj in made:
+ count += 1
+ if shape in FACETED:
+ # Clothing on flat facets stays flat, like the body under it.
+ obj.modifiers.new("Surface normals", "WEIGHTED_NORMAL").keep_sharp = True
+ for body in bodies.values():
+ body.free()
bpy.context.preferences.filepaths.save_version = 0
bpy.ops.wm.save_as_mainfile(
filepath=str(STUDY / "source/accessories.blend"), check_existing=False
@@ -482,6 +485,9 @@ def main():
export_format="GLB",
export_animations=False,
export_materials="EXPORT",
+ export_apply=True,
+ # Flat colours only: no texture coordinates to ship.
+ export_texcoords=False,
)
shutil.copyfile(export, RUNTIME_COPY)
print("ACCESSORY_GEOMETRY_EXPORTED", count, export.stat().st_size)
diff --git a/scripts/art/companion_accessories.py b/scripts/art/companion_accessories.py
index 6a0f20f87a..5224805176 100644
--- a/scripts/art/companion_accessories.py
+++ b/scripts/art/companion_accessories.py
@@ -20,11 +20,14 @@ from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
OUTLINES = ROOT / "art/studies/agent-symbol-companions/source/outlines.json"
+# Written by build_agent_companions.py: body surface depth (m) under each slot anchor.
+BODY_DEPTHS = ROOT / "art/studies/agent-symbol-companions/source/body_depths.json"
OUTPUT = ROOT / "jarvis/ui/web/frontend/src/components/society/companion/accessories.json"
# Draw order of the flat symbol; also the persisted slot names.
SLOTS = ["back", "outfit", "neck", "mouth", "face", "head", "held"]
-# Anchor depth as a fraction of the body's front surface (0 = body centre).
+# Fallback anchor depth as a fraction of frontDepthM (0 = body centre); each shape
+# carries its measured surface depth per slot in "depth".
SLOT_DEPTH = {"back": -1, "outfit": 1, "neck": 1, "mouth": 1, "face": 1, "head": 0, "held": 0.4}
EYE_Y = {"cloud": 23, "triangle": 23, "drop": 25}
@@ -469,6 +472,7 @@ def rounded(value):
def main():
outlines = json.loads(OUTLINES.read_text(encoding="utf-8"))
+ depths = json.loads(BODY_DEPTHS.read_text(encoding="utf-8"))
shapes = {}
for name, anchors in ANCHORS.items():
ys = [y for _, y in outlines[name]]
@@ -479,6 +483,7 @@ def main():
"anchors": {**anchors, "neck": NECK[name], "outfit": NECK[name], "face": [20, eye, face_k],
"mouth": [20, eye + MOUTH_DROP * face_k, round(face_k * MOUTH_BOOST, 3)],
"held": [*anchors["held"][:2], round(anchors["held"][2] * HELD_BOOST, 3)]},
+ "depth": depths[name],
}
groups = {"outfit": outfit_items(), "head": head_items(), "face": face_items(), "mouth": mouth_items()}
for group in groups.values():
diff --git a/scripts/art/companion_bodies.py b/scripts/art/companion_bodies.py
new file mode 100644
index 0000000000..0829def2cb
--- /dev/null
+++ b/scripts/art/companion_bodies.py
@@ -0,0 +1,260 @@
+"""Volumetric agent-symbol bodies, shared by the companion and accessory builders.
+
+Each flat profile silhouette becomes a real solid whose front view still
+matches the SVG outline: the circle a sphere, the drop a teardrop of
+revolution, the triangle a square pyramid, the hexagon a six-sided crystal,
+the squircle a rounded cube, the pill a capsule and the cloud a union of puffs.
+
+Bodies are built in symbol units (X = svg x, Z = -svg y, Y = depth with the
+front toward -Y) and then moved into the 1 m unit-master frame used by
+companions.glb: x = (svg_x - 20) * scale, z = (bottom - svg_y) * scale.
+Run only inside Blender (bmesh/bpy/mathutils).
+"""
+
+import math
+
+import bmesh
+import bpy
+from mathutils import Matrix, Vector
+from mathutils.bvhtree import BVHTree
+
+EYE_Y = {"cloud": 23, "triangle": 23, "drop": 25}
+EYE_X = (15.4, 24.6)
+# Shapes whose flat faces keep flat shading (bevels and curved parts stay smooth).
+FACETED = {"triangle", "hexagon"}
+
+
+def frame(outline):
+ """(bottom svg y, metres per symbol unit) of a shape's outline."""
+ ys = [y for _, y in outline]
+ return max(ys), 1 / (max(ys) - min(ys))
+
+
+def to_master(outline):
+ bottom, scale = frame(outline)
+ return Matrix.Scale(scale, 4) @ Matrix.Translation((-20, 0, bottom))
+
+
+def symbol_to_master(outline, sx, sy, depth=0.0):
+ """A symbol point (depth toward the viewer, symbol units) in master metres."""
+ bottom, scale = frame(outline)
+ return Vector(((sx - 20) * scale, -depth * scale, (bottom - sy) * scale))
+
+
+# --- solids in symbol units -----------------------------------------------------
+
+
+def quad_sphere(cuts):
+ bm = bmesh.new()
+ bmesh.ops.create_cube(bm, size=2)
+ bmesh.ops.subdivide_edges(bm, edges=bm.edges[:], cuts=cuts, use_grid_fill=True)
+ for vert in bm.verts:
+ vert.co.normalize()
+ return bm
+
+
+def superquadric(center, field, degree, cuts=18):
+ """A star-shaped solid: field(direction) is homogeneous of the given degree."""
+ bm = quad_sphere(cuts)
+ for vert in bm.verts:
+ direction = vert.co.copy()
+ vert.co = direction * field(direction) ** (-1 / degree) + center
+ return bm
+
+
+def revolve(profile, segments):
+ """Spin an (radius, svg y) profile, top to bottom, around the x=20 axis.
+
+ Vertex angles start at +X, so a six-segment spin turns a flat face to
+ the front (-Y) and its silhouette spans exactly twice the radius.
+ """
+ bm = bmesh.new()
+ rings = []
+ for radius, sy in profile:
+ if radius < 1e-6:
+ rings.append([bm.verts.new((20, 0, -sy))])
+ continue
+ rings.append(
+ [
+ bm.verts.new(
+ (
+ 20 + radius * math.cos(i / segments * math.tau),
+ radius * math.sin(i / segments * math.tau),
+ -sy,
+ )
+ )
+ for i in range(segments)
+ ]
+ )
+ for upper, lower in zip(rings, rings[1:], strict=False):
+ for i in range(segments):
+ j = (i + 1) % segments
+ if len(upper) == 1:
+ bm.faces.new((upper[0], lower[j], lower[i]))
+ elif len(lower) == 1:
+ bm.faces.new((upper[i], upper[j], lower[0]))
+ else:
+ bm.faces.new((upper[i], upper[j], lower[j], lower[i]))
+ bmesh.ops.recalc_face_normals(bm, faces=bm.faces)
+ return bm
+
+
+def soften(bm, offset, segments):
+ bmesh.ops.bevel(
+ bm,
+ geom=bm.edges[:] + bm.verts[:],
+ offset=offset,
+ segments=segments,
+ affect="EDGES",
+ profile=0.5,
+ clamp_overlap=True,
+ )
+
+
+def drop_profile():
+ """The SVG drop: a cubic shoulder from the tip, then a half-ellipse belly."""
+ points = []
+ p0, p1, p2, p3 = (0, 3), (0, 3), (14, 20), (14, 27)
+ for i in range(22):
+ t = i / 22
+ mt = 1 - t
+ points.append(
+ tuple(
+ mt**3 * a + 3 * mt * mt * t * b + 3 * mt * t * t * c + t**3 * d
+ for a, b, c, d in zip(p0, p1, p2, p3, strict=True)
+ )
+ )
+ for i in range(17):
+ phi = i / 16 * math.pi / 2
+ points.append((14 * math.cos(phi), 27 + 13.5 * math.sin(phi)))
+ points[-1] = (0, 40.5)
+ return points
+
+
+def pyramid(segments):
+ bm = bmesh.new()
+ apex = bm.verts.new((20, 0, -5.5))
+ corners = ((-1, -1), (1, -1), (1, 1), (-1, 1))
+ base = [bm.verts.new((20 + x * 16, y * 16, -33.5)) for x, y in corners]
+ bm.faces.new(base)
+ for i in range(4):
+ bm.faces.new((base[i], base[(i + 1) % 4], apex))
+ bmesh.ops.recalc_face_normals(bm, faces=bm.faces)
+ soften(bm, 2.6, segments)
+ return bm
+
+
+def crystal(segments):
+ bm = revolve([(0, 3.5), (14.5, 11.75), (14.5, 28.25), (0, 36.5)], 6)
+ soften(bm, 1.6, segments)
+ return bm
+
+
+def cloud(voxel):
+ """Three puffs plus a belly, fused by a voxel remesh and relaxed into soft seams."""
+ bm = bmesh.new()
+ lobes = [((10.5, 24.55), 7.5), ((19.5, 14.8), 9.78), ((29.5, 22.25), 9.76)]
+ pieces = [
+ superquadric(Vector((x, 0, -y)), lambda d, r=r: d.length_squared / (r * r), 2, cuts=10)
+ for (x, y), r in lobes
+ ]
+ pieces.append(
+ superquadric(
+ Vector((20, -0.8, -25.2)),
+ lambda d: (d.x / 13) ** 2 + (d.y / 9.6) ** 2 + (d.z / 6.8) ** 2,
+ 2,
+ cuts=10,
+ )
+ )
+ scratch = bpy.data.meshes.new("cloud.scratch")
+ for piece in pieces:
+ piece.to_mesh(scratch)
+ bm.from_mesh(scratch)
+ piece.free()
+ bm.to_mesh(scratch)
+ bm.free()
+ obj = bpy.data.objects.new("cloud.scratch", scratch)
+ bpy.context.collection.objects.link(obj)
+ remesh = obj.modifiers.new("Fuse", "REMESH")
+ remesh.mode = "VOXEL"
+ remesh.voxel_size = voxel
+ smooth = obj.modifiers.new("Soft seams", "SMOOTH")
+ smooth.factor = 0.8
+ smooth.iterations = 10
+ evaluated = obj.evaluated_get(bpy.context.evaluated_depsgraph_get())
+ fused = bmesh.new()
+ fused.from_mesh(evaluated.to_mesh())
+ evaluated.to_mesh_clear()
+ bpy.data.objects.remove(obj)
+ bpy.data.meshes.remove(scratch)
+ return fused
+
+
+def build_body(shape, outline, light=False):
+ """The shape's solid as a bmesh in master metres, smooth-flagged faces.
+
+ light=True builds a coarser copy of the same surface for clothing cut from
+ it: the patches float a few millimetres above the body, far more than the
+ coarser chords sink below it.
+ """
+ cuts = 9 if light else 18
+ if shape == "circle":
+ bm = superquadric(Vector((20, 0, -20)), lambda d: d.length_squared / 16.2**2, 2, cuts)
+ elif shape == "squircle":
+ bm = superquadric(
+ Vector((20, 0, -20)),
+ lambda d: (abs(d.x) ** 5 + abs(d.y / 0.92) ** 5 + abs(d.z) ** 5) / 16.2**5,
+ 5,
+ cuts,
+ )
+ elif shape == "pill":
+ bm = superquadric(
+ Vector((20, 0, -20)),
+ lambda d: ((d.y / 11.52) ** 2 + (d.z / 11.52) ** 2) ** 4 + (d.x / 16) ** 8,
+ 8,
+ cuts,
+ )
+ elif shape == "drop":
+ bm = revolve(drop_profile(), 24 if light else 48)
+ elif shape == "triangle":
+ bm = pyramid(3 if light else 6)
+ elif shape == "hexagon":
+ bm = crystal(3 if light else 5)
+ elif shape == "cloud":
+ bm = cloud(1.5 if light else 0.75)
+ else:
+ raise ValueError(f"unknown companion shape {shape!r}")
+ bmesh.ops.transform(bm, matrix=to_master(outline), verts=bm.verts)
+ bmesh.ops.recalc_face_normals(bm, faces=bm.faces)
+ for face in bm.faces:
+ face.smooth = True
+ bm.normal_update()
+ return bm
+
+
+# --- surface queries ------------------------------------------------------------
+
+
+class Surface:
+ """Ray queries against one body in master metres (front = -Y)."""
+
+ def __init__(self, bm):
+ self.tree = BVHTree.FromBMesh(bm)
+
+ def hit(self, x, z, front=True):
+ origin = Vector((x, -10 if front else 10, z))
+ location, normal, _, _ = self.tree.ray_cast(origin, Vector((0, 1 if front else -1, 0)))
+ return (location, normal) if location is not None else None
+
+ def depth(self, x, z, front=True):
+ """Distance of the front (or back) surface from the centre plane, or None."""
+ found = self.hit(x, z, front)
+ return None if found is None else -found[0].y
+
+ def depth_near(self, x, z, front=True):
+ """Surface depth at x, z; outside the silhouette, the nearest depth inward."""
+ for step in range(41):
+ value = self.depth(x * (1 - step / 40), z, front)
+ if value is not None:
+ return value
+ return 0.0