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.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(society): wearable accessories for agent symbols and map companions
rubenluetke10-beep223ea249fab4
diff --git a/art/studies/agent-symbol-companions/exports/accessories.glb b/art/studies/agent-symbol-companions/exports/accessories.glbnew file mode 100644index 0000000000..582e7c1585Binary files /dev/null and b/art/studies/agent-symbol-companions/exports/accessories.glb differdiff --git a/jarvis/society/companion.py b/jarvis/society/companion.pyindex 06522d0a5a..9fc01e76c0 100644--- a/jarvis/society/companion.py+++ b/jarvis/society/companion.py@@ -1,8 +1,13 @@"""Validated visual companion settings inside the existing avatar JSON envelope."""-from typing import Any, Literal+from typing import Annotated, Any, Literal-from pydantic import BaseModel, ConfigDict, Field+from pydantic import BaseModel, ConfigDict, Field, StringConstraints++# Mirrors ACCESSORY_SLOTS in the frontend catalog (parity test pins it). Item ids+# stay open-ended so a look saved by a newer build survives an older one.+AccessorySlot = Literal["back", "outfit", "neck", "mouth", "face", "head", "held"]+AccessoryId = Annotated[str, StringConstraints(pattern=r"^[a-z0-9_]{1,40}$")]class CompanionAppearance(BaseModel):@@ -14,6 +19,7 @@ class CompanionAppearance(BaseModel):color: str = Field(pattern=r"^#[0-9a-fA-F]{6}$")eyes: Literal["dots", "lines"] = "dots"enabled: bool = True+ accessories: dict[AccessorySlot, AccessoryId] = Field(default_factory=dict)sizeM: float = Field(default=0.5, ge=0.25, le=0.8)followDistanceM: float = Field(default=1.0, ge=0.5, le=2.0)@@ -22,5 +28,8 @@ def validate_avatar_companion(avatar: dict[str, Any]) -> dict[str, Any]:"""Preserve character/import fields verbatim; validate only our namespace."""if "companion" not in avatar:return avatar- companion = CompanionAppearance.model_validate(avatar["companion"])- return {**avatar, "companion": companion.model_dump()}+ companion = CompanionAppearance.model_validate(avatar["companion"]).model_dump()+ # A bare look stays byte-identical to what builds without accessories stored.+ if not companion["accessories"]:+ del companion["accessories"]+ return {**avatar, "companion": companion}diff --git a/jarvis/ui/web/frontend/src/assets/society/companions/accessories.glb b/jarvis/ui/web/frontend/src/assets/society/companions/accessories.glbnew file mode 100644index 0000000000..582e7c1585Binary files /dev/null and b/jarvis/ui/web/frontend/src/assets/society/companions/accessories.glb differdiff --git a/jarvis/ui/web/frontend/src/components/society/AgentSymbol.tsx b/jarvis/ui/web/frontend/src/components/society/AgentSymbol.tsxindex 8b71e6e829..ddf7e92c18 100644--- a/jarvis/ui/web/frontend/src/components/society/AgentSymbol.tsx+++ b/jarvis/ui/web/frontend/src/components/society/AgentSymbol.tsx@@ -8,7 +8,12 @@* without a SDK, JavaScript frame clock, model download or WebGL in the roster.*/+import { useId, useMemo, type ReactNode } from "react";import { defaultCompanion, companionEyeColors, type SymbolShape } from "./companion/appearance";+import {+ ACCESSORY_CATALOG, FACE_SLOTS, partDepth, resolveFill, smoothPath, symbolViewBox, wornAccessories,+ type AccessoryChoice, type AccessoryItem, type AccessoryPart,+} from "./companion/accessories";import "./agentSymbol.css";export type { SymbolShape } from "./companion/appearance";@@ -59,22 +64,81 @@ export function SymbolThinkingDots({ color }: { color: string }) {</g>;}+/** The front projection of one accessory part in symbol units. */+function AccessoryPartShape({ part, color }: { part: AccessoryPart; color: string }): ReactNode {+ const fill = resolveFill(part.fill, color);+ const spin = "c" in part && part.rot ? `rotate(${part.rot} ${part.c[0]} ${part.c[1]})` : undefined;+ switch (part.t) {+ case "sphere":+ return <ellipse cx={part.c[0]} cy={part.c[1]} rx={part.r[0]} ry={part.r[1]} fill={fill} transform={spin} />;+ case "dome": {+ const [cx, cy] = part.c; const [rx, ry] = part.r;+ return <path d={`M${cx - rx} ${cy} A${rx} ${ry} 0 0 1 ${cx + rx} ${cy}Z`} fill={fill} transform={spin} />;+ }+ case "box": {+ const [w, h] = part.s;+ return <rect x={part.c[0] - w / 2} y={part.c[1] - h / 2} width={w} height={h} rx={Math.min(part.round, w / 2, h / 2)} fill={fill} transform={spin} />;+ }+ case "cyl": {+ const [cx, cy] = part.c; const [rb, rt] = part.r; const h = part.h / 2;+ return <path d={`M${cx - rb} ${cy + h} L${cx + rb} ${cy + h} L${cx + rt} ${cy - h} L${cx - rt} ${cy - h}Z`} fill={fill} transform={spin} />;+ }+ case "torus":+ return <ellipse cx={part.c[0]} cy={part.c[1]} rx={part.R} ry={Math.max(part.R * Math.abs(Math.cos(part.tilt * Math.PI / 180)), 0.15)} fill="none" stroke={fill} strokeWidth={part.r * 2} transform={spin} />;+ case "poly":+ return part.smooth ? <path d={smoothPath(part.pts, true)} fill={fill} /> : <polygon points={part.pts.map(p => p.join(",")).join(" ")} fill={fill} />;+ case "tube": {+ const flat = part.pts.map(p => [p[0], p[1]] as [number, number]);+ const d = part.smooth ? smoothPath(flat, false) : `M${flat.map(p => p.join(" ")).join(" L")}`;+ return <path d={d} fill="none" stroke={fill} strokeWidth={part.w} strokeLinecap="round" strokeLinejoin="round" />;+ }+ case "region":+ return <polygon points={part.pts.map(p => p.join(",")).join(" ")} fill={fill} />;+ }+}++/** One worn item at its slot anchor: either its body patches or its free parts. */+function AccessoryItemShapes({ item, shape, color, regions }: { item: AccessoryItem; shape: SymbolShape; color: string; regions: boolean }) {+ const parts = item.parts.filter(part => (part.t === "region") === regions);+ if (!parts.length) return null;+ const [x, y, k] = ACCESSORY_CATALOG.shapes[shape].anchors[item.slot];+ // Paint back to front; body patches keep their authored layering.+ const ordered = regions ? parts : [...parts].sort((a, b) => partDepth(a) - partDepth(b));+ return <g data-accessory={item.id} transform={`translate(${x} ${y}) scale(${k})`}>+ {ordered.map((part, index) => <AccessoryPartShape key={index} part={part} color={color} />)}+ </g>;+}+/** Plain ink eyes share one resting gaze; only a working agent moves. */-export function AgentSymbol({ shape, color, size, eyes = "lines", thinking = false }: { shape: SymbolShape; color: string; size: number; eyes?: "dots" | "lines"; thinking?: boolean }) {+export function AgentSymbol({ shape, color, size, eyes = "lines", thinking = false, accessories }: { shape: SymbolShape; color: string; size: number; eyes?: "dots" | "lines"; thinking?: boolean; accessories?: AccessoryChoice }) {const eyeY = shape === "cloud" || shape === "triangle" ? 23 : shape === "drop" ? 25 : 17.2;const ink = companionEyeColors(color);+ const maskId = `agent-body-${useId().replace(/[^a-zA-Z0-9_-]/g, "")}`;+ const worn = useMemo(() => wornAccessories(accessories), [accessories]);+ const viewBox = useMemo(() => symbolViewBox(shape, worn), [shape, worn]);+ const draw = (items: AccessoryItem[], regions = false) => items.map(item => <AccessoryItemShapes key={item.id} item={item} shape={shape} color={color} regions={regions} />);+ const faceTransform = `translate(2 -0.6) rotate(-14 20 ${eyeY})`;+ const onFace = worn.filter(item => FACE_SLOTS.has(item.slot));return (- <svg aria-hidden focusable="false" data-agent-symbol={shape} data-thinking={thinking ? "true" : undefined} width={size} height={size} style={{ width: size, height: size, flexShrink: 0 }} viewBox="0 0 40 44" className="society-agent-symbol block">+ <svg aria-hidden focusable="false" data-agent-symbol={shape} data-thinking={thinking ? "true" : undefined} width={size} height={size} style={{ width: size, height: size, flexShrink: 0 }} viewBox={viewBox} className="society-agent-symbol block"><g className="agent-symbol-character">+ {draw(worn.filter(item => item.slot === "back"))}<g data-agent-body><SymbolBody shape={shape} color={color} /></g>+ {worn.some(item => item.regions) && <>+ <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>+ </>}+ {draw(worn.filter(item => item.slot === "outfit" || item.slot === "neck"))}<g className="agent-symbol-gaze">- <g data-agent-eyes fill={ink.eye} transform={`translate(2 -0.6) rotate(-14 20 ${eyeY})`}>+ <g data-agent-eyes fill={ink.eye} transform={faceTransform}><g className="agent-symbol-lids"><ellipse cx={15.4} cy={eyeY} rx={eyes === "lines" ? 1.45 : 2} ry={eyes === "lines" ? 3.1 : 2.3} /><ellipse cx={24.6} cy={eyeY} rx={eyes === "lines" ? 1.45 : 2} ry={eyes === "lines" ? 3.1 : 2.3} /></g></g>+ {onFace.length > 0 && <g transform={faceTransform}>{draw(onFace)}</g>}</g>+ {draw(worn.filter(item => item.slot === "head" || item.slot === "held"))}</g>{thinking && <SymbolThinkingDots color={color} />}</svg>diff --git a/jarvis/ui/web/frontend/src/components/society/companion/AccessoryPicker.tsx b/jarvis/ui/web/frontend/src/components/society/companion/AccessoryPicker.tsxnew file mode 100644index 0000000000..d972537590--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/companion/AccessoryPicker.tsx@@ -0,0 +1,56 @@+import { useState } from "react";+import { Shuffle, X } from "lucide-react";+import { useT } from "@/i18n";+import { AgentSymbol } from "../AgentSymbol";+import { ACCESSORY_IDS_BY_SLOT, randomAccessories, type AccessoryChoice, type AccessorySlot } from "./accessories";+import type { CompanionAppearance } from "./appearance";++/** Picker order: what people change most comes first. */+const PICKER_SLOTS: AccessorySlot[] = ["head", "face", "mouth", "neck", "outfit", "back", "held"];++/** One tile per item, each showing this agent already wearing it. */+export function AccessoryPicker({ value, onChange }: { value: CompanionAppearance; onChange: (next: AccessoryChoice) => void }) {+ const t = useT();+ const [slot, setSlot] = useState<AccessorySlot>("head");+ const worn = value.accessories;+ const choose = (id: string | undefined) => {+ const next = { ...worn };+ if (id) next[slot] = id; else delete next[slot];+ onChange(next);+ };+ const tile = "grid h-14 w-14 place-items-center rounded-lg border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";+ return <div data-testid="accessory-picker">+ <div className="mb-2 flex items-center justify-between gap-2">+ <span className="text-sm font-medium">{t("society.companion.accessories")}</span>+ <div className="flex gap-1">+ <button type="button" onClick={() => onChange(randomAccessories())} className="inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-secondary hover:text-foreground">+ <Shuffle size={14} />{t("society.companion.randomize")}+ </button>+ <button type="button" disabled={!Object.keys(worn).length} onClick={() => onChange({})} className="inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-secondary hover:text-foreground disabled:opacity-40">+ <X size={14} />{t("society.companion.remove_all")}+ </button>+ </div>+ </div>+ <div className="mb-3 flex flex-wrap gap-1.5" role="tablist" aria-label={t("society.companion.accessories")}>+ {PICKER_SLOTS.map(s => <button key={s} type="button" role="tab" aria-selected={slot === s} onClick={() => setSlot(s)}+ className={`relative rounded-full border px-2.5 py-1 text-xs ${slot === s ? "border-transparent bg-primary text-primary-foreground" : "border-border bg-background text-foreground hover:bg-secondary"}`}>+ {t(`society.companion.slots.${s}`)}+ {worn[s] && <span aria-hidden className="ml-1.5 inline-block h-1.5 w-1.5 rounded-full bg-current align-middle" />}+ </button>)}+ </div>+ <div className="flex flex-wrap gap-2" role="group" aria-label={t(`society.companion.slots.${slot}`)}>+ <button type="button" aria-pressed={!worn[slot]} aria-label={t("society.companion.none")} title={t("society.companion.none")} onClick={() => choose(undefined)}+ className={`${tile} text-xs text-muted-foreground ${!worn[slot] ? "border-foreground bg-secondary" : "border-border hover:bg-secondary"}`}>+ {t("society.companion.none")}+ </button>+ {ACCESSORY_IDS_BY_SLOT[slot].map(id => {+ const label = t(`society.companion.items.${id}`);+ const active = worn[slot] === id;+ return <button key={id} type="button" aria-pressed={active} aria-label={label} title={label} onClick={() => choose(id)}+ className={`${tile} ${active ? "border-foreground bg-secondary" : "border-border hover:bg-secondary"}`}>+ <AgentSymbol shape={value.shape} color={value.color} eyes={value.eyes} accessories={{ ...worn, [slot]: id }} size={46} />+ </button>;+ })}+ </div>+ </div>;+}diff --git a/jarvis/ui/web/frontend/src/components/society/companion/AgentFollower.tsx b/jarvis/ui/web/frontend/src/components/society/companion/AgentFollower.tsxindex cb18f795c4..76b5cd153e 100644--- a/jarvis/ui/web/frontend/src/components/society/companion/AgentFollower.tsx+++ b/jarvis/ui/web/frontend/src/components/society/companion/AgentFollower.tsx@@ -1,10 +1,12 @@import { Component, Suspense, useEffect, useMemo, useRef, type ReactNode, type RefObject } from "react";import { useGLTF } from "@react-three/drei";import { useFrame, useThree } from "@react-three/fiber";-import { Group, Mesh, MeshStandardMaterial, Vector3 } from "three";+import { Group, Mesh, MeshStandardMaterial, Vector3, type Material } from "three";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 { companionEyeColors, type CompanionAppearance } from "./appearance";import { advancePetTrail, createPetTrail, petDisplayPosition, recordOwner, type PetTrail, type TrailPoint } from "./trail";@@ -41,8 +43,52 @@ export function CompanionModel({ appearance, lead = false }: { appearance: Compareturn { model, materials };}, [scene, lead, appearance.shape, appearance.color, appearance.eyes]);useEffect(() => () => { instance.materials.forEach(material => material.dispose()); }, [instance]);+ const wearing = !lead && wornAccessories(appearance.accessories).length > 0;// Gigi's authored body is 0.4 m; the symbol master is exactly 1 m.- return <primitive object={instance.model} scale={appearance.sizeM / (lead ? 0.4 : 1)} dispose={null} />;+ return <group scale={appearance.sizeM / (lead ? 0.4 : 1)}>+ <primitive object={instance.model} dispose={null} />+ {/* Accessories load on their own, so a missing asset never hides the companion. */}+ {wearing && <PetBoundary><Suspense fallback={null}><CompanionAccessories appearance={appearance} /></Suspense></PetBoundary>}+ </group>;+}++/** Worn items from the shared catalog, placed on the 1 m symbol master. */+function CompanionAccessories({ appearance }: { appearance: CompanionAppearance }) {+ const { scene } = useGLTF(accessoryModels);+ const instance = useMemo(() => {+ const group = new Group();+ const materials: Material[] = [];+ 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}`);+ 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.rotation.set(0, 0, 0);+ node.scale.setScalar(k * unit);+ group.add(node);+ }+ // Clothing is authored per silhouette, already in the master's frame.+ const patch = item.regions ? scene.getObjectByName(`acc_${item.id}__${appearance.shape}`) : undefined;+ if (patch) group.add(patch.clone(true));+ }+ group.traverse(object => {+ const mesh = object as Mesh;+ if (!mesh.isMesh) return;+ mesh.castShadow = true;+ const source = mesh.material as MeshStandardMaterial;+ const own = source.clone();+ const token = source.name.split(":")[1] ?? "";+ if (token && !token.startsWith("#")) own.color.set(resolveFill(token, appearance.color));+ mesh.material = own;+ materials.push(own);+ });+ return { group, materials };+ }, [scene, appearance.shape, appearance.color, appearance.accessories]);+ useEffect(() => () => { instance.materials.forEach(material => material.dispose()); }, [instance]);+ return <primitive object={instance.group} dispose={null} />;}/** Sibling of the character: world-space footsteps never inherit its rotation. */diff --git a/jarvis/ui/web/frontend/src/components/society/companion/CompanionEditor.tsx b/jarvis/ui/web/frontend/src/components/society/companion/CompanionEditor.tsxindex 01ea59251c..a7874271cb 100644--- a/jarvis/ui/web/frontend/src/components/society/companion/CompanionEditor.tsx+++ b/jarvis/ui/web/frontend/src/components/society/companion/CompanionEditor.tsx@@ -2,6 +2,7 @@ import { useT } from "@/i18n";import { Switch } from "@/components/ui/switch";import { BrandedSelect } from "@/components/ui/select";import { AgentSymbol } from "../AgentSymbol";+import { AccessoryPicker } from "./AccessoryPicker";import { COMPANION_COLORS, COMPANION_SHAPES, type CompanionAppearance } from "./appearance";import gigiMark from "@/assets/gigi-companion-avatar.png";import { lazy, Suspense } from "react";@@ -22,7 +23,7 @@ export function CompanionEditor({ value, onChange, disabled = false, lead = fals<div className="flex flex-wrap gap-2">{COMPANION_SHAPES.map(shape => <button key={shape} type="button"aria-label={t(`society.companion.shapes.${shape}`)} aria-pressed={value.shape === shape}onClick={() => update({ shape })} className={`grid h-12 w-12 place-items-center rounded-lg border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${value.shape === shape ? "border-foreground bg-secondary" : "border-border hover:bg-secondary"}`}>- <AgentSymbol shape={shape} color={value.color} eyes={value.eyes} size={36} />+ <AgentSymbol shape={shape} color={value.color} eyes={value.eyes} accessories={value.accessories} size={36} /></button>)}</div></div><div><span className="mb-2 block text-sm font-medium">{t("society.companion.color")}</span>@@ -36,6 +37,7 @@ export function CompanionEditor({ value, onChange, disabled = false, lead = falsdisabled={disabled} value={value.eyes} onValueChange={eyes => update({ eyes: eyes as CompanionAppearance["eyes"] })}options={[{ value: "dots", label: t("society.companion.dots") }, { value: "lines", label: t("society.companion.lines") }]} /></div>+ <AccessoryPicker value={value} onChange={accessories => update({ accessories })} /></>}<label className="flex items-center justify-between gap-3 text-sm">{t("society.companion.visible")}<Switch checked={value.enabled} onCheckedChange={enabled => update({ enabled })} aria-label={t("society.companion.visible")} />diff --git a/jarvis/ui/web/frontend/src/components/society/companion/accessories.json b/jarvis/ui/web/frontend/src/components/society/companion/accessories.jsonnew file mode 100644index 0000000000..e714a54233--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/companion/accessories.json@@ -0,0 +1 @@+{"schema":1,"slots":["back","outfit","neck","mouth","face","head","held"],"slotDepth":{"back":-1,"outfit":1,"neck":1,"mouth":1,"face":1,"head":0,"held":0.4},"frontDepthM":0.25,"shapes":{"circle":{"top":3.8,"bottom":36.2,"eyeY":17.2,"anchors":{"head":[20,5.2,1],"neck":[20,27.6,1],"held":[33.5,29,1.35],"back":[20,20,1],"face":[20,17.2,1],"mouth":[20,24.0,1.15],"outfit":[20,27.6,1]}},"squircle":{"top":3.8,"bottom":36.2,"eyeY":17.2,"anchors":{"head":[20,4.4,1],"neck":[20,27.6,1],"held":[34,29,1.35],"back":[20,20,1],"face":[20,17.2,1],"mouth":[20,24.0,1.15],"outfit":[20,27.6,1]}},"pill":{"top":8.48,"bottom":31.52,"eyeY":17.2,"anchors":{"head":[20,9.6,0.95],"neck":[20,26.2,0.92],"held":[35.5,26,1.282],"back":[20,20,0.95],"face":[20,17.2,1],"mouth":[20,24.0,1.15],"outfit":[20,26.2,0.92]}},"triangle":{"top":5.5,"bottom":33.5,"eyeY":23,"anchors":{"head":[20,8.6,0.72],"neck":[20,30.4,0.8],"held":[32.5,31,1.215],"back":[20,22,0.9],"face":[20,23,0.9],"mouth":[20,29.12,1.035],"outfit":[20,30.4,0.8]}},"hexagon":{"top":3.5,"bottom":36.5,"eyeY":17.2,"anchors":{"head":[20,5.8,0.9],"neck":[20,27.6,0.95],"held":[33,29,1.282],"back":[20,20,0.95],"face":[20,17.2,1],"mouth":[20,24.0,1.15],"outfit":[20,27.6,0.95]}},"cloud":{"top":5.028,"bottom":32,"eyeY":23,"anchors":{"head":[19.2,6.6,0.95],"neck":[20,30,0.8],"held":[37,27.5,1.215],"back":[21,20,1],"face":[20,23,0.9],"mouth":[20,29.12,1.035],"outfit":[20,30,0.8]}},"drop":{"top":3,"bottom":40.5,"eyeY":25,"anchors":{"head":[20,9.6,0.72],"neck":[20,33.8,0.92],"held":[32.5,34,1.282],"back":[20,25,0.95],"face":[20,25,1],"mouth":[20,31.8,1.15],"outfit":[20,33.8,0.92]}}},"items":[{"id":"crown","slot":"head","bounds":[-10.59,-11.45,10.59,0.2],"regions":false,"parts":[{"t":"cyl","c":[0,-2,0],"r":[8,8.6],"h":4.4,"dz":1.0,"fill":"#f2c14e"},{"t":"cyl","c":[0.0,-6.8,8.3],"r":[2.7,0],"h":6.2,"dz":1.0,"fill":"#f2c14e"},{"t":"sphere","c":[0.0,-10.4,8.3],"r":[1.05,1.05,1.05],"fill":"#f2c14e"},{"t":"cyl","c":[7.894,-6.8,2.565],"r":[2.7,0],"h":6.2,"dz":1.0,"fill":"#f2c14e"},{"t":"sphere","c":[7.894,-10.4,2.565],"r":[1.05,1.05,1.05],"fill":"#f2c14e"},{"t":"cyl","c":[4.879,-6.8,-6.715],"r":[2.7,0],"h":6.2,"dz":1.0,"fill":"#f2c14e"},{"t":"sphere","c":[4.879,-10.4,-6.715],"r":[1.05,1.05,1.05],"fill":"#f2c14e"},{"t":"cyl","c":[-4.879,-6.8,-6.715],"r":[2.7,0],"h":6.2,"dz":1.0,"fill":"#f2c14e"},{"t":"sphere","c":[-4.879,-10.4,-6.715],"r":[1.05,1.05,1.05],"fill":"#f2c14e"},{"t":"cyl","c":[-7.894,-6.8,2.565],"r":[2.7,0],"h":6.2,"dz":1.0,"fill":"#f2c14e"},{"t":"sphere","c":[-7.894,-10.4,2.565],"r":[1.05,1.05,1.05],"fill":"#f2c14e"},{"t":"sphere","c":[0,-2,8.7],"r":[1.6,1.6,0.8],"fill":"#e0483e"},{"t":"sphere","c":[-5.2,-2,6.9],"r":[1.1,1.1,0.6],"fill":"#2f6fe0"},{"t":"sphere","c":[5.2,-2,6.9],"r":[1.1,1.1,0.6],"fill":"#2f6fe0"}]},{"id":"top_hat","slot":"head","bounds":[-12.07,-15.17,11.92,1.56],"regions":false,"parts":[{"t":"cyl","c":[-0.073,-0.596,0],"r":[12,12],"h":1.4,"dz":1.0,"fill":"#2a2a31","rot":-7.0},{"t":"cyl","c":[-0.951,-7.742,0],"r":[7.6,8],"h":13,"dz":1.0,"fill":"#33333b","rot":-7.0},{"t":"cyl","c":[-0.317,-2.581,0],"r":[7.85,7.9],"h":2.8,"dz":1.0,"fill":"body","rot":-7.0}]},{"id":"party_hat","slot":"head","bounds":[-6.43,-17.47,6.43,1.48],"regions":false,"parts":[{"t":"cyl","c":[1.687,-7.308,0],"r":[6.6,0],"h":15,"dz":1.0,"fill":"#f472b6","rot":13.0},{"t":"sphere","c":[-0.839,-3.478,4.6],"r":[1.1,1.1,0.5],"fill":"#fde047","rot":13.0},{"t":"sphere","c":[3.373,-3.942,3.6],"r":[1,1,0.5],"fill":"#22d3ee","rot":13.0},{"t":"sphere","c":[1.26,-8.125,2.6],"r":[0.9,0.9,0.5],"fill":"#a78bfa","rot":13.0},{"t":"sphere","c":[3.509,-15.2,0],"r":[2.3,2.3,2.3],"fill":"#fde047","rot":13.0}]},{"id":"cap","slot":"head","bounds":[-9.2,-7.6,9.2,3.3],"regions":false,"parts":[{"t":"dome","c":[0,1.6,0],"r":[9.2,8,9.2],"fill":"#2f6fe0"},{"t":"sphere","c":[0,1.9,8.2],"r":[8.8,1.4,6.2],"fill":"#1f4fb0"},{"t":"sphere","c":[0,-6.4,0],"r":[1.2,1.2,1.2],"fill":"#1f4fb0"}]},{"id":"beanie","slot":"head","bounds":[-10.0,-11.4,10.0,4.4],"regions":false,"parts":[{"t":"dome","c":[0,2.2,0],"r":[9.6,9.8,9.6],"fill":"#e0483e"},{"t":"cyl","c":[0,2.4,0],"r":[10,10],"h":4,"dz":1.0,"fill":"#a8322b"},{"t":"sphere","c":[0,-8.4,0],"r":[3,3,3],"fill":"#f5f0e6"}]},{"id":"cowboy_hat","slot":"head","bounds":[-16.23,-9.47,16.04,2.04],"regions":false,"parts":[{"t":"sphere","c":[0.017,0.199,0],"r":[15,1.3,12],"fill":"#a8692e","rot":-5.0},{"t":"sphere","c":[-13.843,0.107,0],"r":[2.4,1.7,5],"fill":"#a8692e","rot":-5.0},{"t":"sphere","c":[13.652,-2.299,0],"r":[2.4,1.7,5],"fill":"#a8692e","rot":-5.0},{"t":"cyl","c":[-0.401,-4.582,0],"r":[6.9,5.8],"h":8.8,"dz":1.0,"fill":"#b8773a","rot":-5.0},{"t":"cyl","c":[-0.139,-1.594,0],"r":[6.8,6.6],"h":1.8,"dz":1.0,"fill":"#3b2414","rot":-5.0}]},{"id":"wizard_hat","slot":"head","bounds":[-12.8,-20.09,12.8,2.58],"regions":false,"parts":[{"t":"sphere","c":[0.0,0.0,0],"r":[13,1.3,11],"fill":"#4c2a96","rot":-10.0},{"t":"cyl","c":[-1.771,-10.045,0],"r":[7.8,0],"h":20.4,"dz":1.0,"fill":"#5b35b8","rot":-10.0},{"t":"cyl","c":[-0.278,-1.576,0],"r":[7.3,7.0],"h":1.8,"dz":1.0,"fill":"#f2c14e","rot":-10.0},{"t":"poly","pts":[[-0.323,-9.894],[0.475,-8.582],[2.001,-8.76],[1.0,-7.595],[1.642,-6.199],[0.224,-6.792],[-0.905,-5.75],[-0.78,-7.282],[-2.12,-8.034],[-0.624,-8.388]],"z":4.4,"d":0.6,"smooth":false,"fill":"#f2c14e","glow":true},{"t":"sphere","c":[-3.926,-11.899,1.8],"r":[0.6,0.6,0.6],"fill":"#f2c14e","glow":true,"rot":-10.0},{"t":"sphere","c":[0.122,-4.489,6.2],"r":[0.5,0.5,0.5],"fill":"#f2c14e","glow":true,"rot":-10.0}]},{"id":"halo","slot":"head","bounds":[-9.15,-11.02,9.15,-3.78],"regions":false,"parts":[{"t":"torus","c":[0,-7.4,0],"R":8,"r":1.15,"tilt":72,"fill":"#fde68a","glow":true}]},{"id":"viking_helmet","slot":"head","bounds":[-15.74,-8.4,15.74,3.6],"regions":false,"parts":[{"t":"dome","c":[0,2,0],"r":[9.8,8.8,9.8],"fill":"#9aa3ad"},{"t":"cyl","c":[0,2.2,0],"r":[10.1,10.1],"h":2.8,"dz":1.0,"fill":"#a77b2c"},{"t":"sphere","c":[-4.6,2.2,9],"r":[0.7,0.7,0.7],"fill":"#e7d39a"},{"t":"sphere","c":[0,2.2,10.1],"r":[0.7,0.7,0.7],"fill":"#e7d39a"},{"t":"sphere","c":[4.6,2.2,9],"r":[0.7,0.7,0.7],"fill":"#e7d39a"},{"t":"tube","pts":[[0,-2,0],[-0.4,-5,0],[-0.8,-8,0]],"w":0.8,"smooth":false,"fill":"#a77b2c"},{"t":"cyl","c":[12.972,-4.214,0],"r":[2.5,0.3],"h":9,"dz":1.0,"fill":"#efe4cc","rot":34.0},{"t":"cyl","c":[-12.972,-4.214,0],"r":[2.5,0.3],"h":9,"dz":1.0,"fill":"#efe4cc","rot":-34.0}]},{"id":"chef_hat","slot":"head","bounds":[-10.2,-16.7,10.2,1.1],"regions":false,"parts":[{"t":"cyl","c":[0,-1.2,0],"r":[8.2,8.8],"h":4.6,"dz":1.0,"fill":"#fafaf8"},{"t":"sphere","c":[-4.8,-7.8,0],"r":[5.4,5.4,5.4],"fill":"#f4f4f0"},{"t":"sphere","c":[4.8,-7.8,0],"r":[5.4,5.4,5.4],"fill":"#f4f4f0"},{"t":"sphere","c":[0,-10.6,0],"r":[6.1,6.1,6.1],"fill":"#fafaf8"},{"t":"cyl","c":[0,0.6,0],"r":[8.3,8.3],"h":0.8,"dz":1.0,"fill":"#e4e2dc"}]},{"id":"grad_cap","slot":"head","bounds":[-10.5,-7.4,11.9,3.0],"regions":false,"parts":[{"t":"cyl","c":[0,-2.4,0],"r":[7.6,7.8],"h":5,"dz":1.0,"fill":"#374151"},{"t":"box","c":[0,-5.6,0],"s":[21,2.2,21],"round":0.4,"fill":"#2b3445"},{"t":"sphere","c":[0,-6.5,0],"r":[0.9,0.9,0.9],"fill":"#f2c14e"},{"t":"tube","pts":[[0,-6.4,0.6],[8,-6.4,6],[10.4,-4.6,7.6],[10.6,0.2,7.6]],"w":0.8,"smooth":true,"fill":"#f2c14e"},{"t":"cyl","c":[10.6,1.6,7.6],"r":[1.3,0.5],"h":2.8,"dz":1.0,"fill":"#f2c14e"}]},{"id":"headphones","slot":"head","bounds":[-15.8,-9.3,15.8,11.7],"regions":false,"parts":[{"t":"tube","pts":[[-12.6,6,0],[-11.8,-1.6,0],[-6.6,-6.8,0],[0,-8.2,0],[6.6,-6.8,0],[11.8,-1.6,0],[12.6,6,0]],"w":2.2,"smooth":true,"fill":"#26262b"},{"t":"sphere","c":[-13,7.2,0],"r":[2.8,4.5,4.4],"fill":"#e0483e"},{"t":"sphere","c":[13,7.2,0],"r":[2.8,4.5,4.4],"fill":"#e0483e"}]},{"id":"bunny_ears","slot":"head","bounds":[-9.91,-14.62,9.91,2.05],"regions":false,"parts":[{"t":"poly","pts":[[8.174,-14.616],[9.913,-12.367],[9.688,-6.056],[6.996,2.046],[4.463,1.462],[1.929,0.877],[3.062,-7.585],[5.626,-13.357]],"z":0,"d":2.4,"smooth":true,"fill":"#f5f3f0"},{"t":"poly","pts":[[7.634,-12.277],[8.444,-10.448],[7.994,-5.831],[6.292,-0.682],[5.025,-0.974],[3.758,-1.267],[4.486,-6.641],[6.105,-10.988]],"z":1.3,"d":0.6,"smooth":true,"fill":"#f9a8d4"},{"t":"poly","pts":[[-5.626,-13.357],[-3.062,-7.585],[-1.929,0.877],[-4.463,1.462],[-6.996,2.046],[-9.688,-6.056],[-9.913,-12.367],[-8.174,-14.616]],"z":0,"d":2.4,"smooth":true,"fill":"#f5f3f0"},{"t":"poly","pts":[[-6.105,-10.988],[-4.486,-6.641],[-3.758,-1.267],[-5.025,-0.974],[-6.292,-0.682],[-7.994,-5.831],[-8.444,-10.448],[-7.634,-12.277]],"z":1.3,"d":0.6,"smooth":true,"fill":"#f9a8d4"}]},{"id":"cat_ears","slot":"head","bounds":[-11.39,-9.5,11.39,3.95],"regions":false,"parts":[{"t":"poly","pts":[[0.932,0.552],[8.193,-9.496],[11.394,3.951]],"z":0,"d":2.6,"smooth":false,"fill":"body"},{"t":"poly","pts":[[3.838,0.024],[7.271,-6.011],[8.974,1.693]],"z":1.5,"d":0.6,"smooth":false,"fill":"#f9a8d4"},{"t":"poly","pts":[[-11.394,3.951],[-8.193,-9.496],[-0.932,0.552]],"z":0,"d":2.6,"smooth":false,"fill":"body"},{"t":"poly","pts":[[-8.974,1.693],[-7.271,-6.011],[-3.838,0.024]],"z":1.5,"d":0.6,"smooth":false,"fill":"#f9a8d4"}]},{"id":"devil_horns","slot":"head","bounds":[-8.26,-6.58,8.26,1.18],"regions":false,"parts":[{"t":"cyl","c":[6.874,-3.152,0],"r":[2.4,0],"h":7.4,"dz":1.0,"fill":"#d42f2f","rot":22.0},{"t":"cyl","c":[-6.874,-3.152,0],"r":[2.4,0],"h":7.4,"dz":1.0,"fill":"#d42f2f","rot":-22.0}]},{"id":"flower","slot":"head","bounds":[-11.66,-6.0,-0.2,4.8],"regions":false,"parts":[{"t":"sphere","c":[-6.4,-3.5,2.6],"r":[2.5,2.5,1.3],"fill":"#f9a8d4"},{"t":"sphere","c":[-3.642,-1.496,2.6],"r":[2.5,2.5,1.3],"fill":"#f9a8d4"},{"t":"sphere","c":[-4.695,1.746,2.6],"r":[2.5,2.5,1.3],"fill":"#f9a8d4"},{"t":"sphere","c":[-8.105,1.746,2.6],"r":[2.5,2.5,1.3],"fill":"#f9a8d4"},{"t":"sphere","c":[-9.158,-1.496,2.6],"r":[2.5,2.5,1.3],"fill":"#f9a8d4"},{"t":"sphere","c":[-6.4,-0.6,3.4],"r":[1.7,1.7,1],"fill":"#fde047"},{"t":"poly","pts":[[-5.4,1.8],[-2.681,1.291],[-0.204,4.8],[-4.042,4.247]],"z":1.6,"d":0.6,"smooth":true,"fill":"#5fae3a"}]},{"id":"antennae","slot":"head","bounds":[-8.45,-11.78,8.45,2.01],"regions":false,"parts":[{"t":"tube","pts":[[3.437,1.455,0],[5.832,-8.15,0]],"w":1.1,"smooth":false,"fill":"#3f3f46"},{"t":"sphere","c":[6.171,-9.509,0],"r":[2.3,2.3,2.3],"fill":"#a3e635","glow":true,"rot":14.0},{"t":"tube","pts":[[-3.437,1.455,0],[-5.832,-8.15,0]],"w":1.1,"smooth":false,"fill":"#3f3f46"},{"t":"sphere","c":[-6.171,-9.509,0],"r":[2.3,2.3,2.3],"fill":"#a3e635","glow":true,"rot":-14.0}]},{"id":"propeller_cap","slot":"head","bounds":[-9.4,-10.45,9.4,2.9],"regions":false,"parts":[{"t":"dome","c":[0,1.8,0],"r":[9.2,7.8,9.2],"fill":"#f43f5e"},{"t":"cyl","c":[0,2,0],"r":[9.4,9.4],"h":1.8,"dz":1.0,"fill":"#facc15"},{"t":"tube","pts":[[0,-5.6,0],[0,-8.8,0]],"w":1,"smooth":false,"fill":"#3f3f46"},{"t":"box","c":[0,-9.2,0],"s":[17.4,1.1,3.2],"round":0.5,"fill":"#3b82f6"},{"t":"sphere","c":[0,-9.2,0],"r":[1.25,1.25,1.25],"fill":"#facc15"}]},{"id":"santa_hat","slot":"head","bounds":[-9.8,-15.3,9.8,3.5],"regions":false,"parts":[{"t":"cyl","c":[2.2,-6.2,0],"r":[8.6,0.6],"h":13,"dz":1.0,"fill":"#d42f2f","rot":22},{"t":"cyl","c":[0,1.6,0],"r":[9.8,9.8],"h":3.8,"dz":1.0,"fill":"#fafafa"},{"t":"sphere","c":[4.8,-12.6,0],"r":[2.7,2.7,2.7],"fill":"#fafafa"}]},{"id":"bow","slot":"head","bounds":[-0.47,-3.94,12.98,3.48],"regions":false,"parts":[{"t":"sphere","c":[3.132,-1.337,0],"r":[3.6,2.6,1.6],"fill":"#ec4899","rot":-2},{"t":"sphere","c":[9.668,0.537,0],"r":[3.6,2.6,1.6],"fill":"#ec4899","rot":34},{"t":"sphere","c":[6.4,-0.4,0.8],"r":[1.5,1.7,1.2],"fill":"#be185d","rot":16.0}]},{"id":"sprout","slot":"head","bounds":[-6.06,-9.7,5.2,2.05],"regions":false,"parts":[{"t":"tube","pts":[[0,1.5,0],[0.4,-3,0],[0,-6.4,0]],"w":1.1,"smooth":true,"fill":"#5fae3a"},{"t":"poly","pts":[[0.0,-6.2],[-3.222,-5.52],[-6.062,-9.7],[-1.545,-9.124]],"z":0,"d":0.8,"smooth":true,"fill":"#84cc16"},{"t":"poly","pts":[[0.0,-6.2],[0.819,-8.982],[5.196,-9.2],[2.878,-6.014]],"z":0,"d":0.8,"smooth":true,"fill":"#84cc16"}]},{"id":"pirate_hat","slot":"head","bounds":[-14.32,-9.82,14.41,1.6],"regions":false,"parts":[{"t":"poly","pts":[[-14.323,1.603],[-12.76,-4.721],[-7.04,-8.931],[-0.586,-8.38],[5.729,-9.824],[11.979,-6.451],[14.407,-0.406],[6.287,-1.843],[-0.07,-0.998],[-6.482,-0.95]],"z":0,"d":8,"smooth":true,"fill":"#34343e"},{"t":"tube","pts":[[-13.766,0.963,4.1],[-6.51,-1.349,4.1],[-0.098,-1.397,4.1],[6.259,-2.242,4.1],[13.766,-0.963,4.1]],"w":0.9,"smooth":true,"fill":"#f2c14e"},{"t":"sphere","c":[-0.349,-4.988,4.3],"r":[2.3,2.1,0.6],"fill":"#f4f4f5","rot":-4.0},{"t":"box","c":[-0.195,-2.793,4.3],"s":[2,1.2,0.6],"round":0.3,"fill":"#f4f4f5","rot":-4.0},{"t":"sphere","c":[-1.161,-5.132,4.9],"r":[0.5,0.5,0.5],"fill":"#101014","rot":-4.0},{"t":"sphere","c":[0.435,-5.243,4.9],"r":[0.5,0.5,0.5],"fill":"#101014","rot":-4.0}]},{"id":"sweatband","slot":"head","bounds":[0,0,0,0],"regions":true,"parts":[{"t":"region","pts":[[-60,1.2],[60,1.2],[60,4.4],[-60,4.4]],"mode":"wrap","fill":"#e0483e"},{"t":"region","pts":[[-60,2.4],[60,2.4],[60,3.2],[-60,3.2]],"mode":"front","fill":"#fafafa"}]},{"id":"sunglasses","slot":"face","bounds":[-8.7,-2.6,8.7,3.0],"regions":false,"parts":[{"t":"box","c":[4.9,0.2,0.9],"s":[7.6,5.6,1.2],"round":2.2,"fill":"#121216"},{"t":"tube","pts":[[2.7,-1.0,1.6],[4.0,-2.0,1.6]],"w":0.7,"smooth":false,"fill":"#e7e7ea"},{"t":"box","c":[-4.9,0.2,0.9],"s":[7.6,5.6,1.2],"round":2.2,"fill":"#121216"},{"t":"tube","pts":[[-2.7,-1.0,1.6],[-4.0,-2.0,1.6]],"w":0.7,"smooth":false,"fill":"#e7e7ea"},{"t":"tube","pts":[[-1.3,-0.6,0.8],[0,-1.3,0.8],[1.3,-0.6,0.8]],"w":0.9,"smooth":true,"fill":"#121216"}]},{"id":"round_glasses","slot":"face","bounds":[-9.05,-4.15,9.05,4.15],"regions":false,"parts":[{"t":"torus","c":[4.9,0.0,0.7],"R":3.6,"r":0.55,"tilt":0.0,"fill":"#b07a2a"},{"t":"torus","c":[-4.9,0.0,0.7],"R":3.6,"r":0.55,"tilt":0.0,"fill":"#b07a2a"},{"t":"tube","pts":[[-1.3,-0.6,0.8],[0,-1.3,0.8],[1.3,-0.6,0.8]],"w":0.75,"smooth":true,"fill":"#b07a2a"}]},{"id":"monocle","slot":"face","bounds":[0.15,-4.65,9.62,9.82],"regions":false,"parts":[{"t":"torus","c":[4.8,0,0.8],"R":4,"r":0.65,"tilt":0.0,"fill":"#f2c14e"},{"t":"tube","pts":[[8.4,1.6,0.7],[9.4,5.4,0.5],[8.2,9.6,0.3]],"w":0.45,"smooth":true,"fill":"#f2c14e"}]},{"id":"eye_patch","slot":"face","bounds":[-14.4,-6.8,14.4,3.7],"regions":false,"parts":[{"t":"sphere","c":[-4.8,0.2,0.7],"r":[3.9,3.5,0.6],"fill":"#18181b"},{"t":"tube","pts":[[-14,2.6,-1],[-8.6,0.4,0.5],[-4.8,-1,1],[0,-3.4,0.6],[7,-5.6,0.3],[14,-6.4,-1]],"w":0.8,"smooth":true,"fill":"#18181b"}]},{"id":"star_glasses","slot":"face","bounds":[-9.67,-4.7,9.67,3.8],"regions":false,"parts":[{"t":"poly","pts":[[5.2,-4.7],[6.552,-1.861],[9.67,-1.452],[7.387,0.711],[7.963,3.802],[5.2,2.3],[2.437,3.802],[3.013,0.711],[0.73,-1.452],[3.848,-1.861]],"z":0.9,"d":0.9,"smooth":false,"fill":"#facc15"},{"t":"poly","pts":[[-3.848,-1.861],[-0.73,-1.452],[-3.013,0.711],[-2.437,3.802],[-5.2,2.3],[-7.963,3.802],[-7.387,0.711],[-9.67,-1.452],[-6.552,-1.861],[-5.2,-4.7]],"z":0.9,"d":0.9,"smooth":false,"fill":"#facc15"},{"t":"tube","pts":[[-1.3,-0.6,0.8],[0,-1.3,0.8],[1.3,-0.6,0.8]],"w":0.9,"smooth":true,"fill":"#facc15"}]},{"id":"heart_glasses","slot":"face","bounds":[-9.43,-2.77,9.43,5.06],"regions":false,"parts":[{"t":"poly","pts":[[5.1,-0.893],[5.148,-1.159],[5.454,-1.806],[6.149,-2.468],[7.169,-2.766],[8.266,-2.498],[9.112,-1.71],[9.429,-0.622],[9.112,0.53],[8.266,1.61],[7.169,2.596],[6.149,3.502],[5.454,4.292],[5.148,4.854],[5.1,5.06],[5.052,4.854],[4.746,4.292],[4.051,3.502],[3.031,2.596],[1.934,1.61],[1.088,0.53],[0.771,-0.622],[1.088,-1.71],[1.934,-2.498],[3.031,-2.766],[4.051,-2.468],[4.746,-1.806],[5.052,-1.159]],"z":0.9,"d":0.9,"smooth":true,"fill":"#ef4444"},{"t":"poly","pts":[[-5.052,-1.159],[-4.746,-1.806],[-4.051,-2.468],[-3.031,-2.766],[-1.934,-2.498],[-1.088,-1.71],[-0.771,-0.622],[-1.088,0.53],[-1.934,1.61],[-3.031,2.596],[-4.051,3.502],[-4.746,4.292],[-5.052,4.854],[-5.1,5.06],[-5.148,4.854],[-5.454,4.292],[-6.149,3.502],[-7.169,2.596],[-8.266,1.61],[-9.112,0.53],[-9.429,-0.622],[-9.112,-1.71],[-8.266,-2.498],[-7.169,-2.766],[-6.149,-2.468],[-5.454,-1.806],[-5.148,-1.159],[-5.1,-0.893]],"z":0.9,"d":0.9,"smooth":true,"fill":"#ef4444"},{"t":"tube","pts":[[-1.3,-0.6,0.8],[0,-1.3,0.8],[1.3,-0.6,0.8]],"w":0.9,"smooth":true,"fill":"#ef4444"}]},{"id":"cyber_visor","slot":"face","bounds":[-10.0,-2.9,10.4,2.9],"regions":false,"parts":[{"t":"box","c":[0.2,0,0.9],"s":[20.4,5.8,1.4],"round":2.7,"fill":"#1e293b"},{"t":"box","c":[0.2,0,1.7],"s":[15,1.1,0.3],"round":0.5,"fill":"#22d3ee","glow":true}]},{"id":"glasses_3d","slot":"face","bounds":[-9.7,-3.2,9.7,3.2],"regions":false,"parts":[{"t":"box","c":[0,0,0.6],"s":[19.4,6.4,0.9],"round":1,"fill":"#f8fafc"},{"t":"box","c":[-4.8,0,1.2],"s":[7,4.4,0.4],"round":0.6,"fill":"#ef4444"},{"t":"box","c":[4.8,0,1.2],"s":[7,4.4,0.4],"round":0.6,"fill":"#22d3ee"}]},{"id":"nerd_glasses","slot":"face","bounds":[-9.45,-3.65,9.45,3.75],"regions":false,"parts":[{"t":"tube","pts":[[1.2,-3.0,0.0],[8.8,-3.0,0.0],[8.8,3.1,0.0],[1.2,3.1,0.0],[1.2,-3.0,0.0]],"w":1.3,"smooth":false,"fill":"#18181b"},{"t":"tube","pts":[[-1.2,-3.0,0.0],[-8.8,-3.0,0.0],[-8.8,3.1,0.0],[-1.2,3.1,0.0],[-1.2,-3.0,0.0]],"w":1.3,"smooth":false,"fill":"#18181b"},{"t":"box","c":[0,-1,1.1],"s":[2.8,2.2,0.6],"round":0.3,"fill":"#f5f5f4"}]},{"id":"ski_goggles","slot":"face","bounds":[-16.5,-4.3,16.5,4.3],"regions":false,"parts":[{"t":"box","c":[0,0,0.4],"s":[21.4,8.6,1],"round":3.9,"fill":"#e5e7eb"},{"t":"box","c":[0,0,1.1],"s":[19.2,6.8,0.8],"round":3.2,"fill":"#fb923c"},{"t":"tube","pts":[[-6.4,-1.6,1.6],[-3.6,-2.6,1.6]],"w":0.8,"smooth":false,"fill":"#fff7ed"},{"t":"tube","pts":[[10.6,0.0,0.4],[15.2,0.6,-2]],"w":2.6,"smooth":false,"fill":"#1f2937"},{"t":"tube","pts":[[-10.6,0.0,0.4],[-15.2,0.6,-2]],"w":2.6,"smooth":false,"fill":"#1f2937"}]},{"id":"blush","slot":"face","bounds":[-10.2,3.1,10.2,6.1],"regions":false,"parts":[{"t":"sphere","c":[7.6,4.6,0.3],"r":[2.6,1.5,0.4],"fill":"#fb7185"},{"t":"sphere","c":[-7.6,4.6,0.3],"r":[2.6,1.5,0.4],"fill":"#fb7185"}]},{"id":"angry_brows","slot":"face","bounds":[-8.5,-7.1,8.5,-3.7],"regions":false,"parts":[{"t":"tube","pts":[[-7.8,-6.4,0.4],[-2.8,-4.4,0.4]],"w":1.4,"smooth":false,"fill":"#101014"},{"t":"tube","pts":[[7.8,-6.4,0.4],[2.8,-4.4,0.4]],"w":1.4,"smooth":false,"fill":"#101014"}]},{"id":"raised_brows","slot":"face","bounds":[-8.0,-7.4,8.0,-4.6],"regions":false,"parts":[{"t":"tube","pts":[[2.4,-5.2,0.4],[5.0,-6.8,0.4],[7.4,-5.8,0.4]],"w":1.2,"smooth":true,"fill":"#101014"},{"t":"tube","pts":[[-2.4,-5.2,0.4],[-5.0,-6.8,0.4],[-7.4,-5.8,0.4]],"w":1.2,"smooth":true,"fill":"#101014"}]},{"id":"cigar","slot":"mouth","bounds":[-0.9,-8.83,14.03,4.18],"regions":false,"parts":[{"t":"tube","pts":[[0.6,0,0.6],[10,2.4,1.2]],"w":3,"smooth":false,"fill":"#7a4a26"},{"t":"tube","pts":[[2.7,0.55,0.7],[3.6,0.8,0.8]],"w":3.2,"smooth":false,"fill":"#f2c14e"},{"t":"tube","pts":[[10.1,2.43,1.2],[11.1,2.7,1.3]],"w":2.95,"smooth":false,"fill":"#f97316","glow":true},{"t":"tube","pts":[[11.6,1.2,1.4],[13.2,-1.8,1.5],[11.8,-5.0,1.6],[13.6,-8.4,1.7]],"w":0.85,"smooth":true,"fill":"#d4d4d8"}]},{"id":"pipe","slot":"mouth","bounds":[-0.05,-12.62,10.43,2.6],"regions":false,"parts":[{"t":"tube","pts":[[0.6,0,0.6],[6.6,1.6,1.2]],"w":1.3,"smooth":false,"fill":"#3b2617"},{"t":"cyl","c":[8,0.4,1.2],"r":[1.9,2.3],"h":4.4,"dz":1.0,"fill":"#7a4a26"},{"t":"sphere","c":[8,-1.8,1.2],"r":[2.1,0.5,2.1],"fill":"#27272a"},{"t":"tube","pts":[[8,-2.6,1.4],[9.6,-5.6,1.5],[8.2,-8.8,1.6],[10,-12.2,1.7]],"w":0.85,"smooth":true,"fill":"#d4d4d8"}]},{"id":"lollipop","slot":"mouth","bounds":[-0.05,-0.45,12.2,7.2],"regions":false,"parts":[{"t":"tube","pts":[[0.4,0,0.6],[6.6,2.8,1.4]],"w":0.9,"smooth":false,"fill":"#fafafa"},{"t":"sphere","c":[8.8,3.8,1.6],"r":[3.4,3.4,0.9],"fill":"#f472b6"},{"t":"torus","c":[8.8,3.8,2.4],"R":1.8,"r":0.45,"tilt":0.0,"fill":"#fafafa"}]},{"id":"mustache","slot":"mouth","bounds":[-9.6,-4,9.6,0.6],"regions":false,"parts":[{"t":"poly","pts":[[0,-2.2],[2.4,-3.2],[5,-2.4],[7.6,-2],[9.6,-4],[9.6,-0.8],[6.8,0.6],[3.4,0.2],[0,0],[-3.4,0.2],[-6.8,0.6],[-9.6,-0.8],[-9.6,-4],[-7.6,-2],[-5,-2.4],[-2.4,-3.2]],"z":0.7,"d":1,"smooth":true,"fill":"#4a2f1d"}]},{"id":"beard","slot":"mouth","bounds":[-11.4,-3.6,11.4,11.4],"regions":false,"parts":[{"t":"poly","pts":[[0,0.6],[5.4,-0.4],[9.4,-3.6],[11.4,-2.4],[10.6,4.4],[6.6,9.6],[0,11.4],[-6.6,9.6],[-10.6,4.4],[-11.4,-2.4],[-9.4,-3.6],[-5.4,-0.4]],"z":0.6,"d":1.4,"smooth":true,"fill":"#7a4a26"},{"t":"poly","pts":[[0,-2],[3,-3],[6,-1.8],[6.6,0.2],[3,0],[0,0.4],[-3,0],[-6.6,0.2],[-6,-1.8],[-3,-3]],"z":1.6,"d":0.8,"smooth":true,"fill":"#4a2f1d"}]},{"id":"straw","slot":"mouth","bounds":[0.0,-4.66,15.06,0.4],"regions":false,"parts":[{"t":"tube","pts":[[0.4,0,0.6],[7.6,-2.4,1.2],[12.6,-3.6,1.4]],"w":0.8,"smooth":true,"fill":"#eab308"},{"t":"sphere","c":[13.4,-3.8,1.4],"r":[1.7,0.8,0.8],"fill":"#ca8a04","rot":-12}]},{"id":"rose","slot":"mouth","bounds":[-0.05,-0.45,14.1,5.3],"regions":false,"parts":[{"t":"tube","pts":[[0.4,0,0.6],[10,2.4,1.2]],"w":0.9,"smooth":false,"fill":"#16a34a"},{"t":"poly","pts":[[5.0,1.4],[6.972,1.227],[8.064,3.971],[5.506,3.286]],"z":1,"d":0.5,"smooth":true,"fill":"#22c55e"},{"t":"sphere","c":[11.4,2.6,1.4],"r":[2.7,2.7,2.7],"fill":"#e11d48"},{"t":"torus","c":[11.4,2.6,3.8],"R":1.3,"r":0.42,"tilt":0.0,"fill":"#9f1239"}]},{"id":"bubble_gum","slot":"mouth","bounds":[-4.2,-4.0,5.0,5.2],"regions":false,"parts":[{"t":"sphere","c":[0.4,0.6,3.2],"r":[4.6,4.6,3.6],"fill":"#f9a8d4"},{"t":"sphere","c":[-1,-1,6.4],"r":[1,1,0.5],"fill":"#f8fafc"}]},{"id":"smile","slot":"mouth","bounds":[-3.8,-1.4,3.8,2.0],"regions":false,"parts":[{"t":"tube","pts":[[-3.2,-0.8,0.4],[0,1.4,0.4],[3.2,-0.8,0.4]],"w":1.2,"smooth":true,"fill":"#101014"}]},{"id":"tongue","slot":"mouth","bounds":[-3.35,-0.95,3.35,3.7],"regions":false,"parts":[{"t":"poly","pts":[[-1.6,0],[1.6,0],[1.8,2.6],[0,3.7],[-1.8,2.6]],"z":0.3,"d":0.6,"smooth":true,"fill":"#fb7185"},{"t":"tube","pts":[[-2.8,-0.4,0.6],[0,0.5,0.6],[2.8,-0.4,0.6]],"w":1.1,"smooth":true,"fill":"#101014"}]},{"id":"bow_tie","slot":"neck","bounds":[-5.8,-3.2,5.8,3.2],"regions":false,"parts":[{"t":"poly","pts":[[0,-1.0],[5.0,-3.2],[5.8,0],[5.0,3.2],[0,1.0],[-5.0,3.2],[-5.8,0],[-5.0,-3.2]],"z":0.8,"d":1.2,"smooth":false,"fill":"#dc2626"},{"t":"sphere","c":[0,0,1.4],"r":[1.4,1.6,0.8],"fill":"#991b1b"}]},{"id":"necktie","slot":"neck","bounds":[-1.7,-0.8,1.7,1.9],"regions":true,"parts":[{"t":"poly","pts":[[-1.7,-0.8],[1.7,-0.8],[1.1,1.9],[-1.1,1.9]],"z":0.8,"d":1,"smooth":false,"fill":"#2563eb"},{"t":"region","pts":[[-1.1,1.8],[1.1,1.8],[2.5,9.2],[0,11.4],[-2.5,9.2]],"mode":"front","fill":"#2563eb"},{"t":"region","pts":[[-1.6,4.6],[1.6,4.6],[1.9,5.8],[-1.9,5.8]],"mode":"front","fill":"#facc15"}]},{"id":"scarf","slot":"neck","bounds":[3,1.2,7.3,9],"regions":true,"parts":[{"t":"region","pts":[[-60,-1.6],[60,-1.6],[60,2.6],[-60,2.6]],"mode":"wrap","fill":"#e0483e"},{"t":"poly","pts":[[3,1.2],[6.6,1.2],[7.2,8.8],[3.6,9]],"z":0.9,"d":1.2,"smooth":false,"fill":"#d0362d"},{"t":"tube","pts":[[3.4,6,1.6],[6.9,5.8,1.6]],"w":0.8,"smooth":false,"fill":"#fafafa"}]},{"id":"gold_chain","slot":"neck","bounds":[-9.05,-2.65,9.05,6.9],"regions":false,"parts":[{"t":"tube","pts":[[-8.6,-2.2,0.5],[-6.45,-0.056,0.5],[-4.3,1.475,0.5],[-2.15,2.394,0.5],[0.0,2.7,0.5],[2.15,2.394,0.5],[4.3,1.475,0.5],[6.45,-0.056,0.5],[8.6,-2.2,0.5]],"w":0.9,"smooth":true,"fill":"#f2c14e"},{"t":"sphere","c":[0,4.6,0.9],"r":[2.3,2.3,0.6],"fill":"#f2c14e"},{"t":"sphere","c":[0,4.6,1.4],"r":[1.2,1.2,0.4],"fill":"#c8922a"}]},{"id":"medal","slot":"neck","bounds":[-4.1,-3.3,4.1,7.0],"regions":false,"parts":[{"t":"tube","pts":[[-3.2,-2.4,0.5],[0,2.6,0.6]],"w":1.8,"smooth":false,"fill":"#2563eb"},{"t":"tube","pts":[[3.2,-2.4,0.5],[0,2.6,0.6]],"w":1.8,"smooth":false,"fill":"#dc2626"},{"t":"sphere","c":[0,4.4,1],"r":[2.6,2.6,0.6],"fill":"#f2c14e"},{"t":"poly","pts":[[0.0,2.8],[0.411,3.834],[1.522,3.906],[0.666,4.616],[0.94,5.694],[0.0,5.1],[-0.94,5.694],[-0.666,4.616],[-1.522,3.906],[-0.411,3.834]],"z":1.6,"d":0.3,"smooth":false,"fill":"#c8922a"}]},{"id":"bandana","slot":"neck","bounds":[-2.6,1.2,2.6,5.0],"regions":true,"parts":[{"t":"region","pts":[[-60,-1],[60,-1],[60,1.4],[-60,1.4]],"mode":"wrap","fill":"#dc2626"},{"t":"region","pts":[[-5.6,0],[5.6,0],[0,7]],"mode":"front","fill":"#dc2626"},{"t":"sphere","c":[-2,1.8,0.8],"r":[0.6,0.6,0.6],"fill":"#f8fafc"},{"t":"sphere","c":[2,1.8,0.8],"r":[0.6,0.6,0.6],"fill":"#f8fafc"},{"t":"sphere","c":[0,4.4,0.8],"r":[0.6,0.6,0.6],"fill":"#f8fafc"}]},{"id":"lei","slot":"neck","bounds":[-11.3,-3.7,11.3,4.9],"regions":false,"parts":[{"t":"sphere","c":[-9.6,-2.0,0.9],"r":[1.7,1.7,1],"fill":"#f472b6"},{"t":"sphere","c":[-7.2,0.275,0.9],"r":[1.7,1.7,1],"fill":"#facc15"},{"t":"sphere","c":[-4.8,1.9,0.9],"r":[1.7,1.7,1],"fill":"#fb923c"},{"t":"sphere","c":[-2.4,2.875,0.9],"r":[1.7,1.7,1],"fill":"#a78bfa"},{"t":"sphere","c":[0.0,3.2,0.9],"r":[1.7,1.7,1],"fill":"#f472b6"},{"t":"sphere","c":[2.4,2.875,0.9],"r":[1.7,1.7,1],"fill":"#facc15"},{"t":"sphere","c":[4.8,1.9,0.9],"r":[1.7,1.7,1],"fill":"#fb923c"},{"t":"sphere","c":[7.2,0.275,0.9],"r":[1.7,1.7,1],"fill":"#a78bfa"},{"t":"sphere","c":[9.6,-2.0,0.9],"r":[1.7,1.7,1],"fill":"#f472b6"}]},{"id":"pearls","slot":"neck","bounds":[-9.75,-3.15,9.75,3.35],"regions":false,"parts":[{"t":"sphere","c":[-8.8,-2.2,0.7],"r":[0.95,0.95,0.95],"fill":"#f4f1ea"},{"t":"sphere","c":[-7.333,-0.794,0.7],"r":[0.95,0.95,0.95],"fill":"#f4f1ea"},{"t":"sphere","c":[-5.867,0.356,0.7],"r":[0.95,0.95,0.95],"fill":"#f4f1ea"},{"t":"sphere","c":[-4.4,1.25,0.7],"r":[0.95,0.95,0.95],"fill":"#f4f1ea"},{"t":"sphere","c":[-2.933,1.889,0.7],"r":[0.95,0.95,0.95],"fill":"#f4f1ea"},{"t":"sphere","c":[-1.467,2.272,0.7],"r":[0.95,0.95,0.95],"fill":"#f4f1ea"},{"t":"sphere","c":[0.0,2.4,0.7],"r":[0.95,0.95,0.95],"fill":"#f4f1ea"},{"t":"sphere","c":[1.467,2.272,0.7],"r":[0.95,0.95,0.95],"fill":"#f4f1ea"},{"t":"sphere","c":[2.933,1.889,0.7],"r":[0.95,0.95,0.95],"fill":"#f4f1ea"},{"t":"sphere","c":[4.4,1.25,0.7],"r":[0.95,0.95,0.95],"fill":"#f4f1ea"},{"t":"sphere","c":[5.867,0.356,0.7],"r":[0.95,0.95,0.95],"fill":"#f4f1ea"},{"t":"sphere","c":[7.333,-0.794,0.7],"r":[0.95,0.95,0.95],"fill":"#f4f1ea"},{"t":"sphere","c":[8.8,-2.2,0.7],"r":[0.95,0.95,0.95],"fill":"#f4f1ea"}]},{"id":"collar_bell","slot":"neck","bounds":[-2.0,0.8,2.0,4.8],"regions":true,"parts":[{"t":"region","pts":[[-60,-0.8],[60,-0.8],[60,1.2],[-60,1.2]],"mode":"wrap","fill":"#dc2626"},{"t":"sphere","c":[0,2.8,1.2],"r":[2,2,2],"fill":"#f2c14e"},{"t":"tube","pts":[[-0.9,3.6,3],[0.9,3.6,3]],"w":0.5,"smooth":false,"fill":"#6b4b12"}]},{"id":"suit","slot":"outfit","bounds":[0,0,0,0],"regions":true,"parts":[{"t":"region","pts":[[-60,-0.6],[60,-0.6],[60,60],[-60,60]],"mode":"wrap","fill":"#1f2a44"},{"t":"region","pts":[[-3.4,-0.7],[3.4,-0.7],[0,7.2]],"mode":"front","fill":"#f8fafc"},{"t":"region","pts":[[-0.9,-0.2],[0.9,-0.2],[1.5,5],[0,6.4],[-1.5,5]],"mode":"front","fill":"#dc2626"}]},{"id":"tuxedo","slot":"outfit","bounds":[-3.4,-1.8,3.4,5.7],"regions":true,"parts":[{"t":"region","pts":[[-60,-0.6],[60,-0.6],[60,60],[-60,60]],"mode":"wrap","fill":"#141418"},{"t":"region","pts":[[-4,-0.7],[4,-0.7],[0,8.2]],"mode":"front","fill":"#f8fafc"},{"t":"poly","pts":[[0,-0.5],[3,-1.8],[3.4,0.6],[3,1.9],[0,0.6],[-3,1.9],[-3.4,0.6],[-3,-1.8]],"z":0.9,"d":0.8,"smooth":false,"fill":"#141418"},{"t":"sphere","c":[0,3.4,0.7],"r":[0.5,0.5,0.5],"fill":"#101014"},{"t":"sphere","c":[0,5.2,0.7],"r":[0.5,0.5,0.5],"fill":"#101014"}]},{"id":"lab_coat","slot":"outfit","bounds":[4.8,1.6,5.6,4.8],"regions":true,"parts":[{"t":"region","pts":[[-60,-0.6],[60,-0.6],[60,60],[-60,60]],"mode":"wrap","fill":"#f1f2f4"},{"t":"region","pts":[[-3,-0.7],[3,-0.7],[0,5.8]],"mode":"front","fill":"#93c5fd"},{"t":"region","pts":[[4.2,3],[8,3],[8,6.4],[4.2,6.4]],"mode":"front","fill":"#dcdee3"},{"t":"tube","pts":[[5.2,2,0.6],[5.2,4.4,0.6]],"w":0.8,"smooth":false,"fill":"#2f6fe0"}]},{"id":"hoodie","slot":"outfit","bounds":[-2.2,-0.75,2.2,4.6],"regions":true,"parts":[{"t":"region","pts":[[-60,-0.6],[60,-0.6],[60,60],[-60,60]],"mode":"wrap","fill":"#6b7280"},{"t":"region","pts":[[-6,4],[6,4],[7.6,9.4],[-7.6,9.4]],"mode":"front","fill":"#4b5563"},{"t":"tube","pts":[[1.8,-0.4,0.5],[1.6,3.6,0.5]],"w":0.7,"smooth":false,"fill":"#f4f4f5"},{"t":"sphere","c":[1.6,4.0,0.7],"r":[0.6,0.6,0.6],"fill":"#f4f4f5"},{"t":"tube","pts":[[-1.8,-0.4,0.5],[-1.6,3.6,0.5]],"w":0.7,"smooth":false,"fill":"#f4f4f5"},{"t":"sphere","c":[-1.6,4.0,0.7],"r":[0.6,0.6,0.6],"fill":"#f4f4f5"}]},{"id":"jersey","slot":"outfit","bounds":[-2.09,5.8,2.09,9.78],"regions":true,"parts":[{"t":"region","pts":[[-60,-0.6],[60,-0.6],[60,60],[-60,60]],"mode":"wrap","fill":"#dc2626"},{"t":"region","pts":[[-60,3],[60,3],[60,4.8],[-60,4.8]],"mode":"front","fill":"#fafafa"},{"t":"region","pts":[[-2.6,-0.7],[2.6,-0.7],[0,2.6]],"mode":"front","fill":"#fafafa"},{"t":"poly","pts":[[0.0,5.8],[0.588,7.191],[2.092,7.32],[0.951,8.309],[1.293,9.78],[0.0,9.0],[-1.293,9.78],[-0.951,8.309],[-2.092,7.32],[-0.588,7.191]],"z":0.4,"d":0.4,"smooth":false,"fill":"#fafafa"}]},{"id":"overalls","slot":"outfit","bounds":[-5.75,0.65,5.75,2.15],"regions":true,"parts":[{"t":"region","pts":[[-60,3.4],[60,3.4],[60,60],[-60,60]],"mode":"wrap","fill":"#3b5b9a"},{"t":"region","pts":[[-5,0.8],[5,0.8],[5,3.6],[-5,3.6]],"mode":"front","fill":"#3b5b9a"},{"t":"region","pts":[[4.0,-1.2],[6.0,-1.2],[6.0,1.0],[4.0,1.0]],"mode":"front","fill":"#3b5b9a"},{"t":"sphere","c":[5.0,1.4,0.8],"r":[0.75,0.75,0.75],"fill":"#f2c14e"},{"t":"region","pts":[[-4.0,1.0],[-6.0,1.0],[-6.0,-1.2],[-4.0,-1.2]],"mode":"front","fill":"#3b5b9a"},{"t":"sphere","c":[-5.0,1.4,0.8],"r":[0.75,0.75,0.75],"fill":"#f2c14e"},{"t":"region","pts":[[-2.2,4.6],[2.2,4.6],[2.2,7],[-2.2,7]],"mode":"front","fill":"#2f4a80"}]},{"id":"hawaiian_shirt","slot":"outfit","bounds":[-7.55,1.2,7.35,9.19],"regions":true,"parts":[{"t":"region","pts":[[-60,-0.6],[60,-0.6],[60,60],[-60,60]],"mode":"wrap","fill":"#14b8a6"},{"t":"region","pts":[[-3.6,-0.7],[3.6,-0.7],[0,5]],"mode":"front","fill":"#f8fafc"},{"t":"sphere","c":[-5.6,2.1,0.6],"r":[0.9,0.9,0.4],"fill":"#f9a8d4"},{"t":"sphere","c":[-4.554,2.86,0.6],"r":[0.9,0.9,0.4],"fill":"#f9a8d4"},{"t":"sphere","c":[-4.953,4.09,0.6],"r":[0.9,0.9,0.4],"fill":"#f9a8d4"},{"t":"sphere","c":[-6.247,4.09,0.6],"r":[0.9,0.9,0.4],"fill":"#f9a8d4"},{"t":"sphere","c":[-6.646,2.86,0.6],"r":[0.9,0.9,0.4],"fill":"#f9a8d4"},{"t":"sphere","c":[-5.6,3.2,0.9],"r":[0.55,0.55,0.55],"fill":"#fde047"},{"t":"sphere","c":[5.4,3.5,0.6],"r":[0.9,0.9,0.4],"fill":"#f9a8d4"},{"t":"sphere","c":[6.446,4.26,0.6],"r":[0.9,0.9,0.4],"fill":"#f9a8d4"},{"t":"sphere","c":[6.047,5.49,0.6],"r":[0.9,0.9,0.4],"fill":"#f9a8d4"},{"t":"sphere","c":[4.753,5.49,0.6],"r":[0.9,0.9,0.4],"fill":"#f9a8d4"},{"t":"sphere","c":[4.354,4.26,0.6],"r":[0.9,0.9,0.4],"fill":"#f9a8d4"},{"t":"sphere","c":[5.4,4.6,0.9],"r":[0.55,0.55,0.55],"fill":"#fde047"},{"t":"sphere","c":[-1.2,6.3,0.6],"r":[0.9,0.9,0.4],"fill":"#f9a8d4"},{"t":"sphere","c":[-0.154,7.06,0.6],"r":[0.9,0.9,0.4],"fill":"#f9a8d4"},{"t":"sphere","c":[-0.553,8.29,0.6],"r":[0.9,0.9,0.4],"fill":"#f9a8d4"},{"t":"sphere","c":[-1.847,8.29,0.6],"r":[0.9,0.9,0.4],"fill":"#f9a8d4"},{"t":"sphere","c":[-2.246,7.06,0.6],"r":[0.9,0.9,0.4],"fill":"#f9a8d4"},{"t":"sphere","c":[-1.2,7.4,0.9],"r":[0.55,0.55,0.55],"fill":"#fde047"}]},{"id":"knight_armor","slot":"outfit","bounds":[-4.8,1.0,4.8,2.2],"regions":true,"parts":[{"t":"region","pts":[[-60,-0.6],[60,-0.6],[60,60],[-60,60]],"mode":"wrap","fill":"#9aa3ad"},{"t":"region","pts":[[-6,0.4],[6,0.4],[5,9],[0,11.4],[-5,9]],"mode":"front","fill":"#cbd5e1"},{"t":"region","pts":[[-0.6,0.4],[0.6,0.4],[0.6,11],[-0.6,11]],"mode":"front","fill":"#94a3b8"},{"t":"sphere","c":[-4.2,1.6,0.7],"r":[0.6,0.6,0.6],"fill":"#64748b"},{"t":"sphere","c":[4.2,1.6,0.7],"r":[0.6,0.6,0.6],"fill":"#64748b"}]},{"id":"hero_suit","slot":"outfit","bounds":[0,0,0,0],"regions":true,"parts":[{"t":"region","pts":[[-60,-0.6],[60,-0.6],[60,60],[-60,60]],"mode":"wrap","fill":"#2563eb"},{"t":"region","pts":[[0,0.6],[4.6,4.4],[0,8.8],[-4.6,4.4]],"mode":"front","fill":"#facc15"},{"t":"region","pts":[[0,2.4],[2.4,4.4],[0,6.6],[-2.4,4.4]],"mode":"front","fill":"#dc2626"}]},{"id":"angel_wings","slot":"back","bounds":[-26.0,-13.0,26.0,2.6],"regions":false,"parts":[{"t":"poly","pts":[[8.6,-2.0],[12.6,-8.0],[18.6,-12.0],[25.0,-13.0],[23.6,-8.4],[26.0,-6.2],[22.6,-3.2],[24.0,0.2],[18.6,1.2],[14.6,2.6]],"z":-1,"d":1.6,"smooth":true,"fill":"#f8fafc"},{"t":"poly","pts":[[-14.6,2.6],[-18.6,1.2],[-24.0,0.2],[-22.6,-3.2],[-26.0,-6.2],[-23.6,-8.4],[-25.0,-13.0],[-18.6,-12.0],[-12.6,-8.0],[-8.6,-2.0]],"z":-1,"d":1.6,"smooth":true,"fill":"#f8fafc"}]},{"id":"bat_wings","slot":"back","bounds":[-27.0,-13.0,27.0,1.2],"regions":false,"parts":[{"t":"poly","pts":[[8.6,-2.0],[12.6,-9.0],[18.6,-13.0],[27.0,-11.4],[24.2,-7.4],[26.0,-3.6],[22.0,-4.8],[21.0,-0.2],[17.0,-2.4],[13.6,1.2]],"z":-1,"d":1.4,"smooth":false,"fill":"#4c1d95"},{"t":"poly","pts":[[-13.6,1.2],[-17.0,-2.4],[-21.0,-0.2],[-22.0,-4.8],[-26.0,-3.6],[-24.2,-7.4],[-27.0,-11.4],[-18.6,-13.0],[-12.6,-9.0],[-8.6,-2.0]],"z":-1,"d":1.4,"smooth":false,"fill":"#4c1d95"}]},{"id":"cape","slot":"back","bounds":[-21,-11,21,21.8],"regions":false,"parts":[{"t":"poly","pts":[[-12,-11],[12,-11],[17.6,6],[21,21.4],[10,19.6],[0,21.8],[-10,19.6],[-21,21.4],[-17.6,6]],"z":-1.2,"d":1.2,"smooth":true,"fill":"#b91c1c"}]},{"id":"jetpack","slot":"back","bounds":[-13.4,-13.8,13.4,24.1],"regions":false,"parts":[{"t":"cyl","c":[9.6,1.0,-4],"r":[3.8,3.8],"h":24,"dz":1.0,"fill":"#9ca3af"},{"t":"dome","c":[9.6,-11.0,-4],"r":[3.8,2.8,3.8],"fill":"#b8c0c8"},{"t":"cyl","c":[9.6,13.8,-4],"r":[2.3,3],"h":2.6,"dz":1.0,"fill":"#52525b"},{"t":"cyl","c":[9.6,19.6,-4],"r":[0,2.7],"h":9,"dz":1.0,"fill":"#fb923c","glow":true},{"t":"cyl","c":[9.6,18.2,-3.4],"r":[0,1.5],"h":5,"dz":1.0,"fill":"#fde047","glow":true},{"t":"cyl","c":[-9.6,1.0,-4],"r":[3.8,3.8],"h":24,"dz":1.0,"fill":"#9ca3af"},{"t":"dome","c":[-9.6,-11.0,-4],"r":[3.8,2.8,3.8],"fill":"#b8c0c8"},{"t":"cyl","c":[-9.6,13.8,-4],"r":[2.3,3],"h":2.6,"dz":1.0,"fill":"#52525b"},{"t":"cyl","c":[-9.6,19.6,-4],"r":[0,2.7],"h":9,"dz":1.0,"fill":"#fb923c","glow":true},{"t":"cyl","c":[-9.6,18.2,-3.4],"r":[0,1.5],"h":5,"dz":1.0,"fill":"#fde047","glow":true}]},{"id":"butterfly_wings","slot":"back","bounds":[-23.2,-12.6,23.2,7.6],"regions":false,"parts":[{"t":"poly","pts":[[7.6,-1.0],[12.6,-9.4],[20.0,-12.6],[23.2,-7.4],[18.2,-1.8]],"z":-1,"d":1,"smooth":true,"fill":"#f59e0b"},{"t":"poly","pts":[[7.6,0.0],[17.0,1.4],[19.0,6.6],[12.6,7.6]],"z":-1.1,"d":1,"smooth":true,"fill":"#fb923c"},{"t":"sphere","c":[18.2,-7.6,-0.2],"r":[1.4,1.4,0.4],"fill":"#fff7ed"},{"t":"sphere","c":[15.6,4.0,-0.4],"r":[1,1,0.4],"fill":"#7c2d12"},{"t":"poly","pts":[[-18.2,-1.8],[-23.2,-7.4],[-20.0,-12.6],[-12.6,-9.4],[-7.6,-1.0]],"z":-1,"d":1,"smooth":true,"fill":"#f59e0b"},{"t":"poly","pts":[[-12.6,7.6],[-19.0,6.6],[-17.0,1.4],[-7.6,0.0]],"z":-1.1,"d":1,"smooth":true,"fill":"#fb923c"},{"t":"sphere","c":[-18.2,-7.6,-0.2],"r":[1.4,1.4,0.4],"fill":"#fff7ed"},{"t":"sphere","c":[-15.6,4.0,-0.4],"r":[1,1,0.4],"fill":"#7c2d12"}]},{"id":"devil_tail","slot":"back","bounds":[3.0,0.6,22.4,18.0],"regions":false,"parts":[{"t":"tube","pts":[[4,13,-1],[12,17,-1],[19.4,12.4,-1],[19,5.4,-1]],"w":2,"smooth":true,"fill":"#d42f2f"},{"t":"poly","pts":[[19,0.6],[22.4,6.2],[19,5],[15.6,6.2]],"z":-1,"d":1.2,"smooth":false,"fill":"#d42f2f"}]},{"id":"coffee","slot":"held","bounds":[-0.1,-11.4,6.5,3.0],"regions":false,"parts":[{"t":"cyl","c":[3.2,0,0],"r":[2.6,3.1],"h":6,"dz":1.0,"fill":"#fafaf9"},{"t":"cyl","c":[3.2,0.3,0],"r":[2.76,2.96],"h":2.6,"dz":1.0,"fill":"#a8692e"},{"t":"cyl","c":[3.2,-3.4,0],"r":[3.3,3.2],"h":1,"dz":1.0,"fill":"#e7e5e4"},{"t":"tube","pts":[[3,-4.6,0],[4.4,-6.8,0],[3,-9,0],[4.4,-11,0]],"w":0.8,"smooth":true,"fill":"#d4d4d8"}]},{"id":"wrench","slot":"held","bounds":[1.0,-8.81,10.25,4.46],"regions":false,"parts":[{"t":"tube","pts":[[2.0,3.464,0],[6.5,-4.33,0]],"w":2,"smooth":false,"fill":"#9ca3af"},{"t":"poly","pts":[[4.295,-4.911],[5.748,-8.228],[7.934,-8.814],[6.98,-6.362],[8.02,-5.762],[9.666,-7.814],[10.252,-5.628],[8.105,-2.711]],"z":0,"d":1.6,"smooth":false,"fill":"#9ca3af"}]},{"id":"magic_wand","slot":"held","bounds":[0.0,-12.5,12.9,3.6],"regions":false,"parts":[{"t":"tube","pts":[[0.6,3,0],[6.4,-5.4,0]],"w":1.2,"smooth":false,"fill":"#18181b"},{"t":"tube","pts":[[5.7,-4.4,0],[6.4,-5.4,0]],"w":1.25,"smooth":false,"fill":"#f8fafc"},{"t":"poly","pts":[[9.2,-10.7],[9.766,-9.166],[11.3,-8.6],[9.766,-8.034],[9.2,-6.5],[8.634,-8.034],[7.1,-8.6],[8.634,-9.166]],"z":0.4,"d":0.4,"smooth":false,"fill":"#f2c14e","glow":true},{"t":"poly","pts":[[11.6,-6.3],[11.954,-5.354],[12.9,-5.0],[11.954,-4.646],[11.6,-3.7],[11.246,-4.646],[10.3,-5.0],[11.246,-5.354]],"z":0.4,"d":0.4,"smooth":false,"fill":"#f2c14e","glow":true},{"t":"poly","pts":[[7.4,-12.5],[7.718,-11.718],[8.5,-11.4],[7.718,-11.082],[7.4,-10.3],[7.082,-11.082],[6.3,-11.4],[7.082,-11.718]],"z":0.4,"d":0.4,"smooth":false,"fill":"#f2c14e","glow":true}]},{"id":"sword","slot":"held","bounds":[-0.07,-13.31,8.47,6.99],"regions":false,"parts":[{"t":"poly","pts":[[2.74,0.642],[4.642,1.26],[8.474,-10.533],[8.326,-13.315],[6.572,-11.151]],"z":0,"d":0.8,"smooth":false,"fill":"#e5e7eb"},{"t":"box","c":[3.475,1.617,0],"s":[7,1.4,1.6],"round":0.6,"fill":"#f2c14e","rot":18.0},{"t":"tube","pts":[[3.197,2.473,0],[2.27,5.326,0]],"w":1.4,"smooth":false,"fill":"#8a5a32"},{"t":"sphere","c":[2.084,5.897,0],"r":[1.1,1.1,1.1],"fill":"#f2c14e","rot":18.0}]},{"id":"laser_sword","slot":"held","bounds":[1.5,-14.47,8.57,6.75],"regions":false,"parts":[{"t":"tube","pts":[[2.447,5.796,0],[3.534,1.739,0]],"w":1.9,"smooth":false,"fill":"#52525b"},{"t":"tube","pts":[[3.327,2.511,0],[3.172,3.091,0]],"w":2.1,"smooth":false,"fill":"#27272a"},{"t":"tube","pts":[[3.689,1.159,0],[7.623,-13.523,0]],"w":1.9,"smooth":false,"fill":"#22d3ee","glow":true},{"t":"tube","pts":[[3.689,1.159,0.3],[7.52,-13.137,0.3]],"w":0.8,"smooth":false,"fill":"#ecfeff","glow":true}]},{"id":"balloon","slot":"held","bounds":[-1.0,-22.4,8.2,2.23],"regions":false,"parts":[{"t":"tube","pts":[[1,2,0],[2.4,-3,0],[1.6,-7.6,0],[3.2,-11.4,0]],"w":0.45,"smooth":true,"fill":"#71717a"},{"t":"sphere","c":[3.4,-11.6,0],"r":[0.9,0.7,0.9],"fill":"#e0483e"},{"t":"sphere","c":[3.6,-17,0],"r":[4.6,5.4,4.6],"fill":"#e0483e"},{"t":"sphere","c":[2,-19,3.6],"r":[1,1.5,0.6],"fill":"#fecaca"}]},{"id":"flag","slot":"held","bounds":[0.0,-15.6,11.8,4.45],"regions":false,"parts":[{"t":"tube","pts":[[1,4,0],[1,-14,0]],"w":0.9,"smooth":false,"fill":"#a1a1aa"},{"t":"sphere","c":[1,-14.6,0],"r":[1,1,1],"fill":"#f2c14e"},{"t":"poly","pts":[[1.4,-13.6],[5,-14.6],[8.6,-13],[11.8,-14],[11.8,-7.4],[8.6,-6.4],[5,-8],[1.4,-7]],"z":0,"d":0.6,"smooth":true,"fill":"body"}]},{"id":"book","slot":"held","bounds":[0.9,-3.9,7.25,3.9],"regions":false,"parts":[{"t":"box","c":[4,0,0],"s":[6.2,7.8,2.4],"round":0.5,"fill":"#2563eb"},{"t":"box","c":[6.9,0,0],"s":[0.7,7,1.9],"round":0.1,"fill":"#fafaf9"},{"t":"box","c":[3.7,-1.8,1.25],"s":[3.4,0.7,0.1],"round":0.2,"fill":"#f2c14e"}]},{"id":"briefcase","slot":"held","bounds":[-0.5,-4.9,8.5,4.3],"regions":false,"parts":[{"t":"box","c":[4,1,0],"s":[9,6.6,2.6],"round":0.9,"fill":"#7a4a26"},{"t":"torus","c":[4,-2.6,0],"R":1.8,"r":0.5,"tilt":0.0,"fill":"#3b2617"},{"t":"box","c":[4,-1.2,1.35],"s":[1.6,1,0.3],"round":0.2,"fill":"#f2c14e"}]},{"id":"trophy","slot":"held","bounds":[-1.3,-7.2,9.3,3.0],"regions":false,"parts":[{"t":"cyl","c":[4,-4.4,0],"r":[1.6,3.8],"h":5.6,"dz":1.0,"fill":"#f2c14e"},{"t":"torus","c":[0.8,-4.8,0],"R":1.6,"r":0.5,"tilt":0.0,"fill":"#f2c14e"},{"t":"torus","c":[7.2,-4.8,0],"R":1.6,"r":0.5,"tilt":0.0,"fill":"#f2c14e"},{"t":"cyl","c":[4,-0.4,0],"r":[0.8,0.8],"h":2.6,"dz":1.0,"fill":"#c8922a"},{"t":"box","c":[4,2,0],"s":[5.6,2,2.6],"round":0.4,"fill":"#5b3a1e"},{"t":"poly","pts":[[4.0,-5.7],[4.323,-4.845],[5.236,-4.802],[4.523,-4.23],[4.764,-3.348],[4.0,-3.85],[3.236,-3.348],[3.477,-4.23],[2.764,-4.802],[3.677,-4.845]],"z":2.1,"d":0.3,"smooth":false,"fill":"#fff7d6"}]},{"id":"rubber_duck","slot":"held","bounds":[-1.2,-6.0,8.4,3.0],"regions":false,"parts":[{"t":"sphere","c":[4.4,0,0],"r":[4,3,3.2],"fill":"#facc15"},{"t":"sphere","c":[2.6,-3.6,0],"r":[2.4,2.4,2.4],"fill":"#facc15"},{"t":"sphere","c":[0.2,-3.4,0.4],"r":[1.4,0.7,1],"fill":"#fb923c"},{"t":"sphere","c":[2,-4.2,2],"r":[0.5,0.5,0.5],"fill":"#101014"}]},{"id":"pizza","slot":"held","bounds":[-1.69,-7.83,9.2,4.8],"regions":false,"parts":[{"t":"poly","pts":[[-0.389,-4.111],[8.111,-6.389],[6.553,4.796]],"z":0,"d":1,"smooth":false,"fill":"#fcd34d"},{"t":"tube","pts":[[-0.686,-4.446,0],[8.201,-6.827,0]],"w":2,"smooth":false,"fill":"#b45309"},{"t":"sphere","c":[3.13,-2.57,0.6],"r":[1.1,1.1,0.3],"fill":"#dc2626","rot":-15.0},{"t":"sphere","c":[6.183,-2.766,0.6],"r":[1.1,1.1,0.3],"fill":"#dc2626","rot":-15.0},{"t":"sphere","c":[5.414,0.545,0.6],"r":[1,1,0.3],"fill":"#dc2626","rot":-15.0}]},{"id":"microphone","slot":"held","bounds":[1.85,-6.08,7.3,6.77],"regions":false,"parts":[{"t":"tube","pts":[[2.753,5.869,0],[4.208,-0.978,0]],"w":1.8,"smooth":false,"fill":"#27272a"},{"t":"cyl","c":[4.249,-1.174,0],"r":[1.4,1.8],"h":1,"dz":1.0,"fill":"#3f3f46","rot":12.0},{"t":"sphere","c":[4.748,-3.521,0],"r":[2.6,2.6,2.6],"fill":"#a1a1aa","rot":12.0}]},{"id":"ice_cream","slot":"held","bounds":[1.0,-9.4,7.0,5.9],"regions":false,"parts":[{"t":"cyl","c":[4,2.4,0],"r":[0,2.8],"h":7,"dz":1.0,"fill":"#d6a15c"},{"t":"sphere","c":[4,-2,0],"r":[3,3,3],"fill":"#f9a8d4"},{"t":"sphere","c":[4,-5.4,0],"r":[2.6,2.6,2.6],"fill":"#86efac"},{"t":"sphere","c":[4,-8.4,0.4],"r":[1,1,1],"fill":"#dc2626"}]}]}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.tsxnew file mode 100644index 0000000000..c13fca7343--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/companion/accessories.test.tsx@@ -0,0 +1,74 @@+import { describe, expect, it } from "vitest";+import { render } from "@testing-library/react";+import en from "@/i18n/locales/society/en.json";+import de from "@/i18n/locales/society/de.json";+import es from "@/i18n/locales/society/es.json";+import { AgentSymbol } from "../AgentSymbol";+import {+ ACCESSORY_CATALOG, ACCESSORY_IDS_BY_SLOT, ACCESSORY_ITEMS, ACCESSORY_SLOTS, randomAccessories, resolveFill,+ symbolViewBox, wornAccessories,+} from "./accessories";+import { COMPANION_SHAPES, companionSchema, resolveCompanion } from "./appearance";++type Labels = { society: { companion: { items: Record<string, string>; slots: Record<string, string> } } };++describe("agent symbol accessories", () => {+ it("labels every item and slot in every society locale", () => {+ for (const locale of [en, de, es] as unknown as Labels[]) {+ const { items, slots } = locale.society.companion;+ expect(Object.keys(items).sort()).toEqual(ACCESSORY_ITEMS.map(item => item.id).sort());+ expect(Object.keys(slots).sort()).toEqual([...ACCESSORY_SLOTS].sort());+ }+ });++ it("anchors every slot on every silhouette", () => {+ expect(ACCESSORY_CATALOG.slots).toEqual([...ACCESSORY_SLOTS]);+ for (const shape of COMPANION_SHAPES) {+ for (const slot of ACCESSORY_SLOTS) expect(ACCESSORY_CATALOG.shapes[shape].anchors[slot]).toHaveLength(3);+ }+ for (const slot of ACCESSORY_SLOTS) expect(ACCESSORY_IDS_BY_SLOT[slot].length).toBeGreaterThan(4);+ });++ it("keeps a bare symbol at its original frame and grows only for worn items", () => {+ expect(symbolViewBox("circle", [])).toBe("0 0 40 44");+ const [x, y, w, h] = symbolViewBox("circle", wornAccessories({ head: "top_hat" })).split(" ").map(Number);+ expect(y).toBeLessThan(0);+ expect(x + w).toBeGreaterThanOrEqual(40);+ expect(w / h).toBeCloseTo(40 / 44, 3);+ });++ it("skips unknown or misplaced ids from other builds instead of failing", () => {+ expect(wornAccessories({ head: "future_hat", face: "crown", mouth: "cigar" }).map(item => item.id)).toEqual(["cigar"]);+ });++ it("draws worn items and clips clothing to the body", () => {+ const { container } = render(<AgentSymbol shape="hexagon" color="#7ab6ef" size={40} accessories={{ head: "crown", outfit: "suit", mouth: "cigar" }} />);+ const drawn = [...container.querySelectorAll("[data-accessory]")].map(node => node.getAttribute("data-accessory"));+ expect(drawn).toEqual(expect.arrayContaining(["crown", "suit", "cigar"]));+ const mask = container.querySelector("mask");+ expect(mask).not.toBeNull();+ expect(container.querySelector(`g[mask="url(#${mask!.id})"] [data-accessory="suit"]`)).not.toBeNull();+ });++ it("stores accessories with the companion and recovers older looks", () => {+ expect(companionSchema.safeParse({ shape: "drop", color: "#112233", accessories: { held: "coffee" } }).success).toBe(true);+ expect(companionSchema.safeParse({ shape: "drop", color: "#112233", accessories: { tail: "coffee" } }).success).toBe(false);+ expect(resolveCompanion("legacy", { shape: "drop", color: "#112233" }).accessories).toEqual({});+ });++ it("tints agent-colour tokens and leaves fixed colours alone", () => {+ expect(resolveFill("body", "#7ab6ef")).toBe("#7ab6ef");+ expect(resolveFill("#f2c14e", "#7ab6ef")).toBe("#f2c14e");+ expect(resolveFill("bodyDark", "#ffffff")).toBe("#b3b3b3");+ });++ it("rolls only real items, one per slot", () => {+ let seed = 1;+ const random = () => (seed = (seed * 16807) % 2147483647) / 2147483647;+ for (let i = 0; i < 50; i++) {+ for (const [slot, id] of Object.entries(randomAccessories(random))) {+ expect(ACCESSORY_IDS_BY_SLOT[slot as keyof typeof ACCESSORY_IDS_BY_SLOT]).toContain(id);+ }+ }+ });+});diff --git a/jarvis/ui/web/frontend/src/components/society/companion/accessories.ts b/jarvis/ui/web/frontend/src/components/society/companion/accessories.tsnew file mode 100644index 0000000000..adad11b7a2--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/companion/accessories.ts@@ -0,0 +1,148 @@+/**+ * Wearable accessories for the agent symbol and its map companion.+ *+ * accessories.json is generated by scripts/art/companion_accessories.py. Every+ * part is a small 3D primitive in symbol units around a slot anchor; the flat+ * symbol draws its front projection and the map companion loads the same parts+ * as meshes from accessories.glb, so both surfaces always show the same look.+ */++import catalogJson from "./accessories.json";+import type { SymbolShape } from "./appearance";++export const ACCESSORY_SLOTS = ["back", "outfit", "neck", "mouth", "face", "head", "held"] as const;+export type AccessorySlot = typeof ACCESSORY_SLOTS[number];+/** Persisted choice: at most one item per slot. */+export type AccessoryChoice = Partial<Record<AccessorySlot, string>>;++type Vec2 = [number, number];+type Vec3 = [number, number, number];+interface PartBase { fill: string; glow?: boolean; rot?: number }+export type AccessoryPart = PartBase & (+ | { t: "sphere" | "dome"; c: Vec3; r: Vec3 }+ | { t: "box"; c: Vec3; s: Vec3; round: number }+ | { t: "cyl"; c: Vec3; r: [number, number]; h: number; dz: number }+ | { t: "torus"; c: Vec3; R: number; r: number; tilt: number }+ | { t: "poly"; pts: Vec2[]; z: number; d: number; smooth: boolean }+ | { t: "tube"; pts: Vec3[]; w: number; smooth: boolean }+ | { t: "region"; pts: Vec2[]; mode: "wrap" | "front" }+);+export interface AccessoryItem {+ id: string;+ slot: AccessorySlot;+ /** Front-projection bounds around the anchor, before the shape's scale. */+ bounds: [number, number, number, number];+ /** True when some parts are patches of the body surface (clothing). */+ regions: boolean;+ parts: AccessoryPart[];+}+/** [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> }+interface Catalog {+ schema: number;+ slots: AccessorySlot[];+ slotDepth: Record<AccessorySlot, number>;+ frontDepthM: number;+ shapes: Record<SymbolShape, AccessoryShape>;+ items: AccessoryItem[];+}++export const ACCESSORY_CATALOG = catalogJson as unknown as Catalog;+export const ACCESSORY_ITEMS: readonly AccessoryItem[] = ACCESSORY_CATALOG.items;+const BY_ID = new Map(ACCESSORY_ITEMS.map(item => [item.id, item]));+export const ACCESSORY_IDS_BY_SLOT: Record<AccessorySlot, string[]> = Object.fromEntries(+ ACCESSORY_SLOTS.map(slot => [slot, ACCESSORY_ITEMS.filter(item => item.slot === slot).map(item => item.id)]),+) as Record<AccessorySlot, string[]>;++/** Slots whose parts follow the tilted face of the flat symbol. */+export const FACE_SLOTS: ReadonlySet<AccessorySlot> = new Set(["face", "mouth"]);++export function accessoryItem(id: string | undefined): AccessoryItem | undefined {+ return id ? BY_ID.get(id) : undefined;+}++/** Known items in draw order. Unknown ids (from a newer build) are skipped. */+export function wornAccessories(choice: AccessoryChoice | undefined): AccessoryItem[] {+ if (!choice) return [];+ const worn: AccessoryItem[] = [];+ for (const slot of ACCESSORY_SLOTS) {+ const item = accessoryItem(choice[slot]);+ if (item && item.slot === slot) worn.push(item);+ }+ return worn;+}++/** A light or dark tint of the agent's own colour, for token fills. */+export function shadeHex(hex: string, amount: number): string {+ const value = parseInt(hex.slice(1), 16);+ const channel = (shift: number) => {+ const c = (value >> shift) & 255;+ const next = amount < 0 ? c * (1 + amount) : c + (255 - c) * amount;+ return Math.round(Math.max(0, Math.min(255, next)));+ };+ return `#${[16, 8, 0].map(s => channel(s).toString(16).padStart(2, "0")).join("")}`;+}++export function resolveFill(fill: string, bodyColor: string): string {+ if (fill === "body") return bodyColor;+ if (fill === "bodyDark") return shadeHex(bodyColor, -0.3);+ if (fill === "bodyLight") return shadeHex(bodyColor, 0.45);+ if (fill === "ink") return "#101014";+ return fill;+}++/** Closed or open Catmull-Rom spline through the points, as SVG cubic segments. */+export function smoothPath(points: readonly Vec2[], closed: boolean): string {+ const n = points.length;+ if (n < 3) return `M${points.map(p => p.join(" ")).join(" L")}${closed ? "Z" : ""}`;+ const at = (i: number): Vec2 => closed ? points[(i + n) % n]! : points[Math.max(0, Math.min(n - 1, i))]!;+ const f = (v: number) => +v.toFixed(2);+ let d = `M${f(points[0]![0])} ${f(points[0]![1])}`;+ const segments = closed ? n : n - 1;+ for (let i = 0; i < segments; i++) {+ const p0 = at(i - 1), p1 = at(i), p2 = at(i + 1), p3 = at(i + 2);+ d += ` C${f(p1[0] + (p2[0] - p0[0]) / 6)} ${f(p1[1] + (p2[1] - p0[1]) / 6)} ${f(p2[0] - (p3[0] - p1[0]) / 6)} ${f(p2[1] - (p3[1] - p1[1]) / 6)} ${f(p2[0])} ${f(p2[1])}`;+ }+ return closed ? `${d}Z` : d;+}++/** Depth used to paint parts back to front inside one item. */+export function partDepth(part: AccessoryPart): number {+ if (part.t === "poly") return part.z;+ if (part.t === "tube") return part.pts.reduce((sum, p) => sum + p[2], 0) / part.pts.length;+ if (part.t === "region") return -Infinity;+ return part.c[2];+}++/** The symbol's viewBox, grown just enough to show every worn accessory whole. */+export function symbolViewBox(shape: SymbolShape, worn: readonly AccessoryItem[]): string {+ if (!worn.length) return "0 0 40 44";+ const anchors = ACCESSORY_CATALOG.shapes[shape].anchors;+ let x0 = 0, y0 = 0, x1 = 40, y1 = 44;+ for (const item of worn) {+ const [ax, ay, k] = anchors[item.slot];+ const [bx0, by0, bx1, by1] = item.bounds;+ if (bx0 === bx1 && by0 === by1) continue;+ // The face tilt moves points by at most ~2 units; pad instead of rotating.+ const pad = FACE_SLOTS.has(item.slot) ? 2.5 : 0.8;+ x0 = Math.min(x0, ax + bx0 * k - pad); y0 = Math.min(y0, ay + by0 * k - pad);+ x1 = Math.max(x1, ax + bx1 * k + pad); y1 = Math.max(y1, ay + by1 * k + pad);+ }+ // Keep the original 40:44 aspect so a worn item never squashes the body.+ let w = x1 - x0, h = y1 - y0;+ if (w / h < 40 / 44) { const grow = h * 40 / 44 - w; x0 -= grow / 2; w += grow; }+ else { const grow = w * 44 / 40 - h; y0 -= grow / 2; h += grow; }+ const r = (v: number) => +v.toFixed(2);+ return `${r(x0)} ${r(y0)} ${r(w)} ${r(h)}`;+}++/** A random look: each slot independently worn about every third time. */+export function randomAccessories(random: () => number = Math.random): AccessoryChoice {+ const choice: AccessoryChoice = {};+ for (const slot of ACCESSORY_SLOTS) {+ const ids = ACCESSORY_IDS_BY_SLOT[slot];+ if (ids.length && random() < (slot === "head" ? 0.7 : 0.3)) choice[slot] = ids[Math.floor(random() * ids.length)];+ }+ return choice;+}diff --git a/jarvis/ui/web/frontend/src/components/society/companion/appearance.ts b/jarvis/ui/web/frontend/src/components/society/companion/appearance.tsindex 9c3c290948..f988671454 100644--- a/jarvis/ui/web/frontend/src/components/society/companion/appearance.ts+++ b/jarvis/ui/web/frontend/src/components/society/companion/appearance.ts@@ -1,4 +1,5 @@import { z } from "zod";+import { ACCESSORY_SLOTS, type AccessoryChoice } from "./accessories";export const COMPANION_SHAPES = ["circle", "squircle", "pill", "triangle", "hexagon", "cloud", "drop"] as const;export type SymbolShape = typeof COMPANION_SHAPES[number];@@ -8,11 +9,13 @@ export const COMPANION_FOLLOW_DISTANCE_M = 1;export const companionSchema = z.object({shape: z.enum(COMPANION_SHAPES), color: z.string().regex(/^#[0-9a-fA-F]{6}$/),eyes: z.enum(["dots", "lines"]).default("lines"), enabled: z.boolean().default(true),+ // One item id per slot. Ids stay open so a newer catalog never invalidates a saved look.+ accessories: z.record(z.enum(ACCESSORY_SLOTS), z.string().regex(/^[a-z0-9_]{1,40}$/)).default({}),// Accept earlier saved slider values, but every presentation uses one scale.sizeM: z.number().finite().min(0.25).max(0.8).default(COMPANION_SIZE_M).transform(() => COMPANION_SIZE_M),followDistanceM: z.number().finite().min(0.5).max(2).default(COMPANION_FOLLOW_DISTANCE_M).transform(() => COMPANION_FOLLOW_DISTANCE_M),}).strict();-export type CompanionAppearance = z.infer<typeof companionSchema>;+export type CompanionAppearance = Omit<z.infer<typeof companionSchema>, "accessories"> & { accessories: AccessoryChoice };function identityHash(identity: string): number {let hash = 2166136261;@@ -24,7 +27,7 @@ export function defaultCompanion(identity: string): CompanionAppearance {return {shape: COMPANION_SHAPES[identityHash(`shape:${identity}`) % COMPANION_SHAPES.length]!,color: COMPANION_COLORS[identityHash(`color:${identity}`) % COMPANION_COLORS.length]!,- eyes: "lines", enabled: true, sizeM: COMPANION_SIZE_M, followDistanceM: COMPANION_FOLLOW_DISTANCE_M,+ eyes: "lines", enabled: true, accessories: {}, sizeM: COMPANION_SIZE_M, followDistanceM: COMPANION_FOLLOW_DISTANCE_M,};}diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/de.json b/jarvis/ui/web/frontend/src/i18n/locales/society/de.jsonindex 5b9c48dab3..049cbdbabc 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/society/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/de.json@@ -808,6 +808,105 @@"hexagon": "Sechseck","cloud": "Wolke","drop": "Tropfen"+ },+ "accessories": "Accessoires",+ "randomize": "Überrasch mich",+ "remove_all": "Alle entfernen",+ "none": "Nichts",+ "slots": {+ "head": "Hüte",+ "face": "Augen",+ "mouth": "Mund",+ "neck": "Hals",+ "outfit": "Outfit",+ "back": "Rücken",+ "held": "Gegenstände"+ },+ "items": {+ "crown": "Krone",+ "top_hat": "Zylinder",+ "party_hat": "Partyhut",+ "cap": "Kappe",+ "beanie": "Mütze",+ "cowboy_hat": "Cowboyhut",+ "wizard_hat": "Zauberhut",+ "halo": "Heiligenschein",+ "viking_helmet": "Wikingerhelm",+ "chef_hat": "Kochmütze",+ "grad_cap": "Doktorhut",+ "headphones": "Kopfhörer",+ "bunny_ears": "Hasenohren",+ "cat_ears": "Katzenohren",+ "devil_horns": "Teufelshörner",+ "flower": "Blume",+ "antennae": "Antennen",+ "propeller_cap": "Propellermütze",+ "santa_hat": "Weihnachtsmütze",+ "bow": "Schleife",+ "sprout": "Keimling",+ "pirate_hat": "Piratenhut",+ "sweatband": "Stirnband",+ "sunglasses": "Sonnenbrille",+ "round_glasses": "Runde Brille",+ "monocle": "Monokel",+ "eye_patch": "Augenklappe",+ "star_glasses": "Sternenbrille",+ "heart_glasses": "Herzbrille",+ "cyber_visor": "Cyber-Visier",+ "glasses_3d": "3D-Brille",+ "nerd_glasses": "Nerdbrille",+ "ski_goggles": "Skibrille",+ "blush": "Rote Wangen",+ "angry_brows": "Böse Augenbrauen",+ "raised_brows": "Hochgezogene Augenbrauen",+ "cigar": "Zigarre",+ "pipe": "Pfeife",+ "lollipop": "Lutscher",+ "mustache": "Schnurrbart",+ "beard": "Bart",+ "straw": "Strohhalm",+ "rose": "Rose",+ "bubble_gum": "Kaugummiblase",+ "smile": "Lächeln",+ "tongue": "Zunge raus",+ "bow_tie": "Fliege",+ "necktie": "Krawatte",+ "scarf": "Schal",+ "gold_chain": "Goldkette",+ "medal": "Medaille",+ "bandana": "Halstuch",+ "lei": "Blumenkette",+ "pearls": "Perlenkette",+ "collar_bell": "Glöckchenhalsband",+ "suit": "Anzug",+ "tuxedo": "Smoking",+ "lab_coat": "Laborkittel",+ "hoodie": "Hoodie",+ "jersey": "Trikot",+ "overalls": "Latzhose",+ "hawaiian_shirt": "Hawaiihemd",+ "knight_armor": "Ritterrüstung",+ "hero_suit": "Heldenanzug",+ "angel_wings": "Engelsflügel",+ "bat_wings": "Fledermausflügel",+ "cape": "Umhang",+ "jetpack": "Jetpack",+ "butterfly_wings": "Schmetterlingsflügel",+ "devil_tail": "Teufelsschwanz",+ "coffee": "Kaffee",+ "wrench": "Schraubenschlüssel",+ "magic_wand": "Zauberstab",+ "sword": "Schwert",+ "laser_sword": "Laserschwert",+ "balloon": "Luftballon",+ "flag": "Fahne",+ "book": "Buch",+ "briefcase": "Aktenkoffer",+ "trophy": "Pokal",+ "rubber_duck": "Quietscheente",+ "pizza": "Pizzastück",+ "microphone": "Mikrofon",+ "ice_cream": "Eis"}},"office": {diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/en.json b/jarvis/ui/web/frontend/src/i18n/locales/society/en.jsonindex 0250e94436..27ee84db4d 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/society/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/en.json@@ -808,6 +808,105 @@"hexagon": "Hexagon","cloud": "Cloud","drop": "Drop"+ },+ "accessories": "Accessories",+ "randomize": "Surprise me",+ "remove_all": "Remove all",+ "none": "None",+ "slots": {+ "head": "Hats",+ "face": "Eyes",+ "mouth": "Mouth",+ "neck": "Neck",+ "outfit": "Outfit",+ "back": "Back",+ "held": "Props"+ },+ "items": {+ "crown": "Crown",+ "top_hat": "Top hat",+ "party_hat": "Party hat",+ "cap": "Cap",+ "beanie": "Beanie",+ "cowboy_hat": "Cowboy hat",+ "wizard_hat": "Wizard hat",+ "halo": "Halo",+ "viking_helmet": "Viking helmet",+ "chef_hat": "Chef's hat",+ "grad_cap": "Graduation cap",+ "headphones": "Headphones",+ "bunny_ears": "Bunny ears",+ "cat_ears": "Cat ears",+ "devil_horns": "Devil horns",+ "flower": "Flower",+ "antennae": "Antennae",+ "propeller_cap": "Propeller cap",+ "santa_hat": "Santa hat",+ "bow": "Bow",+ "sprout": "Sprout",+ "pirate_hat": "Pirate hat",+ "sweatband": "Sweatband",+ "sunglasses": "Sunglasses",+ "round_glasses": "Round glasses",+ "monocle": "Monocle",+ "eye_patch": "Eye patch",+ "star_glasses": "Star glasses",+ "heart_glasses": "Heart glasses",+ "cyber_visor": "Cyber visor",+ "glasses_3d": "3D glasses",+ "nerd_glasses": "Nerd glasses",+ "ski_goggles": "Ski goggles",+ "blush": "Rosy cheeks",+ "angry_brows": "Angry brows",+ "raised_brows": "Raised brows",+ "cigar": "Cigar",+ "pipe": "Pipe",+ "lollipop": "Lollipop",+ "mustache": "Moustache",+ "beard": "Beard",+ "straw": "Straw",+ "rose": "Rose",+ "bubble_gum": "Bubble gum",+ "smile": "Smile",+ "tongue": "Tongue out",+ "bow_tie": "Bow tie",+ "necktie": "Tie",+ "scarf": "Scarf",+ "gold_chain": "Gold chain",+ "medal": "Medal",+ "bandana": "Bandana",+ "lei": "Flower garland",+ "pearls": "Pearl necklace",+ "collar_bell": "Bell collar",+ "suit": "Suit",+ "tuxedo": "Tuxedo",+ "lab_coat": "Lab coat",+ "hoodie": "Hoodie",+ "jersey": "Sports jersey",+ "overalls": "Overalls",+ "hawaiian_shirt": "Hawaiian shirt",+ "knight_armor": "Knight armour",+ "hero_suit": "Hero suit",+ "angel_wings": "Angel wings",+ "bat_wings": "Bat wings",+ "cape": "Cape",+ "jetpack": "Jetpack",+ "butterfly_wings": "Butterfly wings",+ "devil_tail": "Devil tail",+ "coffee": "Coffee",+ "wrench": "Wrench",+ "magic_wand": "Magic wand",+ "sword": "Sword",+ "laser_sword": "Laser sword",+ "balloon": "Balloon",+ "flag": "Flag",+ "book": "Book",+ "briefcase": "Briefcase",+ "trophy": "Trophy",+ "rubber_duck": "Rubber duck",+ "pizza": "Pizza slice",+ "microphone": "Microphone",+ "ice_cream": "Ice cream"}},"office": {diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/es.json b/jarvis/ui/web/frontend/src/i18n/locales/society/es.jsonindex 4d6eb682a2..6df586f1c0 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/society/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/es.json@@ -808,6 +808,105 @@"hexagon": "Hexágono","cloud": "Nube","drop": "Gota"+ },+ "accessories": "Accesorios",+ "randomize": "Sorpréndeme",+ "remove_all": "Quitar todo",+ "none": "Nada",+ "slots": {+ "head": "Sombreros",+ "face": "Ojos",+ "mouth": "Boca",+ "neck": "Cuello",+ "outfit": "Ropa",+ "back": "Espalda",+ "held": "Objetos"+ },+ "items": {+ "crown": "Corona",+ "top_hat": "Chistera",+ "party_hat": "Gorro de fiesta",+ "cap": "Gorra",+ "beanie": "Gorro de lana",+ "cowboy_hat": "Sombrero vaquero",+ "wizard_hat": "Sombrero de mago",+ "halo": "Aureola",+ "viking_helmet": "Casco vikingo",+ "chef_hat": "Gorro de chef",+ "grad_cap": "Birrete",+ "headphones": "Auriculares",+ "bunny_ears": "Orejas de conejo",+ "cat_ears": "Orejas de gato",+ "devil_horns": "Cuernos de diablo",+ "flower": "Flor",+ "antennae": "Antenas",+ "propeller_cap": "Gorra con hélice",+ "santa_hat": "Gorro de Papá Noel",+ "bow": "Lazo",+ "sprout": "Brote",+ "pirate_hat": "Sombrero pirata",+ "sweatband": "Cinta para el sudor",+ "sunglasses": "Gafas de sol",+ "round_glasses": "Gafas redondas",+ "monocle": "Monóculo",+ "eye_patch": "Parche",+ "star_glasses": "Gafas de estrella",+ "heart_glasses": "Gafas de corazón",+ "cyber_visor": "Visor cibernético",+ "glasses_3d": "Gafas 3D",+ "nerd_glasses": "Gafas de empollón",+ "ski_goggles": "Gafas de esquí",+ "blush": "Mejillas sonrojadas",+ "angry_brows": "Cejas enfadadas",+ "raised_brows": "Cejas levantadas",+ "cigar": "Puro",+ "pipe": "Pipa",+ "lollipop": "Piruleta",+ "mustache": "Bigote",+ "beard": "Barba",+ "straw": "Paja",+ "rose": "Rosa",+ "bubble_gum": "Chicle",+ "smile": "Sonrisa",+ "tongue": "Lengua fuera",+ "bow_tie": "Pajarita",+ "necktie": "Corbata",+ "scarf": "Bufanda",+ "gold_chain": "Cadena de oro",+ "medal": "Medalla",+ "bandana": "Pañuelo",+ "lei": "Collar de flores",+ "pearls": "Collar de perlas",+ "collar_bell": "Collar con cascabel",+ "suit": "Traje",+ "tuxedo": "Esmoquin",+ "lab_coat": "Bata de laboratorio",+ "hoodie": "Sudadera",+ "jersey": "Camiseta deportiva",+ "overalls": "Peto",+ "hawaiian_shirt": "Camisa hawaiana",+ "knight_armor": "Armadura",+ "hero_suit": "Traje de héroe",+ "angel_wings": "Alas de ángel",+ "bat_wings": "Alas de murciélago",+ "cape": "Capa",+ "jetpack": "Mochila cohete",+ "butterfly_wings": "Alas de mariposa",+ "devil_tail": "Cola de diablo",+ "coffee": "Café",+ "wrench": "Llave inglesa",+ "magic_wand": "Varita mágica",+ "sword": "Espada",+ "laser_sword": "Espada láser",+ "balloon": "Globo",+ "flag": "Bandera",+ "book": "Libro",+ "briefcase": "Maletín",+ "trophy": "Trofeo",+ "rubber_duck": "Patito de goma",+ "pizza": "Porción de pizza",+ "microphone": "Micrófono",+ "ice_cream": "Helado"}},"office": {diff --git a/scripts/art/build_companion_accessories.py b/scripts/art/build_companion_accessories.pynew file mode 100644index 0000000000..612ab03bd3--- /dev/null+++ b/scripts/art/build_companion_accessories.py@@ -0,0 +1,438 @@+"""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.+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).+Materials are named acc:<fill>[:glow]; fills body/bodyDark/bodyLight are tinted+from the agent colour at runtime.+"""++import json+import math+import shutil+from pathlib import Path++import bmesh+import bpy+from mathutils import Matrix, Vector++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}+++# --- small geometry helpers ------------------------------------------------------+++def catmull_rom(points, closed, steps=5):+ n = len(points)+ if n < 3:+ return list(points)+ out = []+ count = n if closed else n - 1++ def at(i):+ return points[i % n] if closed else points[max(0, min(n - 1, i))]++ for i in range(count):+ p0, p1, p2, p3 = at(i - 1), at(i), at(i + 1), at(i + 2)+ for s in range(steps):+ t = s / steps+ t2, t3 = t * t, t * t * t+ out.append(+ tuple(+ 0.5+ * (+ 2 * b+ + (-a + c) * t+ + (2 * a - 5 * b + 4 * c - d) * t2+ + (-a + 3 * b - 3 * c + d) * t3+ )+ for a, b, c, d in zip(p0, p1, p2, p3, strict=True)+ )+ )+ if not closed:+ out.append(tuple(points[-1]))+ return out+++def signed_area(poly):+ return (+ sum(a[0] * b[1] - b[0] * a[1] for a, b in zip(poly, poly[1:] + poly[:1], strict=True)) / 2+ )+++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))+++def spin_matrix(part):+ """Rotation about the view axis around the part centre, plus its translation."""+ cx, cy, cz = part["c"]+ rot = Matrix.Rotation(math.radians(part.get("rot", 0)), 4, "Y")+ return Matrix.Translation(svg_to_blender(cx, cy, cz)) @ rot+++# --- primitive builders (each returns a fresh bmesh in local space) ----------------+++def extrude_outline(outline, y_front, y_back, smooth_sides=True):+ """A flat slab: outline points are (x, z) in Blender space."""+ bm = bmesh.new()+ front = [bm.verts.new((x, y_front, z)) for x, z in outline]+ back = [bm.verts.new((x, y_back, z)) for x, z in outline]+ if signed_area(outline) < 0:+ front.reverse(), back.reverse()+ n = len(front)+ bm.faces.new(front)+ bm.faces.new(list(reversed(back)))+ for i in range(n):+ side = bm.faces.new((front[(i + 1) % n], front[i], back[i], back[(i + 1) % n]))+ side.smooth = smooth_sides+ bmesh.ops.recalc_face_normals(bm, faces=bm.faces)+ return bm+++def build_sphere(part, dome=False):+ bm = bmesh.new()+ size = max(part["r"])+ # Small beads and jewels do not need a smooth silhouette at map distance.+ u = 20 if size >= 3 else 14 if size >= 1.5 else 10+ bmesh.ops.create_uvsphere(bm, u_segments=u, v_segments=u // 2, radius=1)+ if dome:+ geom = bm.verts[:] + bm.edges[:] + bm.faces[:]+ bmesh.ops.bisect_plane(+ bm, geom=geom, plane_co=(0, 0, 0), plane_no=(0, 0, -1), clear_outer=True+ )+ bmesh.ops.holes_fill(bm, edges=[e for e in bm.edges if e.is_boundary], sides=0)+ rx, ry, rz = part["r"]+ bmesh.ops.scale(bm, vec=(rx, rz, ry), verts=bm.verts)+ for face in bm.faces:+ face.smooth = not (+ dome and abs(face.normal.z) > 0.99 and face.calc_center_median().z < 1e-4+ )+ bmesh.ops.transform(bm, matrix=spin_matrix(part), verts=bm.verts)+ return bm+++def build_box(part):+ w, h, d = part["s"]+ bm = bmesh.new()+ bmesh.ops.create_cube(bm, size=1)+ bmesh.ops.scale(bm, vec=(w, d, h), verts=bm.verts)+ bevel = min(part.get("round", 0), w / 2 * 0.98, h / 2 * 0.98, d / 2 * 0.98)+ if bevel > 0.02:+ bmesh.ops.bevel(+ bm,+ geom=bm.edges[:] + bm.verts[:],+ offset=bevel,+ segments=2,+ affect="EDGES",+ profile=0.5,+ clamp_overlap=True,+ )+ for face in bm.faces:+ face.smooth = True+ bmesh.ops.transform(bm, matrix=spin_matrix(part), verts=bm.verts)+ return bm+++def build_cyl(part):+ rb, rt = part["r"]+ bm = bmesh.new()+ bmesh.ops.create_cone(+ bm,+ cap_ends=True,+ cap_tris=False,+ segments=24,+ radius1=max(rb, 1e-4),+ radius2=max(rt, 1e-4),+ depth=part["h"],+ )+ bmesh.ops.scale(bm, vec=(1, part.get("dz", 1), 1), verts=bm.verts)+ for face in bm.faces:+ face.smooth = abs(face.normal.z) < 0.98+ bmesh.ops.transform(bm, matrix=spin_matrix(part), verts=bm.verts)+ return bm+++def build_torus(part, major_segments=28, minor_segments=8):+ big, small = part["R"], part["r"]+ bm = bmesh.new()+ rings = []+ for i in range(major_segments):+ a = i / major_segments * math.tau+ ring = []+ for j in range(minor_segments):+ b = j / minor_segments * math.tau+ r = big + small * math.cos(b)+ ring.append(bm.verts.new((r * math.cos(a), r * math.sin(a), small * math.sin(b))))+ rings.append(ring)+ for i in range(major_segments):+ for j in range(minor_segments):+ a, b = rings[i], rings[(i + 1) % major_segments]+ face = bm.faces.new(+ (a[j], b[j], b[(j + 1) % minor_segments], a[(j + 1) % minor_segments])+ )+ face.smooth = True+ bmesh.ops.recalc_face_normals(bm, faces=bm.faces)+ tilt = Matrix.Rotation(math.radians(90 - part["tilt"]), 4, "X")+ bmesh.ops.transform(bm, matrix=spin_matrix(part) @ tilt, verts=bm.verts)+ return bm+++def build_poly(part):+ pts = (+ catmull_rom(part["pts"], closed=True) if part["smooth"] else [tuple(p) for p in part["pts"]]+ )+ outline = [(x, -y) for x, y in pts]+ z, d = part["z"], part["d"]+ return extrude_outline(outline, -(z + d / 2), -(z - d / 2))+++def build_tube(part, sides=8):+ pts = (+ catmull_rom([tuple(p) for p in part["pts"]], closed=False)+ if part["smooth"]+ else part["pts"]+ )+ path = [svg_to_blender(*p) for p in pts]+ path = [p for i, p in enumerate(path) if i == 0 or (p - path[i - 1]).length > 1e-4]+ radius = part["w"] / 2+ bm = bmesh.new()+ if len(path) >= 2:+ tangent = (path[1] - path[0]).normalized()+ helper = Vector((0, 1, 0)) if abs(tangent.y) < 0.9 else Vector((1, 0, 0))+ normal = tangent.cross(helper).normalized()+ rings = []+ for i, point in enumerate(path):+ nxt = path[min(i + 1, len(path) - 1)] - path[max(i - 1, 0)]+ new_tangent = nxt.normalized()+ # Parallel transport keeps the ring from twisting along the curve.+ normal = (normal - new_tangent * normal.dot(new_tangent)).normalized()+ binormal = new_tangent.cross(normal)+ rings.append(+ [+ bm.verts.new(point + (normal * math.cos(a) + binormal * math.sin(a)) * radius)+ for a in (k / sides * math.tau for k in range(sides))+ ]+ )+ for a, b in zip(rings, rings[1:], strict=False):+ for k in range(sides):+ face = bm.faces.new((a[k], a[(k + 1) % sides], b[(k + 1) % sides], b[k]))+ face.smooth = True+ bmesh.ops.recalc_face_normals(bm, faces=bm.faces)+ for end in (path[0], path[-1]):+ bmesh.ops.create_uvsphere(+ bm, u_segments=8, v_segments=5, radius=radius, matrix=Matrix.Translation(end)+ )+ for face in bm.faces:+ face.smooth = True+ return bm+++BUILDERS = {+ "sphere": build_sphere,+ "dome": lambda p: build_sphere(p, dome=True),+ "box": build_box,+ "cyl": build_cyl,+ "torus": build_torus,+ "poly": build_poly,+ "tube": build_tube,+}+++# --- assembly ---------------------------------------------------------------------++MATERIALS = {}+++def material(fill, glow):+ key = f"acc:{fill}{':glow' if glow else ''}"+ if key in MATERIALS:+ return MATERIALS[key]+ mat = bpy.data.materials.new(key)+ mat.use_nodes = True+ bsdf = mat.node_tree.nodes.get("Principled BSDF")+ color = (0.6, 0.6, 0.6, 1)+ if fill.startswith("#"):+ srgb = [int(fill[i : i + 2], 16) / 255 for i in (1, 3, 5)]+ color = (*[c / 12.92 if c <= 0.04045 else ((c + 0.055) / 1.055) ** 2.4 for c in srgb], 1)+ bsdf.inputs["Base Color"].default_value = color+ bsdf.inputs["Roughness"].default_value = 0.55 if fill.startswith("#f") else 0.7+ if glow:+ bsdf.inputs["Emission Color"].default_value = color+ bsdf.inputs["Emission Strength"].default_value = 1.4+ mat.diffuse_color = color+ MATERIALS[key] = mat+ return mat+++def assemble(name, pieces):+ """Merge (bmesh, material) pieces into one object with one slot per material."""+ mesh = bpy.data.meshes.new(name)+ slots = []+ combined = bmesh.new()+ scratch = bpy.data.meshes.new(f"{name}.scratch")+ for piece, mat in pieces:+ if mat not in slots:+ slots.append(mat)+ index = slots.index(mat)+ for face in piece.faces:+ face.material_index = index+ piece.to_mesh(scratch)+ combined.from_mesh(scratch)+ piece.free()+ bpy.data.meshes.remove(scratch)+ combined.to_mesh(mesh)+ combined.free()+ for mat in slots:+ mesh.materials.append(mat)+ obj = bpy.data.objects.new(name, mesh)+ bpy.context.collection.objects.link(obj)+ return obj+++def region_pieces(item, shape, meta, outline):+ top, bottom = meta["top"], meta["bottom"]+ scale = 1 / (bottom - top)+ 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["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.004) / 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))+ 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 main():+ bpy.ops.object.select_all(action="SELECT")+ 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"))+ count = 0+ for item in catalog["items"]:+ pieces = [+ (BUILDERS[p["t"]](p), material(p["fill"], p.get("glow", False)))+ for p in item["parts"]+ if p["t"] != "region"+ ]+ 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)+ if pieces:+ assemble(f"acc_{item['id']}__{shape}", pieces)+ count += 1+ bpy.context.preferences.filepaths.save_version = 0+ bpy.ops.wm.save_as_mainfile(+ filepath=str(STUDY / "source/accessories.blend"), check_existing=False+ )+ export = STUDY / "exports/accessories.glb"+ bpy.ops.export_scene.gltf(+ filepath=str(export),+ export_format="GLB",+ export_animations=False,+ export_materials="EXPORT",+ )+ shutil.copyfile(export, RUNTIME_COPY)+ print("ACCESSORY_GEOMETRY_EXPORTED", count, export.stat().st_size)+++if __name__ == "__main__":+ main()diff --git a/scripts/art/companion_accessories.py b/scripts/art/companion_accessories.pynew file mode 100644index 0000000000..0f495733df--- /dev/null+++ b/scripts/art/companion_accessories.py@@ -0,0 +1,549 @@+# ruff: noqa: E501 (dense hand-authored geometry tables read better unwrapped)+"""Author the agent-symbol accessory catalog as shared primitive geometry.++One JSON file feeds both renderers: the flat profile symbol projects every part+straight onto the SVG plane, and Blender (build_companion_accessories.py) builds+the same parts as meshes for the map companion. Edit this file, then run:++ python scripts/art/companion_accessories.py+ blender --background --factory-startup --python scripts/art/build_companion_accessories.py++Coordinates are AgentSymbol SVG units relative to a slot anchor: x right,+y down, z toward the viewer. Each shape scales a slot by its own factor.+"""++from __future__ import annotations++import json+import math+from pathlib import Path++ROOT = Path(__file__).resolve().parents[2]+OUTLINES = ROOT / "art/studies/agent-symbol-companions/source/outlines.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).+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}++# Anchor points [x, y, scale] in symbol coordinates, tuned per silhouette.+ANCHORS = {+ "circle": {"head": [20, 5.2, 1], "neck": [20, 27.6, 1], "held": [33.5, 29, 1], "back": [20, 20, 1]},+ "squircle": {"head": [20, 4.4, 1], "neck": [20, 27.6, 1], "held": [34, 29, 1], "back": [20, 20, 1]},+ "pill": {"head": [20, 9.6, 0.95], "neck": [20, 26.2, 0.92], "held": [35.5, 26, 0.95], "back": [20, 20, 0.95]},+ "triangle": {"head": [20, 8.6, 0.72], "neck": [20, 30.4, 0.8], "held": [32.5, 31, 0.9], "back": [20, 22, 0.9]},+ "hexagon": {"head": [20, 5.8, 0.9], "neck": [20, 27.6, 0.95], "held": [33, 29, 0.95], "back": [20, 20, 0.95]},+ "cloud": {"head": [19.2, 6.6, 0.95], "neck": [20, 30, 0.8], "held": [37, 27.5, 0.9], "back": [21, 20, 1]},+ "drop": {"head": [20, 9.6, 0.72], "neck": [20, 33.8, 0.92], "held": [32.5, 34, 0.95], "back": [20, 25, 0.95]},+}+FACE_SCALE = {"triangle": 0.9, "cloud": 0.9}+MOUTH_DROP = 6.8+# Held props and mouth props read too small at list sizes without a boost.+HELD_BOOST, MOUTH_BOOST = 1.35, 1.15++GOLD, GOLD_DARK = "#f2c14e", "#c8922a"+INK, WHITE, CREAM = "#101014", "#f8fafc", "#f5f0e6"+RED, RED_DARK, PINK = "#e0483e", "#a8322b", "#f9a8d4"+BLUE, CYAN, GREEN = "#2f6fe0", "#22d3ee", "#5fae3a"+BROWN, BROWN_DARK, STEEL = "#8a5a32", "#4a2f1d", "#9aa3ad"+++# --- primitive builders -----------------------------------------------------++def sphere(c, r, fill, **kw):+ r = [r, r, r] if isinstance(r, (int, float)) else r+ return {"t": "sphere", "c": list(c), "r": list(r), "fill": fill, **kw}+++def dome(c, r, fill, **kw):+ """Upper half of an ellipsoid; c is the centre of its flat base."""+ return {"t": "dome", "c": list(c), "r": list(r), "fill": fill, **kw}+++def box(c, s, fill, bevel=0.0, **kw):+ return {"t": "box", "c": list(c), "s": list(s), "round": bevel, "fill": fill, **kw}+++def cyl(c, r_bottom, r_top, h, fill, dz=1.0, **kw):+ """Upright frustum; a zero radius makes a cone."""+ return {"t": "cyl", "c": list(c), "r": [r_bottom, r_top], "h": h, "dz": dz, "fill": fill, **kw}+++def torus(c, big, small, fill, tilt=0.0, **kw):+ """tilt 0 faces the viewer, 90 lies flat like a halo."""+ return {"t": "torus", "c": list(c), "R": big, "r": small, "tilt": tilt, "fill": fill, **kw}+++def poly(pts, fill, z=0.0, d=1.0, smooth=False, **kw):+ return {"t": "poly", "pts": [list(p) for p in pts], "z": z, "d": d, "smooth": smooth, "fill": fill, **kw}+++def tube(pts, w, fill, smooth=False, **kw):+ pts = [list(p) + [0.0] * (3 - len(p)) for p in pts]+ return {"t": "tube", "pts": pts, "w": w, "smooth": smooth, "fill": fill, **kw}+++def region(pts, fill, mode="wrap", **kw):+ """A convex patch of the body surface itself: clipped to the silhouette."""+ return {"t": "region", "pts": [list(p) for p in pts], "mode": mode, "fill": fill, **kw}+++def band(y0, y1, fill, mode="wrap"):+ return region([(-60, y0), (60, y0), (60, y1), (-60, y1)], fill, mode)+++# --- shape helpers ----------------------------------------------------------++def star(cx, cy, outer, inner, n=5, turn=0.0):+ pts = []+ for i in range(n * 2):+ a = math.radians(turn - 90 + i * 180 / n)+ rad = outer if i % 2 == 0 else inner+ pts.append((cx + rad * math.cos(a), cy + rad * math.sin(a)))+ return pts+++def heart(cx, cy, size):+ pts = []+ for i in range(28):+ t = i / 28 * math.tau+ x = 16 * math.sin(t) ** 3+ y = 13 * math.cos(t) - 5 * math.cos(2 * t) - 2 * math.cos(3 * t) - math.cos(4 * t)+ pts.append((cx + x * size / 17, cy - y * size / 17 + size * 0.1))+ return pts+++def mirror_x(half):+ """Close a symmetric outline from its right half (top centre to bottom centre)."""+ left = [(-x, y) for x, y in reversed(half[1:-1])]+ return list(half) + left+++def leaf(x, y, length, width, angle):+ base = [(0, 0), (length * 0.35, -width), (length, 0), (length * 0.4, width * 0.8)]+ a = math.radians(angle)+ return [(x + px * math.cos(a) - py * math.sin(a), y + px * math.sin(a) + py * math.cos(a)) for px, py in base]+++def quad_curve(p0, p1, p2, steps):+ out = []+ for i in range(steps):+ t = i / (steps - 1)+ out.append(tuple((1 - t) ** 2 * a + 2 * (1 - t) * t * b + t * t * c for a, b, c in zip(p0, p1, p2, strict=True)))+ return out+++def rotate_xy(x, y, deg):+ a = math.radians(deg)+ return x * math.cos(a) - y * math.sin(a), x * math.sin(a) + y * math.cos(a)+++def place(parts, dx=0.0, dy=0.0, rot=0.0, flip=False):+ """Move a part group: optional mirror, then rotation about the origin, then shift."""+ out = []+ for p in parts:+ q = json.loads(json.dumps(p))++ def tf(x, y):+ if flip:+ x = -x+ x, y = rotate_xy(x, y, rot)+ return x + dx, y + dy++ if "c" in q:+ q["c"][0], q["c"][1] = tf(q["c"][0], q["c"][1])+ spin = -q.get("rot", 0.0) if flip else q.get("rot", 0.0)+ if spin + rot:+ q["rot"] = spin + rot+ if "pts" in q:+ pts = [list(tf(pt[0], pt[1])) + pt[2:] for pt in q["pts"]]+ q["pts"] = list(reversed(pts)) if flip and q["t"] in ("poly", "region") else pts+ out.append(q)+ return out+++def both_sides(parts, dx, dy=0.0, rot=0.0):+ """Right copy at +dx, mirrored copy at -dx (rotation mirrored too)."""+ return place(parts, dx, dy, rot) + place(place(parts, 0, 0, rot), -dx, dy, flip=True)+++# --- catalog ----------------------------------------------------------------++def head_items():+ items = {}+ spikes = []+ for i in range(5):+ a = math.radians(i * 72)+ x, z = 8.3 * math.sin(a), 8.3 * math.cos(a)+ spikes += [cyl((x, -6.8, z), 2.7, 0, 6.2, GOLD), sphere((x, -10.4, z), 1.05, GOLD)]+ items["crown"] = [cyl((0, -2, 0), 8, 8.6, 4.4, GOLD), *spikes,+ sphere((0, -2, 8.7), [1.6, 1.6, 0.8], RED),+ sphere((-5.2, -2, 6.9), [1.1, 1.1, 0.6], BLUE), sphere((5.2, -2, 6.9), [1.1, 1.1, 0.6], BLUE)]+ items["top_hat"] = place([cyl((0, -0.6, 0), 12, 12, 1.4, "#2a2a31"),+ cyl((0, -7.8, 0), 7.6, 8, 13, "#33333b"),+ cyl((0, -2.6, 0), 7.85, 7.9, 2.8, "body")], rot=-7)+ items["party_hat"] = place([cyl((0, -7.5, 0), 6.6, 0, 15, "#f472b6"),+ sphere((-1.6, -3.2, 4.6), [1.1, 1.1, 0.5], "#fde047"),+ sphere((2.4, -4.6, 3.6), [1, 1, 0.5], CYAN),+ sphere((-0.6, -8.2, 2.6), [0.9, 0.9, 0.5], "#a78bfa"),+ sphere((0, -15.6, 0), 2.3, "#fde047")], rot=13)+ items["cap"] = [dome((0, 1.6, 0), [9.2, 8, 9.2], BLUE), sphere((0, 1.9, 8.2), [8.8, 1.4, 6.2], "#1f4fb0"),+ sphere((0, -6.4, 0), 1.2, "#1f4fb0")]+ items["beanie"] = [dome((0, 2.2, 0), [9.6, 9.8, 9.6], RED), cyl((0, 2.4, 0), 10, 10, 4, RED_DARK),+ sphere((0, -8.4, 0), 3, CREAM)]+ items["cowboy_hat"] = place([sphere((0, 0.2, 0), [15, 1.3, 12], "#a8692e"),+ sphere((-13.8, -1.1, 0), [2.4, 1.7, 5], "#a8692e"),+ sphere((13.8, -1.1, 0), [2.4, 1.7, 5], "#a8692e"),+ cyl((0, -4.6, 0), 6.9, 5.8, 8.8, "#b8773a"),+ cyl((0, -1.6, 0), 6.8, 6.6, 1.8, "#3b2414")], rot=-5)+ items["wizard_hat"] = place([sphere((0, 0, 0), [13, 1.3, 11], "#4c2a96"),+ cyl((0, -10.2, 0), 7.8, 0, 20.4, "#5b35b8"),+ cyl((0, -1.6, 0), 7.3, 7.0, 1.8, GOLD),+ poly(star(1.4, -7.6, 2.2, 0.95), GOLD, z=4.4, d=0.6, glow=True),+ sphere((-1.8, -12.4, 1.8), 0.6, GOLD, glow=True),+ sphere((0.9, -4.4, 6.2), 0.5, GOLD, glow=True)], rot=-10)+ items["halo"] = [torus((0, -7.4, 0), 8, 1.15, "#fde68a", tilt=72, glow=True)]+ items["viking_helmet"] = [dome((0, 2, 0), [9.8, 8.8, 9.8], STEEL), cyl((0, 2.2, 0), 10.1, 10.1, 2.8, "#a77b2c"),+ sphere((-4.6, 2.2, 9), 0.7, "#e7d39a"), sphere((0, 2.2, 10.1), 0.7, "#e7d39a"),+ sphere((4.6, 2.2, 9), 0.7, "#e7d39a"),+ tube([(0, -2, 0), (-0.4, -5, 0), (-0.8, -8, 0)], 0.8, "#a77b2c"),+ *both_sides([cyl((0, -4.6, 0), 2.5, 0.3, 9, "#efe4cc")], 10.4, -0.4, 34)]+ items["chef_hat"] = [cyl((0, -1.2, 0), 8.2, 8.8, 4.6, "#fafaf8"),+ sphere((-4.8, -7.8, 0), 5.4, "#f4f4f0"), sphere((4.8, -7.8, 0), 5.4, "#f4f4f0"),+ sphere((0, -10.6, 0), 6.1, "#fafaf8"), cyl((0, 0.6, 0), 8.3, 8.3, 0.8, "#e4e2dc")]+ items["grad_cap"] = [cyl((0, -2.4, 0), 7.6, 7.8, 5, "#374151"), box((0, -5.6, 0), (21, 2.2, 21), "#2b3445", 0.4),+ sphere((0, -6.5, 0), 0.9, GOLD),+ tube([(0, -6.4, 0.6), (8, -6.4, 6), (10.4, -4.6, 7.6), (10.6, 0.2, 7.6)], 0.8, GOLD, smooth=True),+ cyl((10.6, 1.6, 7.6), 1.3, 0.5, 2.8, GOLD)]+ items["headphones"] = [tube([(-12.6, 6, 0), (-11.8, -1.6, 0), (-6.6, -6.8, 0), (0, -8.2, 0), (6.6, -6.8, 0),+ (11.8, -1.6, 0), (12.6, 6, 0)], 2.2, "#26262b", smooth=True),+ sphere((-13, 7.2, 0), [2.8, 4.5, 4.4], RED), sphere((13, 7.2, 0), [2.8, 4.5, 4.4], RED)]+ ear = [poly(mirror_x([(0, -15), (2.2, -13.2), (3.4, -7), (2.6, 1.5), (0, 1.5)]), "#f5f3f0", z=0, d=2.4,+ smooth=True),+ poly(mirror_x([(0, -12.6), (1.2, -11), (1.8, -6.4), (1.3, -1), (0, -1)]), PINK, z=1.3, d=0.6, smooth=True)]+ items["bunny_ears"] = both_sides(ear, 4.8, 0, 13)+ cat = [poly([(-5.6, 2.4), (-1.8, -9.4), (5.4, 2.4)], "body", z=0, d=2.6),+ poly([(-3, 1), (-1.6, -5.8), (2.4, 1)], PINK, z=1.5, d=0.6)]+ items["cat_ears"] = both_sides(cat, 7, 0, 18)+ items["devil_horns"] = both_sides([cyl((0, -3.4, 0), 2.4, 0, 7.4, "#d42f2f")], 5.6, 0, 22)+ petals = [sphere((2.9 * math.sin(math.radians(a)), -2.9 * math.cos(math.radians(a)), 2.6), [2.5, 2.5, 1.3], PINK)+ for a in range(0, 360, 72)]+ items["flower"] = place([*petals, sphere((0, 0, 3.4), [1.7, 1.7, 1], "#fde047"),+ poly(leaf(1, 2.4, 6, 1.8, 30), GREEN, z=1.6, d=0.6, smooth=True)], -6.4, -0.6)+ antenna = [tube([(0, 1.5, 0), (0, -8.4, 0)], 1.1, "#3f3f46"), sphere((0, -9.8, 0), 2.3, "#a3e635", glow=True)]+ items["antennae"] = both_sides(antenna, 3.8, 0, 14)+ items["propeller_cap"] = [dome((0, 1.8, 0), [9.2, 7.8, 9.2], "#f43f5e"), cyl((0, 2, 0), 9.4, 9.4, 1.8, "#facc15"),+ tube([(0, -5.6, 0), (0, -8.8, 0)], 1, "#3f3f46"),+ box((0, -9.2, 0), (17.4, 1.1, 3.2), "#3b82f6", 0.5), sphere((0, -9.2, 0), 1.25, "#facc15")]+ items["santa_hat"] = [cyl((2.2, -6.2, 0), 8.6, 0.6, 13, "#d42f2f", rot=22),+ cyl((0, 1.6, 0), 9.8, 9.8, 3.8, "#fafafa"), sphere((4.8, -12.6, 0), 2.7, "#fafafa")]+ items["bow"] = place([sphere((-3.4, 0, 0), [3.6, 2.6, 1.6], "#ec4899", rot=-18),+ sphere((3.4, 0, 0), [3.6, 2.6, 1.6], "#ec4899", rot=18),+ sphere((0, 0, 0.8), [1.5, 1.7, 1.2], "#be185d")], 6.4, -0.4, 16)+ items["sprout"] = [tube([(0, 1.5, 0), (0.4, -3, 0), (0, -6.4, 0)], 1.1, GREEN, smooth=True),+ poly(leaf(0, -6.2, 7, 2.2, -150), "#84cc16", z=0, d=0.8, smooth=True),+ poly(leaf(0, -6.2, 6, 2, -30), "#84cc16", z=0, d=0.8, smooth=True)]+ items["pirate_hat"] = place([+ poly([(-14.4, 0.6), (-12.4, -5.6), (-6.4, -9.4), (0, -8.4), (6.4, -9.4), (12.4, -5.6), (14.4, 0.6),+ (6.4, -1.4), (0, -1), (-6.4, -1.4)], "#34343e", z=0, d=8, smooth=True),+ tube([(-13.8, 0, 4.1), (-6.4, -1.8, 4.1), (0, -1.4, 4.1), (6.4, -1.8, 4.1), (13.8, 0, 4.1)], 0.9, GOLD,+ smooth=True),+ sphere((0, -5, 4.3), [2.3, 2.1, 0.6], "#f4f4f5"), box((0, -2.8, 4.3), (2, 1.2, 0.6), "#f4f4f5", 0.3),+ sphere((-0.8, -5.2, 4.9), 0.5, INK), sphere((0.8, -5.2, 4.9), 0.5, INK)], rot=-4)+ items["sweatband"] = [band(1.2, 4.4, RED), band(2.4, 3.2, "#fafafa", mode="front")]+ return items+++def face_items():+ items = {}+ bridge = lambda fill, w=0.9: tube([(-1.3, -0.6, 0.8), (0, -1.3, 0.8), (1.3, -0.6, 0.8)], w, fill, smooth=True) # noqa: E731+ items["sunglasses"] = [*both_sides([box((0, 0.2, 0.9), (7.6, 5.6, 1.2), "#121216", 2.2),+ tube([(-2.2, -1, 1.6), (-0.9, -2, 1.6)], 0.7, "#e7e7ea")], 4.9),+ bridge("#121216")]+ items["round_glasses"] = [*both_sides([torus((0, 0, 0.7), 3.6, 0.55, "#b07a2a")], 4.9), bridge("#b07a2a", 0.75)]+ items["monocle"] = [torus((4.8, 0, 0.8), 4, 0.65, GOLD),+ tube([(8.4, 1.6, 0.7), (9.4, 5.4, 0.5), (8.2, 9.6, 0.3)], 0.45, GOLD, smooth=True)]+ items["eye_patch"] = [sphere((-4.8, 0.2, 0.7), [3.9, 3.5, 0.6], "#18181b"),+ tube([(-14, 2.6, -1), (-8.6, 0.4, 0.5), (-4.8, -1, 1), (0, -3.4, 0.6), (7, -5.6, 0.3),+ (14, -6.4, -1)], 0.8, "#18181b", smooth=True)]+ items["star_glasses"] = [*both_sides([poly(star(0, 0, 4.7, 2.3), "#facc15", z=0.9, d=0.9)], 5.2),+ bridge("#facc15")]+ items["heart_glasses"] = [*both_sides([poly(heart(0, 0, 4.6), "#ef4444", z=0.9, d=0.9, smooth=True)], 5.1),+ bridge("#ef4444")]+ items["cyber_visor"] = [box((0.2, 0, 0.9), (20.4, 5.8, 1.4), "#1e293b", 2.7),+ box((0.2, 0, 1.7), (15, 1.1, 0.3), CYAN, 0.5, glow=True)]+ items["glasses_3d"] = [box((0, 0, 0.6), (19.4, 6.4, 0.9), WHITE, 1),+ box((-4.8, 0, 1.2), (7, 4.4, 0.4), "#ef4444", 0.6),+ box((4.8, 0, 1.2), (7, 4.4, 0.4), CYAN, 0.6)]+ frame = [tube([(-3.8, -3), (3.8, -3), (3.8, 3.1), (-3.8, 3.1), (-3.8, -3)], 1.3, "#18181b")]+ items["nerd_glasses"] = [*both_sides(frame, 5), box((0, -1, 1.1), (2.8, 2.2, 0.6), "#f5f5f4", 0.3)]+ items["ski_goggles"] = [box((0, 0, 0.4), (21.4, 8.6, 1), "#e5e7eb", 3.9),+ box((0, 0, 1.1), (19.2, 6.8, 0.8), "#fb923c", 3.2),+ tube([(-6.4, -1.6, 1.6), (-3.6, -2.6, 1.6)], 0.8, "#fff7ed"),+ *both_sides([tube([(0, 0, 0.4), (4.6, 0.6, -2)], 2.6, "#1f2937")], 10.6)]+ items["blush"] = both_sides([sphere((0, 4.6, 0.3), [2.6, 1.5, 0.4], "#fb7185")], 7.6)+ items["angry_brows"] = both_sides([tube([(-2.6, -6.4, 0.4), (2.4, -4.4, 0.4)], 1.4, INK)], -5.2)+ items["raised_brows"] = both_sides([tube([(-2.6, -5.2, 0.4), (0, -6.8, 0.4), (2.4, -5.8, 0.4)], 1.2, INK,+ smooth=True)], 5.0)+ return items+++def mouth_items():+ items = {}+ smoke = lambda x, y: tube([(x, y, 1.4), (x + 1.6, y - 3, 1.5), (x + 0.2, y - 6.2, 1.6), (x + 2, y - 9.6, 1.7)], # noqa: E731+ 0.85, "#d4d4d8", smooth=True)+ items["cigar"] = [tube([(0.6, 0, 0.6), (10, 2.4, 1.2)], 3, "#7a4a26"),+ tube([(2.7, 0.55, 0.7), (3.6, 0.8, 0.8)], 3.2, GOLD),+ tube([(10.1, 2.43, 1.2), (11.1, 2.7, 1.3)], 2.95, "#f97316", glow=True),+ smoke(11.6, 1.2)]+ items["pipe"] = [tube([(0.6, 0, 0.6), (6.6, 1.6, 1.2)], 1.3, "#3b2617"),+ cyl((8, 0.4, 1.2), 1.9, 2.3, 4.4, "#7a4a26"), sphere((8, -1.8, 1.2), [2.1, 0.5, 2.1], "#27272a"),+ smoke(8, -2.6)]+ items["lollipop"] = [tube([(0.4, 0, 0.6), (6.6, 2.8, 1.4)], 0.9, "#fafafa"),+ sphere((8.8, 3.8, 1.6), [3.4, 3.4, 0.9], "#f472b6"),+ torus((8.8, 3.8, 2.4), 1.8, 0.45, "#fafafa")]+ items["mustache"] = [poly(mirror_x([(0, -2.2), (2.4, -3.2), (5, -2.4), (7.6, -2), (9.6, -4), (9.6, -0.8),+ (6.8, 0.6), (3.4, 0.2), (0, 0)]), BROWN_DARK, z=0.7, d=1, smooth=True)]+ items["beard"] = [poly(mirror_x([(0, 0.6), (5.4, -0.4), (9.4, -3.6), (11.4, -2.4), (10.6, 4.4), (6.6, 9.6),+ (0, 11.4)]), "#7a4a26", z=0.6, d=1.4, smooth=True),+ poly(mirror_x([(0, -2), (3, -3), (6, -1.8), (6.6, 0.2), (3, 0), (0, 0.4)]), BROWN_DARK, z=1.6,+ d=0.8, smooth=True)]+ items["straw"] = [tube([(0.4, 0, 0.6), (7.6, -2.4, 1.2), (12.6, -3.6, 1.4)], 0.8, "#eab308", smooth=True),+ sphere((13.4, -3.8, 1.4), [1.7, 0.8, 0.8], "#ca8a04", rot=-12)]+ items["rose"] = [tube([(0.4, 0, 0.6), (10, 2.4, 1.2)], 0.9, "#16a34a"),+ poly(leaf(5, 1.4, 4, 1.4, 40), "#22c55e", z=1, d=0.5, smooth=True),+ sphere((11.4, 2.6, 1.4), 2.7, "#e11d48"), torus((11.4, 2.6, 3.8), 1.3, 0.42, "#9f1239")]+ items["bubble_gum"] = [sphere((0.4, 0.6, 3.2), [4.6, 4.6, 3.6], PINK), sphere((-1, -1, 6.4), [1, 1, 0.5], WHITE)]+ items["smile"] = [tube([(-3.2, -0.8, 0.4), (0, 1.4, 0.4), (3.2, -0.8, 0.4)], 1.2, INK, smooth=True)]+ items["tongue"] = [poly([(-1.6, 0), (1.6, 0), (1.8, 2.6), (0, 3.7), (-1.8, 2.6)], "#fb7185", z=0.3, d=0.6,+ smooth=True),+ tube([(-2.8, -0.4, 0.6), (0, 0.5, 0.6), (2.8, -0.4, 0.6)], 1.1, INK, smooth=True)]+ return items+++def neck_items():+ items = {}+ bowtie = lambda fill, knot, s=1.0: [ # noqa: E731+ poly([(0, -1 * s), (5 * s, -3.2 * s), (5.8 * s, 0), (5 * s, 3.2 * s), (0, 1 * s), (-5 * s, 3.2 * s),+ (-5.8 * s, 0), (-5 * s, -3.2 * s)], fill, z=0.8, d=1.2),+ sphere((0, 0, 1.4), [1.4 * s, 1.6 * s, 0.8], knot)]+ items["bow_tie"] = bowtie("#dc2626", "#991b1b")+ items["necktie"] = [poly([(-1.7, -0.8), (1.7, -0.8), (1.1, 1.9), (-1.1, 1.9)], "#2563eb", z=0.8, d=1),+ region([(-1.1, 1.8), (1.1, 1.8), (2.5, 9.2), (0, 11.4), (-2.5, 9.2)], "#2563eb", mode="front"),+ region([(-60, 4.6), (60, 4.6), (60, 5.6), (-60, 5.6)], "#facc15", mode="front")]+ # The stripe above is clipped to the tie only in the flat symbol; keep it subtle.+ items["necktie"][2] = region([(-1.6, 4.6), (1.6, 4.6), (1.9, 5.8), (-1.9, 5.8)], "#facc15", mode="front")+ items["scarf"] = [band(-1.6, 2.6, RED),+ poly([(3, 1.2), (6.6, 1.2), (7.2, 8.8), (3.6, 9)], "#d0362d", z=0.9, d=1.2),+ tube([(3.4, 6, 1.6), (6.9, 5.8, 1.6)], 0.8, "#fafafa")]+ chain = quad_curve((-8.6, -2.2), (0, 7.6), (8.6, -2.2), 9)+ items["gold_chain"] = [tube([(x, y, 0.5) for x, y in chain], 0.9, GOLD, smooth=True),+ sphere((0, 4.6, 0.9), [2.3, 2.3, 0.6], GOLD), sphere((0, 4.6, 1.4), [1.2, 1.2, 0.4], GOLD_DARK)]+ items["medal"] = [tube([(-3.2, -2.4, 0.5), (0, 2.6, 0.6)], 1.8, "#2563eb"),+ tube([(3.2, -2.4, 0.5), (0, 2.6, 0.6)], 1.8, "#dc2626"),+ sphere((0, 4.4, 1), [2.6, 2.6, 0.6], GOLD), poly(star(0, 4.4, 1.6, 0.7), GOLD_DARK, z=1.6, d=0.3)]+ items["bandana"] = [band(-1, 1.4, "#dc2626"), region([(-5.6, 0), (5.6, 0), (0, 7)], "#dc2626", mode="front"),+ sphere((-2, 1.8, 0.8), 0.6, WHITE), sphere((2, 1.8, 0.8), 0.6, WHITE),+ sphere((0, 4.4, 0.8), 0.6, WHITE)]+ lei_colors = ["#f472b6", "#facc15", "#fb923c", "#a78bfa"]+ items["lei"] = [sphere((x, y, 0.9), [1.7, 1.7, 1], lei_colors[i % 4])+ for i, (x, y) in enumerate(quad_curve((-9.6, -2), (0, 8.4), (9.6, -2), 9))]+ items["pearls"] = [sphere((x, y, 0.7), 0.95, "#f4f1ea") for x, y in quad_curve((-8.8, -2.2), (0, 7), (8.8, -2.2), 13)]+ items["collar_bell"] = [band(-0.8, 1.2, "#dc2626"), sphere((0, 2.8, 1.2), 2, GOLD),+ tube([(-0.9, 3.6, 3), (0.9, 3.6, 3)], 0.5, "#6b4b12")]+ return items+++def outfit_items():+ items = {}+ jacket = lambda fill, top=-0.6: region([(-60, top), (60, top), (60, 60), (-60, 60)], fill) # noqa: E731+ items["suit"] = [jacket("#1f2a44"), region([(-3.4, -0.7), (3.4, -0.7), (0, 7.2)], WHITE, mode="front"),+ region([(-0.9, -0.2), (0.9, -0.2), (1.5, 5), (0, 6.4), (-1.5, 5)], "#dc2626", mode="front")]+ items["tuxedo"] = [jacket("#141418"), region([(-4, -0.7), (4, -0.7), (0, 8.2)], WHITE, mode="front"),+ poly([(0, -0.5), (3, -1.8), (3.4, 0.6), (3, 1.9), (0, 0.6), (-3, 1.9), (-3.4, 0.6), (-3, -1.8)],+ "#141418", z=0.9, d=0.8),+ sphere((0, 3.4, 0.7), 0.5, INK), sphere((0, 5.2, 0.7), 0.5, INK)]+ items["lab_coat"] = [jacket("#f1f2f4"), region([(-3, -0.7), (3, -0.7), (0, 5.8)], "#93c5fd", mode="front"),+ region([(4.2, 3), (8, 3), (8, 6.4), (4.2, 6.4)], "#dcdee3", mode="front"),+ tube([(5.2, 2, 0.6), (5.2, 4.4, 0.6)], 0.8, BLUE)]+ items["hoodie"] = [jacket("#6b7280"), region([(-6, 4), (6, 4), (7.6, 9.4), (-7.6, 9.4)], "#4b5563", mode="front"),+ *both_sides([tube([(0, -0.4, 0.5), (-0.2, 3.6, 0.5)], 0.7, "#f4f4f5"),+ sphere((-0.2, 4, 0.7), 0.6, "#f4f4f5")], 1.8)]+ items["jersey"] = [jacket("#dc2626"), band(3, 4.8, "#fafafa", mode="front"),+ region([(-2.6, -0.7), (2.6, -0.7), (0, 2.6)], "#fafafa", mode="front"),+ poly(star(0, 8, 2.2, 1), "#fafafa", z=0.4, d=0.4)]+ items["overalls"] = [region([(-60, 3.4), (60, 3.4), (60, 60), (-60, 60)], "#3b5b9a"),+ region([(-5, 0.8), (5, 0.8), (5, 3.6), (-5, 3.6)], "#3b5b9a", mode="front"),+ *both_sides([region([(-1, -1.2), (1, -1.2), (1, 1), (-1, 1)], "#3b5b9a", mode="front"),+ sphere((0, 1.4, 0.8), 0.75, GOLD)], 5),+ region([(-2.2, 4.6), (2.2, 4.6), (2.2, 7), (-2.2, 7)], "#2f4a80", mode="front")]+ flower = lambda x, y: [sphere((x + 1.1 * math.sin(math.radians(a)), y - 1.1 * math.cos(math.radians(a)), 0.6), # noqa: E731+ [0.9, 0.9, 0.4], PINK) for a in range(0, 360, 72)] + [+ sphere((x, y, 0.9), 0.55, "#fde047")]+ items["hawaiian_shirt"] = [jacket("#14b8a6"), region([(-3.6, -0.7), (3.6, -0.7), (0, 5)], WHITE, mode="front"),+ *flower(-5.6, 3.2), *flower(5.4, 4.6), *flower(-1.2, 7.4)]+ items["knight_armor"] = [jacket(STEEL), region([(-6, 0.4), (6, 0.4), (5, 9), (0, 11.4), (-5, 9)], "#cbd5e1",+ mode="front"),+ region([(-0.6, 0.4), (0.6, 0.4), (0.6, 11), (-0.6, 11)], "#94a3b8", mode="front"),+ sphere((-4.2, 1.6, 0.7), 0.6, "#64748b"), sphere((4.2, 1.6, 0.7), 0.6, "#64748b")]+ items["hero_suit"] = [jacket("#2563eb"), region([(0, 0.6), (4.6, 4.4), (0, 8.8), (-4.6, 4.4)], "#facc15",+ mode="front"),+ region([(0, 2.4), (2.4, 4.4), (0, 6.6), (-2.4, 4.4)], "#dc2626", mode="front")]+ return items+++def back_items():+ items = {}+ angel = poly([(0, 0), (4, -6), (10, -10), (16.4, -11), (15, -6.4), (17.4, -4.2), (14, -1.2), (15.4, 2.2),+ (10, 3.2), (6, 4.6)], "#f8fafc", z=-1, d=1.6, smooth=True)+ items["angel_wings"] = both_sides([angel], 8.6, -2)+ bat = poly([(0, 0), (4, -7), (10, -11), (18.4, -9.4), (15.6, -5.4), (17.4, -1.6), (13.4, -2.8), (12.4, 1.8),+ (8.4, -0.4), (5, 3.2)], "#4c1d95", z=-1, d=1.4)+ items["bat_wings"] = both_sides([bat], 8.6, -2)+ items["cape"] = [poly([(-12, -11), (12, -11), (17.6, 6), (21, 21.4), (10, 19.6), (0, 21.8), (-10, 19.6), (-21, 21.4),+ (-17.6, 6)], "#b91c1c", z=-1.2, d=1.2, smooth=True)]+ jet = [cyl((0, 1, -4), 3.8, 3.8, 24, "#9ca3af"), dome((0, -11, -4), [3.8, 2.8, 3.8], "#b8c0c8"),+ cyl((0, 13.8, -4), 2.3, 3, 2.6, "#52525b"),+ cyl((0, 19.6, -4), 0, 2.7, 9, "#fb923c", glow=True), cyl((0, 18.2, -3.4), 0, 1.5, 5, "#fde047", glow=True)]+ items["jetpack"] = both_sides(jet, 9.6)+ upper = poly([(0, 0), (5, -8.4), (12.4, -11.6), (15.6, -6.4), (10.6, -0.8)], "#f59e0b", z=-1, d=1, smooth=True)+ lower = poly([(0, 1), (9.4, 2.4), (11.4, 7.6), (5, 8.6)], "#fb923c", z=-1.1, d=1, smooth=True)+ dots = [sphere((10.6, -6.6, -0.2), [1.4, 1.4, 0.4], "#fff7ed"), sphere((8, 5, -0.4), [1, 1, 0.4], "#7c2d12")]+ items["butterfly_wings"] = both_sides([upper, lower, *dots], 7.6, -1)+ items["devil_tail"] = [tube([(4, 13, -1), (12, 17, -1), (19.4, 12.4, -1), (19, 5.4, -1)], 2, "#d42f2f",+ smooth=True),+ poly([(19, 0.6), (22.4, 6.2), (19, 5), (15.6, 6.2)], "#d42f2f", z=-1, d=1.2)]+ return items+++def held_items():+ items = {}+ items["coffee"] = [cyl((3.2, 0, 0), 2.6, 3.1, 6, "#fafaf9"), cyl((3.2, 0.3, 0), 2.76, 2.96, 2.6, "#a8692e"),+ cyl((3.2, -3.4, 0), 3.3, 3.2, 1, "#e7e5e4"),+ tube([(3, -4.6, 0), (4.4, -6.8, 0), (3, -9, 0), (4.4, -11, 0)], 0.8, "#d4d4d8", smooth=True)]+ items["wrench"] = place([tube([(0, 4, 0), (0, -5, 0)], 2, "#9ca3af"),+ poly([(-2.2, -4.4), (-2.6, -8), (-1, -9.6), (-0.6, -7), (0.6, -7), (1, -9.6), (2.6, -8),+ (2.2, -4.4)], "#9ca3af", z=0, d=1.6)], 4, 0, 30)+ sparkle = [poly(star(9.2, -8.6, 2.1, 0.8, 4), GOLD, z=0.4, d=0.4, glow=True),+ poly(star(11.6, -5, 1.3, 0.5, 4), GOLD, z=0.4, d=0.4, glow=True),+ poly(star(7.4, -11.4, 1.1, 0.45, 4), GOLD, z=0.4, d=0.4, glow=True)]+ items["magic_wand"] = [tube([(0.6, 3, 0), (6.4, -5.4, 0)], 1.2, "#18181b"),+ tube([(5.7, -4.4, 0), (6.4, -5.4, 0)], 1.25, WHITE), *sparkle]+ items["sword"] = place([poly([(-1, 1), (1, 1), (1, -11.4), (0, -14), (-1, -11.4)], "#e5e7eb", z=0, d=0.8),+ box((0, 1.7, 0), (7, 1.4, 1.6), GOLD, 0.6), tube([(0, 2.6, 0), (0, 5.6, 0)], 1.4, BROWN),+ sphere((0, 6.2, 0), 1.1, GOLD)], 4, 0, 18)+ items["laser_sword"] = place([tube([(0, 6, 0), (0, 1.8, 0)], 1.9, "#52525b"),+ tube([(0, 2.6, 0), (0, 3.2, 0)], 2.1, "#27272a"),+ tube([(0, 1.2, 0), (0, -14, 0)], 1.9, CYAN, glow=True),+ tube([(0, 1.2, 0.3), (0, -13.6, 0.3)], 0.8, "#ecfeff", glow=True)], 4, 0, 15)+ items["balloon"] = [tube([(1, 2, 0), (2.4, -3, 0), (1.6, -7.6, 0), (3.2, -11.4, 0)], 0.45, "#71717a", smooth=True),+ sphere((3.4, -11.6, 0), [0.9, 0.7, 0.9], RED),+ sphere((3.6, -17, 0), [4.6, 5.4, 4.6], RED), sphere((2, -19, 3.6), [1, 1.5, 0.6], "#fecaca")]+ items["flag"] = [tube([(1, 4, 0), (1, -14, 0)], 0.9, "#a1a1aa"), sphere((1, -14.6, 0), 1, GOLD),+ poly([(1.4, -13.6), (5, -14.6), (8.6, -13), (11.8, -14), (11.8, -7.4), (8.6, -6.4), (5, -8),+ (1.4, -7)], "body", z=0, d=0.6, smooth=True)]+ items["book"] = [box((4, 0, 0), (6.2, 7.8, 2.4), "#2563eb", 0.5), box((6.9, 0, 0), (0.7, 7, 1.9), "#fafaf9", 0.1),+ box((3.7, -1.8, 1.25), (3.4, 0.7, 0.1), GOLD, 0.2)]+ items["briefcase"] = [box((4, 1, 0), (9, 6.6, 2.6), "#7a4a26", 0.9), torus((4, -2.6, 0), 1.8, 0.5, "#3b2617"),+ box((4, -1.2, 1.35), (1.6, 1, 0.3), GOLD, 0.2)]+ items["trophy"] = [cyl((4, -4.4, 0), 1.6, 3.8, 5.6, GOLD), torus((0.8, -4.8, 0), 1.6, 0.5, GOLD),+ torus((7.2, -4.8, 0), 1.6, 0.5, GOLD), cyl((4, -0.4, 0), 0.8, 0.8, 2.6, GOLD_DARK),+ box((4, 2, 0), (5.6, 2, 2.6), "#5b3a1e", 0.4), poly(star(4, -4.4, 1.3, 0.55), "#fff7d6", z=2.1, d=0.3)]+ items["rubber_duck"] = [sphere((4.4, 0, 0), [4, 3, 3.2], "#facc15"), sphere((2.6, -3.6, 0), 2.4, "#facc15"),+ sphere((0.2, -3.4, 0.4), [1.4, 0.7, 1], "#fb923c"), sphere((2, -4.2, 2), 0.5, INK)]+ items["pizza"] = place([poly([(-4.4, -4.4), (4.4, -4.4), (0, 6)], "#fcd34d", z=0, d=1),+ tube([(-4.6, -4.8, 0), (4.6, -4.8, 0)], 2, "#b45309"),+ sphere((-1.4, -2, 0.6), [1.1, 1.1, 0.3], "#dc2626"),+ sphere((1.6, -1.4, 0.6), [1.1, 1.1, 0.3], "#dc2626"),+ sphere((0, 1.6, 0.6), [1, 1, 0.3], "#dc2626")], 5, -1, -15)+ items["microphone"] = place([tube([(0, 6, 0), (0, -1, 0)], 1.8, "#27272a"),+ cyl((0, -1.2, 0), 1.4, 1.8, 1, "#3f3f46"), sphere((0, -3.6, 0), 2.6, "#a1a1aa")],+ 4, 0, 12)+ items["ice_cream"] = [cyl((4, 2.4, 0), 0, 2.8, 7, "#d6a15c"), sphere((4, -2, 0), 3, PINK),+ sphere((4, -5.4, 0), 2.6, "#86efac"), sphere((4, -8.4, 0.4), 1, "#dc2626")]+ return items+++# --- bounds -------------------------------------------------------------------++def outline_2d(part):+ """Approximate the part's front projection as points, for the symbol viewBox."""+ t = part["t"]+ if t == "region":+ return []+ if t in ("poly",):+ return [tuple(p) for p in part["pts"]]+ if t == "tube":+ w = part["w"] / 2+ return [(x + dx, y + dy) for x, y, _ in part["pts"] for dx, dy in ((-w, -w), (w, w))]+ cx, cy = part["c"][0], part["c"][1]+ if t in ("sphere", "dome"):+ rx, ry = part["r"][0], part["r"][1]+ pts = [(rx * math.cos(a), ry * math.sin(a)) for a in (i * math.tau / 16 for i in range(16))]+ if t == "dome":+ pts = [(x, min(y, 0)) for x, y in pts]+ elif t == "box":+ w, h = part["s"][0] / 2, part["s"][1] / 2+ pts = [(-w, -h), (w, -h), (w, h), (-w, h)]+ elif t == "cyl":+ rb, rt = part["r"]+ h = part["h"] / 2+ pts = [(-rb, h), (rb, h), (rt, -h), (-rt, -h)]+ else: # torus+ big, small = part["R"] + part["r"], part["R"] * abs(math.cos(math.radians(part["tilt"]))) + part["r"]+ pts = [(-big, -small), (big, -small), (big, small), (-big, small)]+ rot = part.get("rot", 0)+ return [(cx + x2, cy + y2) for x2, y2 in (rotate_xy(x, y, rot) for x, y in pts)]+++def bounds(parts):+ pts = [p for part in parts for p in outline_2d(part)]+ if not pts:+ return [0, 0, 0, 0]+ xs, ys = [p[0] for p in pts], [p[1] for p in pts]+ return [round(min(xs), 2), round(min(ys), 2), round(max(xs), 2), round(max(ys), 2)]+++def rounded(value):+ if isinstance(value, float):+ return round(value, 3)+ if isinstance(value, list):+ return [rounded(v) for v in value]+ if isinstance(value, dict):+ return {k: rounded(v) for k, v in value.items()}+ return value+++def main():+ outlines = json.loads(OUTLINES.read_text(encoding="utf-8"))+ shapes = {}+ for name, anchors in ANCHORS.items():+ ys = [y for _, y in outlines[name]]+ eye = EYE_Y.get(name, 17.2)+ face_k = FACE_SCALE.get(name, 1)+ shapes[name] = {+ "top": round(min(ys), 3), "bottom": round(max(ys), 3), "eyeY": eye,+ "anchors": {**anchors, "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)],+ "outfit": anchors["neck"]},+ }+ groups = {"head": head_items(), "face": face_items(), "mouth": mouth_items(), "neck": neck_items(),+ "outfit": outfit_items(), "back": back_items(), "held": held_items()}+ items = []+ for slot in ["head", "face", "mouth", "neck", "outfit", "back", "held"]:+ for item_id, parts in groups[slot].items():+ items.append({"id": item_id, "slot": slot, "bounds": bounds(parts),+ "regions": any(p["t"] == "region" for p in parts), "parts": parts})+ ids = [item["id"] for item in items]+ assert len(ids) == len(set(ids)), "accessory ids must be unique"+ catalog = {"schema": 1, "slots": SLOTS, "slotDepth": SLOT_DEPTH, "frontDepthM": 0.25, "shapes": shapes,+ "items": items}+ OUTPUT.write_text(json.dumps(rounded(catalog), separators=(",", ":")) + "\n", encoding="utf-8")+ print(f"{len(items)} accessories -> {OUTPUT.relative_to(ROOT)}")+++if __name__ == "__main__":+ main()diff --git a/tests/contract/fixtures/agent-companion.json b/tests/contract/fixtures/agent-companion.jsonindex e0d5cce1bf..480dabb9ff 100644--- a/tests/contract/fixtures/agent-companion.json+++ b/tests/contract/fixtures/agent-companion.json@@ -2,7 +2,8 @@"valid": [{"shape":"circle","color":"#8b5cf6"},{"shape":"cloud","color":"#112233","eyes":"lines","enabled":false,"sizeM":0.25,"followDistanceM":2},- {"shape":"drop","color":"#FFAA00","eyes":"dots","enabled":true,"sizeM":0.8,"followDistanceM":0.5}+ {"shape":"drop","color":"#FFAA00","eyes":"dots","enabled":true,"sizeM":0.8,"followDistanceM":0.5},+ {"shape":"hexagon","color":"#7ab6ef","accessories":{"head":"crown","mouth":"cigar","outfit":"suit","held":"future_item_2"}}],"invalid": [{"shape":"unknown","color":"#123456"},@@ -14,6 +15,11 @@{"shape":"circle","color":"#123456","sizeM":0},{"shape":"circle","color":"#123456","followDistanceM":-1},{"shape":"circle","color":"#123456","followDistanceM":"1"},- {"shape":"circle","color":"#123456","url":"https://example.org"}+ {"shape":"circle","color":"#123456","url":"https://example.org"},+ {"shape":"circle","color":"#123456","accessories":{"nose":"clown"}},+ {"shape":"circle","color":"#123456","accessories":{"head":"Crown"}},+ {"shape":"circle","color":"#123456","accessories":{"head":"../../etc"}},+ {"shape":"circle","color":"#123456","accessories":{"head":7}},+ {"shape":"circle","color":"#123456","accessories":["crown"]}]}diff --git a/tests/contract/test_agent_companion.py b/tests/contract/test_agent_companion.pyindex 76ca7b33c9..7c3b327b8a 100644--- a/tests/contract/test_agent_companion.py+++ b/tests/contract/test_agent_companion.py@@ -1,18 +1,23 @@"""Avatar JSON companion parity, SQLite persistence and headless API round trips."""import json+import refrom pathlib import Path+from typing import get_argsimport pytestfrom fastapi import FastAPIfrom fastapi.testclient import TestClientfrom pydantic import ValidationError-from jarvis.society.companion import CompanionAppearance, validate_avatar_companion+from jarvis.society.companion import AccessorySlot, CompanionAppearance, validate_avatar_companionfrom jarvis.society.runtime import SocietyRuntimefrom jarvis.ui.web.society_routes import routerCASES = json.loads((Path(__file__).parent / "fixtures/agent-companion.json").read_text())+CATALOG = Path(__file__).resolve().parents[2] / (+ "jarvis/ui/web/frontend/src/components/society/companion/accessories.json"+)@pytest.mark.parametrize("case", CASES["valid"])@@ -26,6 +31,22 @@ def test_shared_companion_contract_rejects(case):CompanionAppearance.model_validate(case)+def test_accessory_slots_and_ids_match_the_frontend_catalog():+ catalog = json.loads(CATALOG.read_text(encoding="utf-8"))+ assert list(get_args(AccessorySlot)) == catalog["slots"]+ ids = [item["id"] for item in catalog["items"]]+ assert len(ids) == len(set(ids))+ assert all(re.fullmatch(r"[a-z0-9_]{1,40}", item_id) for item_id in ids)+ assert {item["slot"] for item in catalog["items"]} == set(catalog["slots"])+++def test_worn_accessories_survive_and_bare_looks_stay_unchanged():+ worn = validate_avatar_companion({"companion": CASES["valid"][3]})["companion"]+ assert worn["accessories"] == CASES["valid"][3]["accessories"]+ bare = validate_avatar_companion({"companion": CASES["valid"][0]})["companion"]+ assert "accessories" not in bare++def test_legacy_and_imported_characters_survive_companion_validation():old = {"contract": 1,