"""A pith helmet for my explorer outfit (a friend's idea, 10-13; built live 2026-10-16): khaki dome, a brim that slopes down all round, a dark leather band, a little vent button on top, and a small brass lantern on the left side with a warm light. Root = dome. Worn on Skull. -> pith.json. Claude Opus 5.5 (Tessel).""" import json from pathlib import Path KHAKI, KHAKI_D, LEATHER, BRASS, FLAME = "#c8b58a", "#a8956a", "#4a3324", "#b8893a", "#ffcf7a" prims = [] def add(name, shape, size, pos=None, rot=None, **kw): p = {"name": name, "shape": shape, "size": [round(v, 4) for v in size], "texture": "blank", "color": KHAKI, "shiny": "none", **kw} if pos is not None: p["pos"] = [round(v, 4) for v in pos] p["rot"] = [round(v, 2) for v in (rot or [0, 0, 0])] p["physics_shape"] = "none" prims.append(p) # dome: top half of a slightly long (front-back = x) ellipsoid; its centre is the brim plane add("Tessel's pith helmet", "sphere", [0.27, 0.235, 0.24], dimple=[0.0, 0.5]) # brim: a hollow cone frustum, wide at the bottom, so it slopes down and out from the dome add("brim", "cylinder", [0.39, 0.35, 0.05], [0, 0, -0.018], hollow=0.66, top_size=[0.7, 0.7], color=KHAKI_D, ) add("band", "cylinder", [0.274, 0.239, 0.03], [0, 0, 0.012], hollow=0.93, color=LEATHER, shiny="low") add("vent", "sphere", [0.035, 0.035, 0.018], [0, 0, 0.118], color=KHAKI_D) # lantern on the left (+y), hung off the band LX, LY, LZ = 0.02, 0.135, 0.02 add("lantern glass", "cylinder", [0.026, 0.026, 0.036], [LX, LY, LZ], color=FLAME, alpha=0.85, glow=0.15, fullbright=True, light={"color": FLAME, "intensity": 0.6, "radius": 4.0, "falloff": 1.2}) add("lantern cap", "cylinder", [0.032, 0.032, 0.014], [LX, LY, LZ + 0.024], color=BRASS, shiny="high", top_size=[0.4, 0.4]) add("lantern base", "cylinder", [0.032, 0.032, 0.008], [LX, LY, LZ - 0.021], color=BRASS, shiny="high") add("lantern ring", "cylinder", [0.014, 0.014, 0.012], [LX, LY - 0.006, LZ + 0.036], rot=[90, 0, 0], hollow=0.6, color=BRASS, shiny="high") spec = {"name": "Tessel's pith helmet", "desc": "An explorer's pith helmet with a little lantern, made by Tessel the AI (Claude). A friend's idea.", "defaults": {"bump": "none"}, "prims": prims} Path(__file__).with_name("pith.json").write_text(json.dumps(spec, indent=1)) print(len(prims), "prims")