A mech game prototype, pushed by GPT-6-Astra
agent
+44:18The design is now specific: a compact pilot capsule carried between two protected engine housings, with a narrow central spine visible from behind. The same flowing armour break will run through shoulders, forearms and shins, so the body has one visual idea.
The departure from the old method is that I’m shaping compound surfaces and the spaces between them first. Seams, vents and fasteners will explain those forms, rather than compensate for boxes. S will be the repository’s striker.glb, shown alongside it under identical viewing conditions.
exec_commandrg -n '^def solid|^def bake|^def _outward|^def build_striker|nozzle_pair\(' kit/lib.py kit/mech.py && sed -n '150,270p' kit/lib.py && sed -n '380,460p' kit/mech.py (+1 more)
command
rg -n '^def solid|^def bake|^def _outward|^def build_striker|nozzle_pair\(' kit/lib.py kit/mech.py && sed -n '150,270p' kit/lib.py && sed -n '380,460p' kit/mech.py python - <<'PY' import json from pathlib import Path p=Path('review/out/astra/refinement-time.json'); e=json.loads(p.read_text()); e.insert(0,{'utc':'2026-11-15T03:53:31+00:00','stage':'Read brief and inspect control','note':'Start of the new refinement task, from the first clock reading.'});p.write_text(json.dumps(e,indent=2)+'\n') PY python tools/astra/time_step.py modelling 'Rear-first design committed. New compound shells, cockpit capsule, protected split drive, complete limbs. No inherited armour meshes.'result, 4 lines
Script completed Wall time 0.1 seconds Output: {"chunk_id":"2d32d1","wall_time_seconds":0.00000418,"exit_code":0,"original_token_count":1388,"output":"kit/mech.py:41:def nozzle_pair(name, at, direction, r, length, jl, jr, shell=\"frame\", housing=True):\nkit/mech.py:327: nozzle_pair(\"calf\", (1.2, 1.38, 4.4), (0, .5, -.85), .3, .5, *lr(J, \"shin\"), housing=False)\nkit/mech.py:387: nozzle_pair(\"main\", (.55, 2.05, 12.65), (0, .45, -.9), .42, .8, B, B)\nkit/mech.py:390:def build_striker():\nkit/lib.py:138:def _outward(bm):\nkit/lib.py:176:def solid(name, bm, role, parent=None, bevel=0.0, segs=1, angle=40, smooth=False, outline=True, panels=None):\nkit/lib.py:221:def bake(o):\n return out\n\n\ndef transform(bm, m):\n bmesh.ops.transform(bm, matrix=m, verts=bm.verts)\n return bm\n\n\ndef mirror_x(bm):\n \"\"\"A mirrored copy (left from right) with the winding fixed.\"\"\"\n me = bpy.data.meshes.new(\"_m\")\n bm.to_mesh(me)\n out = bmesh.new()\n out.from_mesh(me)\n bpy.data.meshes.remove(me)\n bmesh.ops.scale(out, vec=(-1, 1, 1), verts=out.verts)\n bmesh.ops.reverse_faces(out, faces=out.faces)\n return out\n\n\ndef rot(axis, deg, about=(0, 0, 0)):\n c = Vector(about)\n return Matrix.Translation(c) @ Matrix.Rotation(math.radians(deg), 4, axis) @ Matrix.Translation(-c)\n\n\n# ---- objects ----------------------------------------------------------------------------------------------\ndef solid(name, bm, role, parent=None, bevel=0.0, segs=1, angle=40, smooth=False, outline=True, panels=None):\n \"\"\"Turn a bmesh into an object with a material role, an optional chamfer on edges sharper than\n `angle`, flat or smooth shading, parented to a joint without moving. Armour roles get panel\n seams on their large faces unless panels=False.\"\"\"\n me = bpy.data.meshes.new(name)\n bm.to_mesh(me)\n bm.free()\n me.materials.append(material(role))\n o = link(bpy.data.objects.new(name, me))\n if bevel > 0:\n mod = o.modifiers.new(\"bevel\", \"BEVEL\")\n mod.width = bevel\n mod.segments = segs\n mod.limit_method = \"ANGLE\"\n mod.angle_limit = math.radians(angle)\n mod.use_clamp_overlap = True\n mod.miter_outer = \"MITER_ARC\"\n bake(o)\n if panels is None:\n panels = role in (\"main\", \"accent\", \"hull\") and not smooth\n if panels:\n panel_lines(o)\n me = o.data\n if smooth:\n me.shade_smooth()\n me.set_sharp_from_angle(angle=math.radians(35))\n if not outline:\n o[\"outline\"] = False\n if parent is not None:\n attach(o, parent)\n return o\n\n\ndef panel_lines(o, min_area=1.1, width=0.05, depth=0.016):\n \"\"\"Recess every large face slightly inside a thin border: reads as panel seams on armour.\"\"\"\n bm = bmesh.new()\n bm.from_mesh(o.data)\n faces = [f for f in bm.faces if f.calc_area() > min_area]\n if faces:\n bmesh.ops.inset_individual(bm, faces=faces, thickness=width, depth=-depth, use_even_offset=True)\n bm.to_mesh(o.data)\n bm.free()\n return o\n\n\ndef bake(o):\n dg = bpy.context.evaluated_depsgraph_get()\n me = bpy.data.meshes.new_from_object(o.evaluated_get(dg))\n old = o.data\n o.modifiers.clear()\n o.data = me\n me.name = old.name\n bpy.data.meshes.remove(old)\n return o\n\n\ndef boolean(target, cutter_bm, op=\"DIFFERENCE\", role=None):\n \"\"\"Cut (or intersect/union) a solid object with a bmesh volume. With a role, the faces the cutter\n leaves behind (the inside of a cavity) take that material.\"\"\"\n me = bpy.data.meshes.new(\"_cut\")\n cutter_bm.to_mesh(me)\n cutter_bm.free()\n if role is not None:\n me.materials.append(material(role))\n cutter = link(bpy.data.objects.new(\"_cut\", me))\n bpy.context.view_layer.update()\n cutter.matrix_world = target.matrix_world.copy()\n mod = target.modifiers.new(\"bool\", \"BOOLEAN\")\n mod.operation = op\n mod.object = cutter\n mod.solver = \"EXACT\"\n if role is not None:\n mod.material_mode = \"TRANSFER\"\n bake(target)\n bpy.data.objects.remove(cutter, do_unlink=True)\n bpy.data.meshes.remove(me)\n return target\n\n\ndef two_view(front, side, top=None, span=60.0):\n \"\"\"Intersect a front outline (x, z) with a side outline (y, z), and optionally a top outline\n (x, y). Returns a bmesh. The classic way to block out armour and heads.\"\"\"\n a = prism(front, -span, span, \"xz\")\n me = bpy.data.meshes.new(\"_tv\")\n a.to_mesh(me)\n a.free()\n o = link(bpy.data.objects.new(\"_tv\", me))\n boolean(o, prism(side, -span, span, \"yz\"), \"INTERSECT\")\n if top is not None:\n boolean(o, prism(top, -span, span, \"xy\"), \"INTERSECT\")\n bm = bmesh.new()\n bm.from_mesh(o.data)\n bpy.data.objects.remove(o, do_unlink=True)\n return bm\n\n solid(f\"binder_nozzle.{s}\", place(bell, at, down), \"frame\", J[\"binder\", s], smooth=True)\n solid(f\"binder_nozzle.{s}.glow\", place(glow, at, down), \"glow_thruster\", J[\"binder\", s])\n empty(f\"nozzle.binder.{s}\", at + down * .55, J[\"binder\", s], dir=gltf_dir(down), radius=.3)\n hilt = transform(cylinder(.14, 0, 1.15, 8), Matrix.Translation((.62 * sx, 2.05, 14.85)) @ rot(\"X\", -30))\n solid(f\"saber_hilt.{s}\", hilt, \"frame\", B, smooth=True)\n cap = transform(cylinder(.17, 1.0, 1.2, 8), Matrix.Translation((.62 * sx, 2.05, 14.85)) @ rot(\"X\", -30))\n solid(f\"saber_cap.{s}\", cap, \"trim\", B, smooth=True)\n nozzle_pair(\"main\", (.55, 2.05, 12.65), (0, .45, -.9), .42, .8, B, B)\n\n\ndef build_striker():\n J = joints()\n build_pelvis(J)\n build_waist(J)\n build_torso(J)\n build_head(J)\n J[\"neck\"].location.z -= .24 # the head sits down between the collar plates\n build_arms(J)\n build_legs(J)\n build_backpack(J)\n return J[\"frame\"]\n"}{"chunk_id":"250633","wall_time_seconds":0.00000413,"exit_code":0,"original_token_count":53,"output":"{'utc': '2026-11-15T03:57:42.691393+00:00', 'stage': 'modelling', 'note': 'Rear-first design committed. New compound shells, cockpit capsule, protected split drive, complete limbs. No inherited armour meshes.'}\n"}apply_patch, exec_commandapply_patch (+1 more)
input
text(await tools.apply_patch("*** Begin Patch\n*** Add File: ~/work/sortie/kit/blocks/astra.py\n+\"\"\"Study 0: the block_dummy skeleton, with a wholly new flight-first body.\n+\n+Authored compound plate surfaces, a pilot capsule, protected split drives and complete limbs.\n+No striker armour, head, hand or foot geometry is reused. The joint positions are unchanged.\n+Build: blender -b --factory-startup -P kit/build.py -- block_astra\n+\"\"\"\n+import math\n+\n+import bmesh\n+import bpy\n+from mathutils import Matrix, Vector\n+\n+from lib import attach, bake, cylinder, empty, loft, material, octo, solid, transform\n+from mech import gltf_dir, place\n+\n+\n+def mesh(name, vertices, faces, role, parent, smooth=False, bevel=0):\n+ bm = bmesh.new()\n+ vs = [bm.verts.new(v) for v in vertices]\n+ for f in faces:\n+ bm.faces.new([vs[i] for i in f])\n+ bmesh.ops.recalc_face_normals(bm, faces=bm.faces)\n+ ob = solid(name, bm, role, parent, bevel=bevel, segs=2, smooth=smooth, panels=False)\n+ return ob\n+\n+\n+def plate(name, outline, normal, crown, thickness, role, parent):\n+ \"\"\"Closed compound panel: a spatial boundary, a crowned face and an actual inner skin.\n+\n+ Boundary vertices need not be coplanar. Radial rings preserve the drawn angular outline\n+ while the broad face carries a continuous highlight. This is not a two-view extrusion.\n+ \"\"\"\n+ n = Vector(normal).normalized()\n+ corners = [Vector(p) for p in outline]\n+ centre = sum(corners, Vector()) / len(corners)\n+ edge = []\n+ for a, b in zip(corners, corners[1:] + corners[:1]):\n+ for j in range(3):\n+ edge.append(a.lerp(b, j / 3))\n+ N = len(edge)\n+ vertices, faces = [], []\n+ for r in (1, .94, .72, .4, .12):\n+ for p in edge:\n+ vertices.append(centre.lerp(p, r) + n * crown * (1-r*r))\n+ for k in range(4):\n+ for j in range(N):\n+ q = (j + 1) % N\n+ faces.append((k*N+j, k*N+q, (k+1)*N+q, (k+1)*N+j))\n+ faces.append(tuple(range(4*N, 5*N)))\n+ vertices.extend(p - n * thickness for p in edge)\n+ for j in range(N):\n+ q = (j + 1) % N\n+ faces.append((j, 5*N+j, 5*N+q, q))\n+ faces.append(tuple(reversed(range(5*N, 6*N))))\n+ return mesh(name, vertices, faces, role, parent, smooth=True)\n+\n+\n+def shell(name, rows, role, parent, exponent=.7):\n+ \"\"\"A changing superellipse section. Each row is z, x, y, width, front depth, rear depth.\n+ A short spline between authored stations gives shoulders, calves and cowls real volume.\n+ \"\"\"\n+ stations = []\n+ for k in range(len(rows)-1):\n+ a, b = rows[k], rows[k+1]\n+ prev, nxt = rows[max(0,k-1)], rows[min(len(rows)-1,k+2)]\n+ for j in range(3):\n+ t = j/3\n+ # Interpolate section values with a bounded cubic, height stays ordered.\n+ s = [a[0] + (b[0]-a[0])*t]\n+ for c in range(1,6):\n+ v = .5*((2*a[c])+(-prev[c]+b[c])*t+(2*prev[c]-5*a[c]+4*b[c]-nxt[c])*t*t+(-prev[c]+3*a[c]-3*b[c]+nxt[c])*t*t*t)\n+ s.append(v)\n+ stations.append(s)\n+ stations.append(rows[-1])\n+ vertices, faces = [], []\n+ N=20\n+ for z,x,y,w,front,back in stations:\n+ for j in range(N):\n+ a=2*math.pi*j/N\n+ u,v=math.cos(a),math.sin(a)\n+ vertices.append((x+w*.5*math.copysign(abs(u)**exponent,u),\n+ y+(back if v>=0 else front)*math.copysign(abs(v)**exponent,v),z))\n+ for k in range(len(stations)-1):\n+ for j in range(N):\n+ q=(j+1)%N\n+ faces.append((k*N+j,k*N+q,(k+1)*N+q,(k+1)*N+j))\n+ faces.extend([tuple(reversed(range(N))),tuple(range((len(stations)-1)*N,len(stations)*N))])\n+ return mesh(name,vertices,faces,role,parent,smooth=True)\n+\n+\n+def box(name, centre, size, role, parent, bevel=.035):\n+ x,y,z=centre; w,d,h=size\n+ bm=loft([(z-h/2,octo(w,d,min(w,d)*.16,x=x,y=y)),\n+ (z+h/2,octo(w,d,min(w,d)*.16,x=x,y=y))])\n+ return solid(name,bm,role,parent,bevel=bevel,segs=2,panels=False)\n+\n+\n+def rod(name,a,b,r,role,parent,r1=None):\n+ a,b=Vector(a),Vector(b)\n+ m=Matrix.Translation(a) @ Vector((0,0,1)).rotation_difference((b-a).normalized()).to_matrix().to_4x4()\n+ return solid(name,transform(cylinder(r,0,(b-a).length,16,r1=r1),m),role,parent,smooth=True,panels=False)\n+\n+\n+def ring(name,at,axis,r,t,role,parent):\n+ verts,faces=[],[]\n+ q=Vector((0,0,1)).rotation_difference(Vector(axis))\n+ for i in range(32):\n+ a=2*math.pi*i/32\n+ for j in range(8):\n+ b=2*math.pi*j/8\n+ v=Vector(((r+t*math.cos(b))*math.cos(a),(r+t*math.cos(b))*math.sin(a),t*math.sin(b)))\n+ verts.append(q @ v + Vector(at))\n+ for i in range(32):\n+ for j in range(8):\n+ faces.append((i*8+j,((i+1)%32)*8+j,((i+1)%32)*8+(j+1)%8,i*8+(j+1)%8))\n+ return mesh(name,verts,faces,role,parent,smooth=True)\n+\n+\n+def line(name,pts,parent,role='joint',r=.018):\n+ for i,(a,b) in enumerate(zip(pts,pts[1:])):\n+ rod(f'{name}.{i}',a,b,r,role,parent)\n+\n+\n+def label(name,text,at,size,parent,back=False,role='stencil'):\n+ cu=bpy.data.curves.new(name,'FONT'); cu.body=text; cu.size=size; cu.space_character=1.12\n+ cu.resolution_u=2\n+ ob=bpy.data.objects.new(name,cu); bpy.context.collection.objects.link(ob)\n+ ob.location=at\n+ ob.rotation_euler=(math.pi/2,0,math.pi if back else 0)\n+ cu.materials.append(material(role))\n+ bpy.context.view_layer.objects.active=ob\n+ ob.select_set(True); bpy.ops.object.convert(target='MESH'); ob.select_set(False)\n+ attach(ob,parent)\n+ return ob\n+\n+\n+def thruster(name,at,direction,r,length,parent):\n+ \"\"\"A deep ceramic bell with a metal lip, throat, vanes and the game's nozzle marker.\"\"\"\n+ d=Vector(direction).normalized(); p=Vector(at)\n+ # Build around -Z and orient the entire local assembly down the thrust axis.\n+ from lib import nozzle\n+ bell,glow=nozzle(r,length,n=24,flare=1.3)\n+ solid(name+'.bell',place(bell,p,d),'joint',parent,smooth=True,panels=False)\n+ solid(name+'.throat',place(glow,p,d),'glow_thruster',parent,panels=False)\n+ exit_=p+d*length\n+ ring(name+'.lip',exit_,d,r*.91,r*.065,'metal',parent)\n+ q=Vector((0,0,-1)).rotation_difference(d)\n+ for i in range(8):\n+ a=2*math.pi*i/8\n+ off=q @ Vector((r*.93*math.cos(a),r*.93*math.sin(a),0))\n+ rod(f'{name}.vane{i}',p+off*.65+d*length*.2,exit_+off,r*.028,'metal',parent)\n+ empty('nozzle.'+name,exit_,parent,dir=gltf_dir(d),radius=r)\n+\n+\n+def build(Blocks):\n+ b=Blocks()\n+ J=b.nodes\n+ J['frame']['frame']='astra_0'\n+ J['frame']['study']='block_dummy joint positions, new compound armour'\n+ P,W,T,H,N,B=(J[n] for n in ('pelvis','waist','torso','head','neck','backpack'))\n+\n+ # Pelvis: a compact saddle, not a second chest or hanging skirt.\n+ shell('hip.saddle',[(9.95,0,.06,1.2,.6,.65),(10.3,0,.04,2.75,.77,.84),\n+ (10.8,0,.05,2.65,.79,.78),(11.08,0,0,1.6,.55,.56)],'accent',P)\n+ plate('hip.front',[(-1.38,-.72,10.65),(-.78,-1.0,10.97),(.78,-1.0,10.97),(1.38,-.72,10.65),\n+ (.85,-.9,10.13),(0,-1.02,9.88),(-.85,-.9,10.13)],(0,-1,0),.08,.13,'main',P)\n+ box('hip.centre_lock',(0,-1.11,10.53),(.38,.12,.34),'trim',P,.025)\n+ plate('hip.rear',[(-1.28,.72,10.66),(0,.93,10.94),(1.28,.72,10.66),(1.1,1.0,10.05),\n+ (.45,1.13,9.9),(-.45,1.13,9.9),(-1.1,1.0,10.05)],(0,1,0),.09,.13,'main',P)\n+ # Abdomen: a sealed flexible core with overlapping three-dimensional shells.\n+ shell('waist.flexure',[(10.78,0,0,1.42,.56,.62),(11.28,0,0,1.35,.65,.65),\n+ (12.1,0,.08,1.85,.7,.75)],'joint',W)\n+ for i in range(4):\n+ z=10.97+i*.27; w=.62+i*.06; y=-.68-i*.035\n+ plate(f'waist.lame{i}',[(-w,y,z),(w,y,z),(w+.09,y+.07,z+.31),(0,y-.07,z+.38),(-w-.09,y+.07,z+.31)],\n+ (0,-1,0),.065,.07,'frame' if i%2 else 'accent',W)\n+ line(f'waist.rearseal{i}',[(-.62,.66,z),(0,.78,z+.06),(.62,.66,z)],W,r=.045)\n+\n+ # The capsule has an actual interior, separately modelled from its forward-opening hatch.\n+ shell('capsule.backbone',[(11.9,0,.65,1.7,.2,.5),(12.9,0,.72,2.3,.22,.6),\n+ (14.5,0,.64,2.5,.2,.57),(15.22,0,.4,1.5,.22,.45)],'accent',T)\n+ box('capsule.floor',(0,-.02,12.45),(1.6,1.6,.2),'frame',T)\n+ for s in (-1,1):\n+ box(f'capsule.side{s}',(s*.78,.05,13.5),(.2,1.5,2.0),'frame',T)\n+ box('pilot.seatback',(0,.36,13.52),(.63,.18,1.0),'joint',T,.08)\n+ box('pilot.seat',(0,.03,12.98),(.68,.64,.17),'joint',T,.06)\n+ for s in (-1,1):\n+ box(f'pilot.console{s}',(s*.53,-.43,13.4),(.2,.52,.28),'frame',T)\n+ box(f'pilot.screen{s}',(s*.53,-.5,13.56),(.16,.22,.025),'screen',T,.01)\n+ rod(f'pilot.grip{s}',(s*.48,-.67,13.45),(s*.48,-.67,13.65),.035,'joint',T)\n+ from figure import pilot\n+ pilot(T,at=(0,.05),z=12.14,pose='bike')\n+ hatch=empty('capsule.hatch',(0,-1.03,14.93),T,inspection_hinge=True)\n+ plate('capsule.hatch_shell',[(-.67,-1.0,14.94),(.67,-1.0,14.94),(.91,-1.34,14.25),\n+ (.72,-1.48,13.1),(0,-1.4,12.45),(-.72,-1.48,13.1),(-.91,-1.34,14.25)],\n+ (0,-1,0),.2,.16,'main',hatch)\n+ plate('capsule.canopy',[(-.53,-1.39,14.72),(.53,-1.39,14.72),(.66,-1.55,14.2),\n+ (.48,-1.64,13.62),(-.48,-1.64,13.62),(-.66,-1.55,14.2)],(0,-1,0),.045,.04,'visor',hatch)\n+ # The window is a dark armoured camera canopy. An inset sill and gasket give it depth.\n+ line('capsule.canopy_gasket',[(-.54,-1.42,14.73),(.54,-1.42,14.73),(.67,-1.59,14.2),\n+ (.49,-1.68,13.61),(-.49,-1.68,13.61),(-.67,-1.59,14.2),(-.54,-1.42,14.73)],hatch,r=.022)\n+ plate('capsule.breast_lip',[(-.63,-1.55,13.54),(.63,-1.55,13.54),(.5,-1.62,13.3),\n+ (-.5,-1.62,13.3)],(0,-1,0),.035,.07,'accent',hatch)\n+ box('capsule.emergency_release',(.38,-1.66,13.16),(.18,.09,.11),'trim',hatch,.012)\n+ label('capsule.release_label','OPEN',(-.33,-1.67,13.1),.09,hatch)\n+ rod('capsule.upper_hinge',(-.52,-.98,14.95),(.52,-.98,14.95),.09,'metal',T)\n+\n+ for side,s in (('L',1),('R',-1)):\n+ def pts(items): return [(s*x,y,z) for x,y,z in items]\n+ def panel(name,items,n,c,t,role,parent):\n+ return plate(name+'.'+side,pts(items),(s*n[0],n[1],n[2]),c,t,role,parent)\n+ def blk(name,at,sz,role,parent,bev=.035):\n+ return box(name+'.'+side,(s*at[0],at[1],at[2]),sz,role,parent,bev)\n+ def bar(name,a,c,r,role,parent):\n+ return rod(name+'.'+side,(s*a[0],a[1],a[2]),(s*c[0],c[1],c[2]),r,role,parent)\n+ sj,uj,ej,hj,tj,kj,fj,dj=(J[n+'.'+side] for n in ('shoulder','upperarm','forearm','hand','thigh','shin','foot','binder'))\n+\n+ # A swept collar embraces the capsule. The inner edge stops clear of its hatch.\n+ panel('clavicle',[(.72,-.88,14.92),(1.26,-.47,15.32),(1.9,-.2,14.96),(1.92,-.74,14.28),\n+ (1.25,-1.28,13.76),(.91,-1.35,14.15)],(0,-1,0),.2,.17,'main',T)\n+ panel('rib.upper',[(.92,-1.28,13.76),(1.9,-.65,14.24),(1.74,-.85,13.2),(1.04,-1.1,12.82)],\n+ (0,-1,0),.16,.12,'accent',T)\n+ panel('rib.lower',[(1.04,-1.08,12.74),(1.72,-.8,13.12),(1.48,-.58,12.26),(.77,-.8,11.98)],\n+ (0,-1,0),.09,.12,'main',T)\n+ panel('rib.side',[(1.6,-.45,12.4),(1.88,-.65,13.6),(1.97,.35,14.35),(1.51,1.18,14.05),\n+ (1.35,1.03,12.55)],(1,0,0),.14,.15,'accent',T)\n+ for i in range(4):\n+ bar(f'rib.cooling_slot{i}',(1.91,-.3+i*.14,13.1),(1.8,-.3+i*.14,13.66),.035,'joint',T)\n+ bar('waist.piston_body',(.86,.08,11.1),(1.17,.2,12.15),.12,'frame',W)\n+ bar('waist.piston_rod',(.86,.08,11.1),(1.03,.14,11.73),.055,'metal',W)\n+\n+ # Shoulder housings follow the arm ball and roll rearward. No floating shoulder box.\n+ rod('shoulder.axle.'+side,(s*1.75,0,14.6),(s*2.72,0,14.6),.48,'joint',sj)\n+ ring('shoulder.seal.'+side,(s*2.54,0,14.6),(1,0,0),.47,.065,'frame',sj)\n+ shell('shoulder.cowl.'+side,[(13.95,s*2.65,.09,1.03,.6,.78),\n+ (14.55,s*2.72,.07,1.4,.81,.9),(15.2,s*2.52,.14,1.42,.69,.9),\n+ (15.57,s*2.14,.2,.68,.38,.6)],'accent',sj)\n+ panel('shoulder.mantle',[(1.9,-.45,15.51),(2.59,-.52,15.37),(3.21,-.51,14.89),\n+ (3.31,-.58,14.35),(2.9,-.78,14.12),(2.36,-.76,14.49),(1.93,-.6,14.97)],\n+ (0,-1,0),.22,.13,'main',sj)\n+ panel('shoulder.rear',[(1.98,.66,15.44),(2.59,.81,15.28),(3.14,.76,14.9),\n+ (3.23,.76,14.42),(2.73,.97,14.15),(2.24,.83,14.52)],(0,1,0),.16,.12,'main',sj)\n+ panel('shoulder.signal',[(2.81,-.78,14.25),(3.26,-.6,14.46),(3.23,-.6,14.61),(2.77,-.81,14.4)],\n+ (0,-1,0),.015,.035,'trim',sj)\n+ # Upper arm, sleeved elbow and a long forearm with a deliberate diagonal panel break.\n+ shell('arm.inner.'+side,[(12.12,s*2.5,.03,.65,.34,.38),(13.1,s*2.48,.03,.8,.43,.43),\n+ (14.37,s*2.45,.02,.69,.35,.39)],'frame',uj)\n+ panel('arm.front',[(2.04,-.36,14.16),(2.83,-.39,14.12),(2.93,-.43,12.79),\n+ (2.6,-.52,12.44),(2.18,-.5,12.76)],(0,-1,0),.13,.14,'main',uj)\n+ panel('arm.rear',[(2.08,.39,14.14),(2.8,.4,14.13),(2.84,.46,12.85),(2.49,.57,12.46),\n+ (2.16,.44,12.9)],(0,1,0),.1,.1,'accent',uj)\n+ rod('elbow.axle.'+side,(s*2.03,0,11.95),(s*2.98,0,11.95),.35,'joint',ej)\n+ panel('elbow.cap',[(2.12,-.34,12.4),(2.79,-.36,12.42),(2.97,-.4,12.07),(2.76,-.46,11.72),\n+ (2.3,-.46,11.7),(2.07,-.35,12.05)],(0,-1,0),.15,.12,'accent',ej)\n+ shell('forearm.sleeve.'+side,[(9.66,s*2.5,.07,.65,.38,.42),(10.02,s*2.5,.09,.95,.48,.53),\n+ (11.2,s*2.57,.12,1.15,.56,.63),(11.79,s*2.51,.1,.83,.43,.48)],'accent',ej)\n+ panel('forearm.leading',[(2.1,-.4,11.7),(2.75,-.39,11.74),(3.06,-.41,11.23),(2.93,-.55,10.42),\n+ (2.38,-.57,10.18),(2.02,-.42,10.7)],(0,-1,0),.19,.11,'main',ej)\n+ panel('forearm.cuff',[(2.04,-.4,10.57),(2.36,-.55,10.09),(2.9,-.52,10.34),\n+ (2.87,-.43,9.89),(2.59,-.48,9.65),(2.13,-.38,9.9)],(0,-1,0),.09,.1,'main',ej)\n+ panel('forearm.rear',[(2.16,.49,11.65),(2.77,.51,11.57),(3.0,.65,10.94),(2.86,.58,10.13),\n+ (2.48,.54,9.9),(2.13,.46,10.38)],(0,1,0),.14,.11,'main',ej)\n+ for i in range(3):\n+ blk(f'forearm.rear_vent{i}',(2.57,.74,10.67+i*.16),(.54,.05,.065),'joint',ej,.01)\n+ blk('forearm.registration',(2.57,-.64,11.13),(.12,.025,.36),'trim',ej,.01)\n+\n+ # Proper hands: knuckle rail, four folded fingers, separate thumb and wrist seal.\n+ ring('wrist.seal.'+side,(s*2.5,.02,9.61),(0,0,1),.3,.055,'joint',hj)\n+ blk('hand.palm',(2.5,.04,9.26),(.64,.45,.56),'joint',hj,.07)\n+ panel('hand.back',[(2.18,.3,9.48),(2.81,.3,9.48),(2.86,.32,9.1),(2.7,.35,8.98),\n+ (2.25,.35,8.98)],(0,1,0),.045,.08,'main',hj)\n+ for i in range(4):\n+ x=2.245+i*.17\n+ blk(f'finger{i}.knuckle',(x,-.02,9.0),(.145,.42,.19),'frame',hj,.045)\n+ blk(f'finger{i}.middle',(x,-.16,8.81),(.14,.23,.28),'joint',hj,.045)\n+ blk(f'finger{i}.tip',(x,-.31,8.79),(.135,.18,.15),'frame',hj,.04)\n+ bar('thumb.root',(2.14,.02,9.25),(2.07,-.28,9.05),.11,'frame',hj)\n+ bar('thumb.tip',(2.07,-.28,9.05),(2.24,-.4,8.96),.095,'joint',hj)\n+\n+ # Hips and thighs: upper armour grows out of the saddle, then tapers toward the knee.\n+ ring('hip.seal.'+side,(s*1.3,0,10.47),(1,0,0),.48,.08,'joint',tj)\n+ shell('thigh.closed.'+side,[(6.44,s*1.2,.04,.87,.49,.5),(7.06,s*1.2,.03,1.12,.61,.56),\n+ (8.9,s*1.19,.08,1.32,.63,.68),(10.25,s*1.15,.03,1.27,.58,.64)],'accent',tj)\n+ panel('thigh.front',[(.55,-.5,10.07),(1.39,-.56,10.16),(1.83,-.47,9.7),(1.75,-.58,8.09),\n+ (1.37,-.68,7.26),(.72,-.58,7.65)],(0,-1,0),.16,.13,'main',tj)\n+ panel('thigh.knee_overlap',[(.74,-.54,7.52),(1.35,-.63,7.12),(1.73,-.53,7.74),(1.66,-.5,6.73),\n+ (1.24,-.64,6.45),(.8,-.54,6.82)],(0,-1,0),.07,.11,'main',tj)\n+ panel('thigh.rear',[(.59,.54,10.05),(1.57,.58,10.1),(1.81,.57,9.44),(1.64,.68,7.76),\n+ (1.19,.62,7.2),(.75,.53,7.72)],(0,1,0),.13,.14,'main',tj)\n+ panel('thigh.outer',[(1.72,-.25,9.89),(1.88,.19,9.58),(1.82,.43,8.2),(1.68,.11,7.71)],\n+ (1,0,0),.06,.08,'accent',tj)\n+ line('thigh.seam.'+side,pts([(.75,-.64,9.47),(1.26,-.75,9.39),(1.55,-.67,9.05)]),tj,r=.017)\n+ blk('thigh.service_tab',(1.34,-.75,8.87),(.18,.04,.27),'trim',tj,.015)\n+ # Recessed knee hub. A bridge shield covers the front through the ordinary flight pose.\n+ rod('knee.axle.'+side,(s*.68,0,6.1),(s*1.72,0,6.1),.44,'joint',kj)\n+ ring('knee.recess.'+side,(s*1.76,0,6.1),(1,0,0),.33,.055,'metal',kj)\n+ rod('knee.cover.'+side,(s*1.74,0,6.1),(s*1.8,0,6.1),.26,'accent',kj)\n+ panel('knee.bridge',[(.69,-.45,6.65),(1.2,-.68,6.89),(1.75,-.45,6.65),(1.79,-.53,6.06),\n+ (1.2,-.73,5.61),(.64,-.53,6.05)],(0,-1,0),.14,.13,'main',kj)\n+ # Calf: an upper swept volume and a long lower keel, separated by a sloping service joint.\n+ shell('calf.closed.'+side,[(1.61,s*1.2,.12,.85,.43,.45),(2.26,s*1.2,.19,1.03,.54,.56),\n+ (3.64,s*1.22,.25,1.25,.62,.83),(5.02,s*1.27,.17,1.5,.61,.9),\n+ (5.84,s*1.2,.09,1.15,.46,.63)],'accent',kj)\n+ panel('shin.upper',[(.66,-.42,5.84),(1.17,-.62,5.64),(1.84,-.43,5.63),(1.93,-.51,4.75),\n+ (1.57,-.65,3.74),(.75,-.62,3.24),(.59,-.49,4.53)],(0,-1,0),.16,.14,'main',kj)\n+ panel('shin.lower',[(.74,-.58,3.13),(1.55,-.62,3.62),(1.77,-.47,3.51),(1.65,-.46,2.15),\n+ (1.22,-.62,1.62),(.83,-.48,1.97)],(0,-1,0),.105,.12,'main',kj)\n+ panel('calf.outer',[(1.76,-.24,5.65),(2.03,.32,5.0),(1.86,.84,4.39),(1.67,.74,2.53),\n+ (1.61,.24,2.14),(1.78,.02,3.91)],(1,0,0),.11,.13,'main',kj)\n+ panel('calf.rear_spine',[(.78,.7,5.62),(1.28,1.02,5.78),(1.8,.77,5.5),(1.84,1.0,4.8),\n+ (1.52,1.14,4.35),(.94,1.1,4.35),(.65,.86,4.83)],(0,1,0),.1,.14,'main',kj)\n+ for i in range(4):\n+ blk(f'calf.gill{i}',(1.24,1.16,5.02+i*.14),(.58,.07,.06),'joint',kj,.01)\n+ thruster('calf.'+side,(s*1.22,1.04,3.98),(0,.53,-.85),.3,.58,kj)\n+ # Lower rear is finished: paired tendon housings, not an empty underside behind a shin plate.\n+ for dx in (-.25,.25):\n+ bar(f'calf.tendon{dx}',(1.2+dx,.62,1.92),(1.25+dx,.83,3.55),.09,'frame',kj)\n+ bar(f'calf.rod{dx}',(1.2+dx,.62,1.92),(1.22+dx,.74,2.7),.04,'metal',kj)\n+ # Feet: short articulated toes, a planted sole and a separate heel. No coloured wedge.\n+ rod('ankle.axle.'+side,(s*.78,.1,1.55),(s*1.62,.1,1.55),.31,'joint',fj)\n+ shell('foot.instep.'+side,[(.36,s*1.2,-.12,1.0,.8,.66),(.77,s*1.2,.02,.96,.6,.6),\n+ (1.36,s*1.2,.08,.75,.38,.42),(1.66,s*1.2,.1,.55,.25,.32)],'accent',fj)\n+ blk('heel.sole',(1.2,.62,.23),(1.0,.9,.3),'joint',fj,.07)\n+ panel('heel.armour',[(.71,.85,.3),(1.69,.85,.3),(1.6,.85,1.03),(1.21,.64,1.34),(.8,.85,1.03)],\n+ (0,1,0),.08,.14,'main',fj)\n+ for dx in (-.27,.27):\n+ xx=1.2+dx\n+ blk(f'toe.sole{dx}',(xx,-.82,.21),(.48,1.63,.25),'joint',fj,.045)\n+ panel(f'toe.armour{dx}',[(xx-.24,-1.61,.34),(xx+.24,-1.61,.34),(xx+.23,-1.43,.61),\n+ (xx+.2,-.44,.97),(xx-.2,-.4,.97),(xx-.24,-1.0,.7)],(0,-.5,1),.055,.1,'main',fj)\n+ blk(f'toe.hinge{dx}',(xx,-.38,.75),(.39,.22,.18),'frame',fj,.04)\n+ for k in range(3):\n+ blk(f'toe.tread{dx}.{k}',(xx,-1.43+k*.35,.085),(.38,.18,.05),'frame',fj,.01)\n+ panel('foot.ankle_guard',[(.8,-.23,1.65),(1.6,-.23,1.65),(1.74,-.37,.85),(1.4,-.48,.62),\n+ (1.03,-.48,.62),(.67,-.37,.85)],(0,-1,0),.09,.13,'main',fj)\n+\n+ # Dorsal drive housings hang from the existing binder joints. Their tails protect the bells.\n+ shell('drive.structural.'+side,[(11.77,s*1.12,1.9,.89,.43,.54),(12.6,s*1.13,2.1,1.12,.52,.64),\n+ (14.47,s*1.09,1.94,1.18,.52,.66),(15.48,s*.96,1.66,.71,.39,.46)],'frame',dj)\n+ panel('drive.outer_cowl',[(1.01,1.65,15.58),(1.62,1.7,15.01),(1.81,2.21,13.86),\n+ (1.61,2.62,12.55),(1.47,2.48,11.84),(.98,2.12,12.0),(.96,1.96,14.31)],\n+ (1,.45,0),.18,.16,'main',dj)\n+ panel('drive.rear_upper',[(.66,2.25,15.06),(1.1,2.41,15.29),(1.62,2.33,14.82),(1.62,2.75,13.8),\n+ (1.13,2.88,13.34),(.65,2.62,13.63)],(0,1,0),.18,.16,'main',dj)\n+ panel('drive.rear_lower',[(.64,2.58,13.51),(1.1,2.84,13.2),(1.6,2.73,13.65),(1.51,2.89,12.78),\n+ (1.13,2.84,12.42),(.68,2.63,12.71)],(0,1,0),.08,.11,'accent',dj)\n+ for i in range(5):\n+ blk(f'drive.gill{i}',(1.13,2.99,13.75+i*.16),(.62,.07,.075),'joint',dj,.01)\n+ panel('drive.identification',[(.86,2.99,14.83),(1.35,2.99,14.87),(1.36,3.0,14.64),(.87,3.0,14.6)],\n+ (0,1,0),0,.025,'trim',dj)\n+ thruster('binder.'+side,(s*1.12,2.25,12.15),(s*.08,.55,-.84),.38,.7,dj)\n+ # Small side steering cluster, physically seated in a dark recess.\n+ blk('drive.rcs_block',(1.62,1.96,14.58),(.24,.42,.48),'joint',dj,.025)\n+ for zz in (14.48,14.7):\n+ rod(f'drive.rcs_lip{zz}.'+side,(s*1.72,2.0,zz),(s*1.8,2.0,zz),.075,'metal',dj)\n+ rod(f'drive.rcs_well{zz}.'+side,(s*1.805,2.0,zz),(s*1.81,2.0,zz),.052,'joint',dj)\n+\n+ # Spine: visible structural keel, radiator shutters, disconnects and main engines.\n+ shell('spine.keel',[(11.9,0,1.5,.62,.37,.45),(13.3,0,1.77,.77,.36,.63),\n+ (14.7,0,1.55,.7,.3,.43),(15.28,0,1.14,.46,.24,.3)],'accent',B)\n+ for i in range(7):\n+ z=12.5+i*.28\n+ plate(f'spine.radiator{i}',[(-.29,2.21,z),(.29,2.21,z),(.35,2.36,z+.13),\n+ (-.35,2.36,z+.13)],(0,1,0),0,.055,'metal',B)\n+ box('spine.service_latch',(0,2.45,14.65),(.22,.1,.33),'trim',B,.025)\n+ for s in (-1,1):\n+ rod(f'spine.feed{s}',(s*.35,1.7,12.1),(s*.54,2.0,13.0),.1,'frame',B)\n+ thruster('main.'+('L' if s==1 else 'R'),(s*.53,1.72,12.15),(0,.48,-.88),.42,.77,B)\n+\n+ # Helmet: a recessed wraparound optical band under an asymmetric, swept protective hood.\n+ rod('neck.turntable',(0,0,15.18),(0,0,15.89),.32,'joint',N)\n+ ring('neck.gasket',(0,0,15.64),(0,0,1),.39,.07,'frame',N)\n+ shell('head.pressure_shell',[(15.87,0,.05,.73,.46,.45),(16.19,0,.07,1.16,.56,.62),\n+ (16.87,0,.08,1.19,.55,.66),(17.27,0,.13,.66,.38,.48)],'accent',H)\n+ plate('head.hood',[(-.64,-.56,16.58),(-.57,-.68,17.02),(-.3,-.35,17.35),(.3,-.35,17.35),\n+ (.57,-.68,17.02),(.64,-.56,16.58),(.36,.68,16.77),(-.36,.68,16.77)],\n+ (0,-.35,1),.09,.12,'main',H)\n+ plate('head.optics',[(-.51,-.62,16.51),(-.44,-.76,16.7),(.44,-.76,16.7),(.51,-.62,16.51),\n+ (.35,-.72,16.31),(-.35,-.72,16.31)],(0,-1,0),.065,.04,'visor',H)\n+ line('head.sensor',[(-.36,-.82,16.53),(-.12,-.85,16.56),(.29,-.83,16.55)],H,'glow_eye',.025)\n+ box('head.rangefinder',(.39,-.76,16.44),(.09,.035,.12),'glow_core',H,.01)\n+ for s in (-1,1):\n+ plate('head.cheek'+str(s),[(s*.48,-.62,16.51),(s*.62,-.26,16.5),(s*.55,.31,16.16),\n+ (s*.29,-.26,15.95),(s*.3,-.65,16.14)],(s*.7,-.7,0),.07,.08,'main',H)\n+ box('head.temple_slot'+str(s),(s*.59,.1,16.68),(.045,.29,.1),'joint',H,.01)\n+ plate('head.nape',[(-.43,.59,16.78),(.43,.59,16.78),(.52,.71,16.38),(.27,.64,16.02),\n+ (-.27,.64,16.02),(-.52,.71,16.38)],(0,1,0),.08,.11,'main',H)\n+ for i in range(3):\n+ box(f'head.rear_vent{i}',(0,.8,16.25+i*.13),(.4,.05,.055),'joint',H,.008)\n+ plate('head.aerial',[(.4,.31,17.06),(.5,.24,17.07),(.47,.55,17.62),(.38,.65,17.57)],\n+ (1,0,0),0,.035,'frame',H)\n+ # Small, deliberately placed markings. They establish service scale without painting every edge.\n+ label('unit.left','0',(2.4,-.96,14.63),.3,J['shoulder.L'])\n+ label('unit.back','0',(.98,3.02,14.08),.25,J['binder.L'],back=True,role='main')\n+ label('service.chest','RESCUE',(-.32,-1.69,12.95),.09,hatch)\n+ label('service.leg','KEEP CLEAR',(.83,-.7,4.61),.075,J['shin.L'])\n+ # Markers stay on the shared skeleton, with no arbitrary body scaling or root offset.\n+ bpy.context.view_layer.update()\n+ return J['frame']\n*** End Patch")); text(await tools.exec_command({cmd:"~/.local/bin/blender -b --factory-startup -t 8 -P kit/build.py -- block_astra > review/out/astra/build-refined.log 2>&1","yield_time_ms":1000,"max_output_tokens":2000}));result, 4 lines
Script completed Wall time 1.2 seconds Output: {}{"chunk_id":"342c3d","wall_time_seconds":1.000779861,"session_id":36580,"original_token_count":0,"output":""}exec_command, clock__curr_timetail -18 review/out/astra/build-refined.log && sed -n '170,230p' src/render/space.ts && sed -n '1,80p' src/view/thrusters.ts && sed -n '1,70p' src/view/viewer.ts (+1 more)
input
text(await tools.exec_command({cmd:"tail -18 review/out/astra/build-refined.log && sed -n '170,230p' src/render/space.ts && sed -n '1,80p' src/view/thrusters.ts && sed -n '1,70p' src/view/viewer.ts","max_output_tokens":4500})); text(await tools.clock__curr_time({}));result, 4 lines
Script completed Wall time 0.0 seconds Output: {"chunk_id":"1f785b","wall_time_seconds":0.00000332,"exit_code":0,"original_token_count":2482,"output":"04:02:55 | INFO: Extracting primitive: waist.rearseal1.0\n04:02:55 | INFO: Primitives created: 1\n04:02:55 | INFO: Extracting primitive: waist.rearseal1.1\n04:02:55 | INFO: Primitives created: 1\n04:02:55 | INFO: Extracting primitive: waist.rearseal2.0\n04:02:55 | INFO: Primitives created: 1\n04:02:55 | INFO: Extracting primitive: waist.rearseal2.1\n04:02:55 | INFO: Primitives created: 1\n04:02:55 | INFO: Extracting primitive: waist.rearseal3.0\n04:02:55 | INFO: Primitives created: 1\n04:02:55 | INFO: Extracting primitive: waist.rearseal3.1\n04:02:55 | INFO: Primitives created: 1\n04:02:55 | INFO: Finished glTF 2.0 export in 0.5678637027740479 s\n\nkit: block_astra -> ~/work/sortie/public/assets/block_astra.glb (3388 KB, 5.2s)\nBlender 5.2.3 LTS (hash e13b728c6880 built 2026-10-22 01:35:05)\n\nBlender quit\n sun.castShadow = true;\n sun.shadow.mapSize.set(2048, 2048);\n const c = sun.shadow.camera;\n c.left = c.bottom = -28;\n c.right = c.top = 28;\n c.near = 1;\n c.far = 500;\n sun.shadow.bias = -0.0004;\n sun.shadow.normalBias = 0.04;\n scene.add(sun);\n scene.add(sun.target);\n scene.add(new THREE.HemisphereLight('#8fa6d6', '#1c2436', 0.25));\n const rim = new THREE.DirectionalLight('#9cc4ff', 1.6);\n rim.position.set(-sunDir.x, 0.35, -sunDir.z).multiplyScalar(200);\n rim.name = 'rim';\n scene.add(rim);\n return sun;\n}\n\n/** Keep the shadow box centred on what matters (the player's frame). */\nexport function followSun(sun: THREE.DirectionalLight, focus: THREE.Vector3, sunDir = SUN_DIR) {\n sun.target.position.copy(focus);\n sun.position.copy(focus).addScaledVector(sunDir, 200);\n}\n\n/** Reflections for metal and paint: the backdrop baked into a prefiltered environment map. */\nexport function spaceEnvironment(renderer: THREE.WebGLRenderer, backdrop: THREE.Scene, size = 256): THREE.Texture {\n const pmrem = new THREE.PMREMGenerator(renderer);\n const env = pmrem.fromScene(backdrop, 0.02, 1, 2e6, { size }).texture;\n pmrem.dispose();\n return env;\n}\nimport * as THREE from 'three';\nimport { model, type ModelName } from '../render/assets';\nimport { MechRig, POSES } from '../render/mech';\nimport type { PaletteName } from '../render/palette';\nimport { Pipeline } from '../render/pipeline';\nimport { addSpaceLight, createBackdrop, followSun, spaceEnvironment } from '../render/space';\nimport { STRIKER_DECALS, applyDecals } from '../render/decals';\nimport { treatEyes } from '../render/eyes';\nimport type { ThrustReading } from '../render/exhaust';\n\n/**\n * Thruster bench: one frame in a fixed thruster state at a fixed time, for judging plumes as stills.\n * /?view=thrusters&state=quick&t=0.06 a quick boost 60 ms after onset\n * /?view=thrusters&state=boost&close=main close on one main nozzle\n * /?view=thrusters&state=cycle&play=1 every state in turn, live\n * /?view=thrusters&cells=quick:0,quick:0.05,boost:0.5:main&cols=4&cw=480&ch=300 a sheet of stills\n * &frame=heavy_C &palette=raider &yaw=150 &pitch=12 &dist=40 &light=0 &tier=low\n * States: idle, cruise, boost, quick, assault, brake, strafe. `t` is seconds since the state began.\n */\nexport const BENCH_STATES = ['idle', 'cruise', 'boost', 'quick', 'assault', 'brake', 'strafe'] as const;\nexport type BenchState = (typeof BENCH_STATES)[number];\n\n/** A scripted flight reading for a bench state `t` seconds in: local thrust (left, up, forward as a\n * fraction of boosted forward thrust) and the boost flags, as the sim would report them. */\nexport function benchInput(state: BenchState, t: number) {\n const thrust = new THREE.Vector3();\n let boosting = false, assault = false, quick = Infinity;\n if (state === 'cruise') thrust.set(0, 0, 0.35);\n else if (state === 'boost') (thrust.set(0, 0, 1), (boosting = true));\n else if (state === 'quick') (thrust.set(0, 0, 0.05), (quick = t));\n else if (state === 'assault') (thrust.set(0, 0, 1), (boosting = true), (assault = true));\n else if (state === 'brake') thrust.set(0, 0.15, -0.6);\n else if (state === 'strafe') thrust.set(0.55, 0, 0.1);\n return { thrust, boosting, assault, quick };\n}\n\nexport async function startThrusterBench(canvas: HTMLCanvasElement, q: URLSearchParams) {\n await document.fonts.ready;\n const scene = new THREE.Scene();\n const camera = new THREE.PerspectiveCamera(Number(q.get('fov') ?? 35), 1, 0.3, 2e5);\n const backdrop = createBackdrop();\n const pipe = new Pipeline(canvas, scene, camera, backdrop);\n // ?tier=low: the software and weak GPU tier, no bloom\n const tier = q.get('tier');\n if (tier === 'low' || tier === 'medium') pipe.setQuality({ tier });\n const sun = addSpaceLight(scene);\n scene.environment = spaceEnvironment(pipe.renderer, backdrop);\n scene.environmentIntensity = Number(q.get('env') ?? 0.8);\n\n const name = (q.get('frame') ?? 'striker') as ModelName;\n const root = await model(name, (q.get('palette') ?? 'merc') as PaletteName);\n if (name === 'striker') applyDecals(root, STRIKER_DECALS);\n treatEyes(root, 'spill');\n scene.add(root);\n const rig = new MechRig(root);\n rig.apply(POSES.flight);\n root.updateMatrixWorld(true);\n\n const box = new THREE.Box3().setFromObject(root);\n const height = box.getSize(new THREE.Vector3()).y;\n const target = new THREE.Vector3();\n /** Aim the camera at the frame, or close on its first nozzle of a kind. */\n const aim = (close: string | null, yawAt?: string, pitchAt?: string) => {\n box.getCenter(target);\n const nozzle = close ? rig.nozzles.find((n) => n.kind === close) : undefined;\n if (nozzle) nozzle.node.getWorldPosition(target);\n const dist = Number(q.get('dist') ?? (nozzle ? height * 0.6 : height * 2.6));\n const yaw = THREE.MathUtils.degToRad(Number(yawAt || q.get('yaw') || (nozzle ? 125 : 132)));\n const pitch = THREE.MathUtils.degToRad(Number(pitchAt || q.get('pitch') || 10));\n if (q.has('ty')) target.y += Number(q.get('ty'));\n if (q.has('tz')) target.z += Number(q.get('tz'));\n camera.position.set(Math.sin(yaw) * Math.cos(pitch), Math.sin(pitch), Math.cos(yaw) * Math.cos(pitch)).multiplyScalar(dist).add(target);\n camera.lookAt(target);\n followSun(sun, target);\n };\n\n const light = new THREE.PointLight('#ffffff', 0, 0, 2);\n scene.add(light);\n const lit = q.get('light') !== '0';\n const reading: ThrustReading = { x: 0, y: 0, z: 0, boosting: false };\nimport * as THREE from 'three';\nimport { OrbitControls } from 'three/addons/controls/OrbitControls.js';\nimport { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';\nimport { model, type ModelName } from '../render/assets';\nimport { MechRig, POSES, type PoseName } from '../render/mech';\nimport type { PaletteName } from '../render/palette';\nimport { Pipeline } from '../render/pipeline';\nimport { addSpaceLight, createBackdrop, followSun, spaceEnvironment } from '../render/space';\nimport { STRIKER_DECALS, applyDecals, type DecalSpec } from '../render/decals';\nimport { PALETTES } from '../render/palette';\nimport { look, setLook } from '../render/look';\nimport { treatEyes, type EyeMode } from '../render/eyes';\nimport { fitShip } from '../render/ship';\nimport type { FrameClassId } from '../sim/frames';\n\n/**\n * Model viewer for review shots, in the game's own renderer:\n * /?view=striker&yaw=35&pitch=8&dist=34&pose=flight&weapon=rifle&palette=automaton\n * /?view=lineup (the frame in each palette, side by side)\n * /?view=ship&bays=light,heavy&frame=light (bay fits and shuttle clamps)\n * /?view=light&pose=launch&weapon=rifle (light and heavy frames and their variants pose like the striker)\n */\nconst FRAMES: string[] = ['striker_a', 'striker_b', 'light', 'light_line', 'light_lancer', 'heavy', 'heavy_B', 'heavy_C'];\n\n/** An emblem at every bearing anchor of a model: the anchor's position, its direction into the plate, its size. */\nfunction bearingDecals(root: THREE.Object3D, color: string): DecalSpec[] {\n root.updateMatrixWorld(true);\n const out: DecalSpec[] = [];\n root.traverse((o) => {\n if (!o.name.startsWith('bearing') || !o.visible) return;\n const at = root.worldToLocal(o.getWorldPosition(new THREE.Vector3()));\n const dir = o.userData.dir as [number, number, number] | undefined;\n const size = Number(o.userData.size ?? 0.5);\n if (dir) out.push({ kind: 'emblem', at: [at.x, at.y, at.z], dir, size: [size, size], color });\n });\n return out;\n}\n\nexport async function startViewer(canvas: HTMLCanvasElement, q: URLSearchParams) {\n setLook(q.get('look'));\n await document.fonts.ready;\n const scene = new THREE.Scene();\n const camera = new THREE.PerspectiveCamera(Number(q.get('fov') ?? 35), 1, 0.5, 2e5);\n // ?bg=studio: a plain grey ground, an even room light and little bloom, for judging shape\n const studio = q.get('bg') === 'studio';\n const backdrop = createBackdrop();\n const pipe = new Pipeline(canvas, scene, camera, studio ? null : backdrop);\n const sun = addSpaceLight(scene);\n if (studio) {\n scene.background = new THREE.Color('#3a3e45');\n const pmrem = new THREE.PMREMGenerator(pipe.renderer);\n scene.environment = pmrem.fromScene(new RoomEnvironment(), 0.04).texture;\n pipe.bloom.strength = Number(q.get('bloom') ?? 0.12);\n } else scene.environment = spaceEnvironment(pipe.renderer, backdrop);\n scene.environmentIntensity = Number(q.get('env') ?? (studio ? 0.6 : 0.8) * look().fill);\n const name = q.get('view') as ModelName | 'lineup';\n const target = new THREE.Vector3();\n const pose = (q.get('pose') ?? 'stand') as PoseName;\n const weapon = q.get('weapon') as ModelName | null;\n\n async function frame(palette: PaletteName, x: number, mech: ModelName = 'striker') {\n const root = await model(mech, palette);\n root.position.x = x;\n scene.add(root);\n if (mech === 'striker') applyDecals(root, STRIKER_DECALS);\n treatEyes(root, (q.get('eye') ?? 'spill') as EyeMode);\n const rig = new MechRig(root);\n rig.apply(POSES[pose] ?? POSES.stand);\n if (weapon) {\n rig.hold(await model(weapon, palette));\n"}{"current_time":"2026-11-15 04:03:07 UTC"}