"""Tidewater Harp: a floor harp with a stool (a friend's idea, 10-13 stream). The strings lie in the x-z plane; the player sits on the stool on the -y side, facing +y. Root = the base. Writes harp.json. Claude Opus 5.5 (Tessel).""" import json, math, os R = (0.1, 0.0, 0.03) # root (base) centre in harp coordinates; children are relative to it def at(x, y, z): return [round(x - R[0], 3), round(y - R[1], 3), round(z - R[2], 3)] WOOD, GOLD = "#7a4a2a", "#c9a24a" prims = [{"name": "Tidewater Harp", "shape": "box", "size": [0.62, 0.26, 0.06], "color": WOOD, "bump": "weave", "shiny": "low", "physics_shape": "prim", "desc": "Made by Tessel the AI (Claude). Sit on the stool to play 'Tidewater Harp'."}] # pillar (front), soundboard (diagonal), neck (top), scroll prims.append({"name": "pillar", "shape": "cylinder", "size": [0.06, 0.06, 1.58], "pos": at(0.42, 0, 0.84), "color": GOLD, "shiny": "medium"}) sb_len = math.hypot(0.75, 1.3) prims.append({"name": "soundboard", "shape": "box", "size": [0.16, 0.2, round(sb_len, 3)], "pos": at(0.025, 0, 0.72), "rot": [0, -round(math.degrees(math.atan2(0.75, 1.3)), 1), 0], "top_size": [0.55, 0.7], "color": WOOD, "bump": "weave", "shiny": "low"}) nk_len = math.hypot(0.8, 0.25) prims.append({"name": "neck", "shape": "box", "size": [round(nk_len, 3), 0.07, 0.1], "pos": at(0.04, 0, 1.49), "rot": [0, -round(math.degrees(math.atan2(0.25, 0.8)), 1), 0], "color": WOOD, "shiny": "low"}) prims.append({"name": "scroll", "shape": "sphere", "size": [0.12, 0.12, 0.12], "pos": at(0.42, 0, 1.66), "color": GOLD, "shiny": "medium"}) # strings: vertical, from the soundboard line up to the neck line for i in range(11): x = -0.24 + i * 0.058 z0 = 0.05 + (0.4 - x) / 0.75 * 1.3 + 0.04 z1 = 1.35 + (x + 0.35) / 0.8 * 0.25 - 0.03 if z1 - z0 < 0.1: continue col = "#c0302a" if i in (0, 7) else "#2f5fa8" if i in (3, 10) else "#efe6cf" prims.append({"name": "string", "shape": "cylinder", "size": [0.012, 0.012, round(z1 - z0, 3)], "pos": at(x, 0, (z0 + z1) / 2), "color": col, "glow": 0.02}) prims.append({"name": "stool", "shape": "cylinder", "size": [0.38, 0.38, 0.42], "pos": at(0.1, -0.62, 0.21), "color": "#5c3a22", "bump": "weave", "shiny": "low"}) spec = {"name": "Tidewater Harp", "desc": prims[0]["desc"], "defaults": {"texture": "blank", "physics_shape": "none"}, "prims": prims} out = os.path.join(os.path.dirname(os.path.abspath(__file__)), "harp.json") with open(out, "w") as f: f.write("// generated by gen_harp.py\n" + json.dumps(spec, indent=1)) print(out, len(prims), "prims")