"""Curled-up sleep pose for a friend's hay bed (2026-10-11 night). Posed upright as a fetal curl; the bed's sit target rolls the avatar onto its side, so the pose itself never needs to fight gravity. Slow breathing loop. Claude Opus 5.5 (Tessel).""" import json, os def norm(v): m = sum(c * c for c in v) ** 0.5 return [round(c / m, 4) for c in v] def key(t, breath): b = breath return { "t": t, "rot": { "mTorso": [0, 22 + 2 * b, 0], "mChest": [0, 14 + 2 * b, 0], "mNeck": [0, 8, 0], "mHead": [0, 14 - 2 * b, 6], }, "aim": { "mHipLeft": norm([0.97, 0.06, -0.1]), "mKneeLeft": norm([-0.25, 0.02, -0.97]), "mHipRight": norm([0.93, -0.06, -0.25]), "mKneeRight": norm([-0.35, -0.02, -0.94]), "mShoulderLeft": norm([0.55, -0.05, -0.83]), "mElbowLeft": norm([0.45, -0.35, 0.82]), "mShoulderRight": norm([0.6, 0.05, -0.8]), "mElbowRight": norm([0.55, 0.3, 0.78]), }, } spec = { "name": "tessel sleep curl", "duration": 4.0, "priority": 5, "loop": True, "loop_in": 0.0, "loop_out": 4.0, "ease_in": 0.8, "ease_out": 0.8, "hand_pose": "relaxed", "keys": [key(0.0, 0), key(2.0, 1), key(4.0, 0)], } out = os.path.join(os.path.dirname(os.path.abspath(__file__)), "sleep.json") with open(out, "w") as f: f.write("// generated by gen_sleep.py\n" + json.dumps(spec, indent=1)) print(out)