A mech game prototype, pushed by Gemini 4 Carbon
agent
+42:55reasoning
Zero errors encountered, and the glTF export completed successfully in a short time. All tested components and configurations ran cleanly on the initial attempt. Immediate cleanup of the temporary file is required.
Authoring the carbon_0 mech and carbon_rifle begins, focusing on eight subsystems for precise sculpting. The process requires generating high-resolution visual critique sheets using the game renderer for iterative, visual inspection across the entire model. The first pass will create the full mech and rifle assets.
Initial inspection of the high-resolution renders is underway, meticulously evaluating the silhouette, menace, cockpit, and color balance of the mech and rifle assets. Spatial coordinates are being designed with extreme precision to ensure accurate integration and prevent collisions, referencing existing data. Verifying that the spatial data from the reference model striker matches the new design and ensures proper fit and proportions.
Initial torso coordinates set. Further investigation of the neck position reveals an opportunity to improve the interceptor head placement by making small, precise adjustments to its z and y coordinates for a lower, forward-raked position within the armored collar. This approach keeps the base joint origins clean and predictable, matching them to reference data. Cockpit coordinates are verified, and all related components are directly parented to the cockpit joint.
Torso coordinates confirmed. The backpack's position is set, followed by the left/right binders. Arm, leg, and foot coordinates were defined and verified, confirming the sole touches z=0.0. Bearing empties are added for shoulder and chest, alongside bespoke decals. The silhouette will be reviewed next to ensure a sleek and lethal mecha design, checking the waist width at z=11.2..11.85 to confirm a narrow athletic core.
Hydraulic pistons framing the waist will be added. The torso flares dramatically from x = ±0.92 at z = 12.1 to x = ±1.92 across the upper pectoral intakes at z = 14.55. The aero-keel cockpit pod juts sharply forward to y = -2.02 at z = 13.85.
Shoulder carapaces sweep outward and upward from x = ±1.82, z = 15.05 to swept wingtips at x = ±4.35, z = 15.88. The forward-raked head sits low, between high swept collar cowls. The cranium sweeps back, and the eyes are deep inside a curved visor recess.
The design incorporates a sleek, sensor-stabilized head with a recessed visor and intake grille. Front aero-faulds are sculpted with a chevron profile to ensure collision avoidance during leg movements in the flight pose, specifically addressing thigh pitch angles. Legs feature compound curves and reverse-flared calf nacelles.
Leg design continues, focusing on structural and aesthetic details. Thigh sections are defined with layered components: an accent intake cuff, a main body split by a seam, and a frame truss/hydraulic actuator. The knee comprises rotary drums and a double-layered aerodynamic knee-blade. Shins incorporate a razor-keeled front prow and dramatic swept-back calf vector-thrust nacelles with heat exchanger louvers and multi-petal vectored nozzles.
Focus is now on finalizing the legs. Details include the ankle spat design, actuator dampers, cloven-split twin-talon front foot, and a heel stabilizer. The dorsal flight pack and gull-wing binders are next: a compound-curved spine cowl houses the overboost reactor turbine. Twin main vector nacelles with angled armor pods terminating in 8-petal vectored nozzles will be added. Twin swept gull-wing aero-binders are set.
Each binder pivots on a rotary drum, extending outward and upward as a compound-curved gull-wing shield. Attitude-thruster pods with vectored nozzles are mounted on the ventral root of each binder. A high-frequency plasma blade pylon is racked along the dorsal spine of each binder. The rifle will be constructed with the aim of attaching the weapon to grip.R in MechRig.hold().
Rifle coordinates confirmed, adjusting the weapon's rotation and position relative to the grip. Examining props.py:build_rifle() to ensure precise alignment of the carbon_rifle with the grip.R target. This confirms the handle from z = -0.95 to z = +0.20, tilted rot("X", 14), receiver positioning from z = +0.35 to +1.18, and the electromagnetic rails extending forward. The design calls for an angled grip, a compound-curved receiver, and skeletonized buttstock, with twin railgun accelerator barrels.
write_file{"Content":"\"\"\"carbon_0 (\"Kestrel\", CX-00): original standard-class aerospace frame on block_dummy's 22-joint rig.\n\nBuilt directly on `mech.joints()` (exact 17.6 m striker/block_dummy skeleton) using compound-curved\nCatmull-Clark creased subdivision carapaces (`carbon_surf.patch_shell`), physical multi-plane seam\nsplits (`split_shell`), multi-material hydraulic actuators, double-drum joints, an articulated\ncockpit module, and 3-channel multi-petal vector thrusters (`main`, `binder`, `calf`).\n\"\"\"\nimport math\n\nfrom mathutils import Matrix, Vector\n\nfrom carbon_surf import actuator, aero_loft, basis_matrix, louver_bank, patch_shell, put_pair, rotary_drum, split_shell, vectored_nozzle\nfrom lib import circle, cylinder, empty, halves, loft, merge, octo, prism, rot, solid, transform\nfrom mech import gltf_dir, joints as striker_joints, lr\n\n\ndef build_pelvis(J):\n P = J[\"pelvis\"]\n # Sculpted structural pelvic chassis & hip gimbal yokes\n core = aero_loft([\n [(x, y, 9.72) for x, y in octo(0.86, 1.24, 0.24)],\n [(x, y, 10.22) for x, y in octo(2.15, 1.62, 0.38)],\n [(x, y, 10.68) for x, y in octo(2.42, 1.74, 0.42)],\n [(x, y, 11.02) for x, y in octo(1.92, 1.50, 0.35)],\n ], samples_per_span=3)\n put_pair(\"pelvis_chassis\", core, \"frame\", P, bevel=0.018)\n rotary_drum(\"hip_trunnion\", (1.58, 0.0, 10.55), 0.38, 0.58, P, P, axis=\"x\", cal_angle=15)\n\n # Central forward-swept aero codpiece keel + V-belt + recessed attitude vernier\n keel = patch_shell(\n [\n [(-0.34, -0.95, 10.98), (0.0, -1.16, 11.02), (0.34, -0.95, 10.98)],\n [(-0.42, -1.18, 10.52), (0.0, -1.46, 10.50), (0.42, -1.18, 10.52)],\n [(-0.36, -1.16, 9.96), (0.0, -1.44, 9.92), (0.36, -1.16, 9.96)],\n [(-0.22, -0.82, 9.52), (0.0, -1.04, 9.48), (0.22, -0.82, 9.52)],\n ],\n thickness=0.10,\n col_creases={1: 0.92},\n row_creases={1: 0.65},\n outward=(0, -1, 0),\n )\n k_top, k_bot = halves(keel, (0, -1.2, 10.56), (0, -0.15, 1), gap=0.032)\n put_pair(\"pelvis_belt_keel\", k_top, \"main\", P, bevel=0.014)\n k_mid, k_tip = halves(k_bot, (0, -1.2, 9.82), (0, 0.1, 1), gap=0.028)\n put_pair(\"codpiece_tip\", k_tip, \"trim\", P, bevel=0.012)\n put_pair(\"codpiece_body\", k_mid, \"accent\", P, bevel=0.014)\n put_pair(\"codpiece_vent\", louver_bank((0, -1.38, 10.18), (0, -1, -0.15), (0, -0.15, 1), 0.30, 0.28, count=4, depth=0.07),\n \"frame\", P, smooth=False, bevel=0.005)\n\n # Split compound-curved front chevron aero-faulds (swept forward for clean flight thigh clearance)\n f_skirt = patch_shell(\n [\n [(0.42, -1.16, 10.82), (1.12, -1.12, 10.80), (1.76, -0.88, 10.68)],\n [(0.46, -1.36, 10.42), (1.26, -1.34, 10.34), (1.96, -1.02, 10.20)],\n [(0.54, -1.42, 9.98), (1.38, -1.42, 9.80), (1.82, -1.10, 9.72)],\n ],\n thickness=0.075,\n row_creases={1: 0.80},\n outward=(0.25, -1.0, 0.1),\n )\n fs_lo, fs_hi = halves(f_skirt, (1.1, -1.3, 10.16), (-0.22, 0.08, 1.0), gap=0.032)\n put_pair(\"skirt_front_hi\", fs_hi, \"main\", P, P, bevel=0.014)\n put_pair(\"skirt_front_lo\", fs_lo, \"accent\", P, P, bevel=0.012)\n tab = patch_shell(\n [\n [(1.52, -1.30, 9.88), (1.84, -1.08, 9.78)],\n [(1.42, -1.38, 9.72), (1.74, -1.14, 9.62)],\n ],\n thickness=0.055,\n subd_levels=1,\n outward=(0.3, -1, -0.1),\n )\n put_pair(\"skirt_front_trim\", tab, \"trim\", P, P, bevel=0.008)\n\n # Side hip vernier pods (sleek horizontal aero nacelles flanking hip joints)\n side_pod = patch_shell(\n [\n [(1.82, -0.88, 10.72), (1.92, 0.05, 10.76), (1.78, 1.02, 10.68)],\n [(2.22, -0.96, 10.32), (2.40, 0.08, 10.35), (2.22, 1.18, 10.24)],\n [(2.04, -0.76, 9.72), (2.18, 0.12, 9.70), (2.02, 1.08, 9.65)],\n ],\n thickness=0.08,\n row_creases={1: 0.88},\n outward=(1, 0, 0.1),\n )\n sp_lo, sp_hi = halves(side_pod, (2.1, 0.0, 10.38), (0.15, 0.05, 1.0), gap=0.032)\n put_pair(\"hip_pod_top\", sp_hi, \"main\", P, P, bevel=0.014)\n put_pair(\"hip_pod_low\", sp_lo, \"accent\", P, P, bevel=0.014)\n put_pair(\"hip_pod_vent\", louver_bank((2.08, 1.06, 10.18), (0.35, 1.0, 0.0), (0, 0, 1), 0.28, 0.42, count=4),\n \"metal\", P, P, smooth=False, bevel=0.006)\n\n # Rear tail-stabilizer spine & overlapping compound rear skirt plates\n tail = aero_loft([\n [(x, y + 0.95, 10.92) for x, y in octo(0.62, 0.42, 0.12)],\n [(x, y + 1.32, 10.38) for x, y in octo(0.56, 0.58, 0.14)],\n [(x, y + 1.48, 9.68) for x, y in octo(0.38, 0.48, 0.10)],\n [(x, y + 1.24, 9.28) for x, y in octo(0.24, 0.30, 0.06)],\n ], samples_per_span=3)\n put_pair(\"tail_spine\", tail, \"accent\", P, bevel=0.014)\n put_pair(\"tail_louvers\", louver_bank((0, 1.44, 10.12), (0, 1, -0.2), (0, 0.2, 1), 0.34, 0.56, count=5),\n \"metal\", P, smooth=False, bevel=0.005)\n\n r_skirt = patch_shell(\n [\n [(0.32, 1.05, 10.78), (1.08, 1.08, 10.76), (1.68, 0.86, 10.62)],\n [(0.34, 1.34, 10.18), (1.18, 1.36, 10.14), (1.76, 1.04, 10.02)],\n [(0.30, 1.28, 9.52), (1.06, 1.30, 9.46), (1.52, 0.98, 9.48)],\n ],\n thickness=0.075,\n row_creases={1: 0.82},\n outward=(0.25, 1.0, 0.05),\n )\n rs_lo, rs_hi = halves(r_skirt, (1.0, 1.25, 10.02), (0.18, 0.0, 1.0), gap=0.032)\n put_pair(\"skirt_rear_hi\", rs_hi, \"main\", P, P, bevel=0.014)\n put_pair(\"skirt_rear_lo\", rs_lo, \"main\", P, P, bevel=0.014)\n\n\ndef build_waist(J):\n W = J[\"waist\"]\n # Pinched articulated spinal column + segmented flexible corset + crossed chrome-rod hydraulics\n spine = aero_loft([\n [(x, y + 0.04, 10.88) for x, y in octo(1.36, 1.22, 0.32)],\n [(x, y + 0.02, 11.42) for x, y in octo(1.24, 1.14, 0.30)],\n [(x, y + 0.00, 11.98) for x, y in octo(1.48, 1.30, 0.34)],\n ], samples_per_span=3)\n put_pair(\"waist_core\", spine, \"joint\", W, bevel=0.015)\n\n # Dorsal articulated thoracic vertebrae blocks (visible from behind!)\n for i, zc in enumerate((11.12, 11.44, 11.76)):\n vert_plate = patch_shell(\n [\n [(-0.46, 0.56, zc - 0.11), (0.0, 0.78, zc - 0.12), (0.46, 0.56, zc - 0.11)],\n [(-0.50, 0.62, zc + 0.11), (0.0, 0.86, zc + 0.10), (0.50, 0.62, zc + 0.11)],\n ],\n thickness=0.065,\n subd_levels=1,\n col_creases={1: 0.9},\n outward=(0, 1, 0),\n )\n put_pair(f\"spine_vert{i}\", vert_plate, \"frame\", W, bevel=0.01)\n\n # Segmented front abdominal armor corset ribs\n for i, (zc, wy, hw) in enumerate(((11.14, -0.78, 0.56), (11.46, -0.86, 0.62), (11.78, -0.94, 0.68))):\n rib = patch_shell(\n [\n [(-hw, wy + 0.22, zc - 0.12), (0.0, wy - 0.04, zc - 0.13), (hw, wy + 0.22, zc - 0.12)],\n [(-hw * 1.05, wy + 0.20, zc + 0.12), (0.0, wy - 0.08, zc + 0.13), (hw * 1.05, wy + 0.20, zc + 0.12)],\n ],\n thickness=0.06,\n subd_levels=2,\n col_creases={1: 0.85},\n outward=(0, -1, 0),\n )\n put_pair(f\"ab_corset{i}\", rib, \"frame\" if i < 2 else \"accent\", W, bevel=0.01)\n\n # Dual front & rear hydraulic stabilizer actuators with bright metal piston shafts\n actuator(\"waist_act_f\", (0.64, -0.34, 10.92), (0.84, -0.46, 11.96), r=0.085, jl=W, jr=W)\n actuator(\"waist_act_r\", (0.58, 0.44, 10.92), (0.76, 0.52, 11.96), r=0.085, jl=W, jr=W)\n\n\ndef build_torso_and_cockpit(J):\n T = J[\"torso\"]\n C = J[\"cockpit\"]\n\n # Inner thoracic structural frame + exposed side rib trusses + clavicle pistons\n chest_core = aero_loft([\n [(x, y, 11.90) for x, y in octo(1.66, 1.44, 0.36)],\n [(x, y - 0.06, 12.75) for x, y in octo(2.28, 1.92, 0.45)],\n [(x, y - 0.10, 13.95) for x, y in octo(2.88, 2.28, 0.54)],\n [(x, y - 0.04, 14.88) for x, y in octo(2.62, 2.04, 0.48)],\n [(x, y + 0.04, 15.32) for x, y in octo(1.68, 1.44, 0.36)],\n ], samples_per_span=3)\n put_pair(\"torso_chassis\", chest_core, \"frame\", T, bevel=0.02)\n actuator(\"clavicle_strut\", (0.66, -0.22, 15.12), (1.82, -0.08, 14.72), r=0.08, jl=T, jr=T, body_role=\"frame\", rod_role=\"metal\")\n\n # ---- COCKPIT MODULE (parented to J[\"cockpit\"] so it hinges/moves as the true pilot hatch) ----\n # Forward-jutting interceptor keel canopy carapace\n canopy_shell = patch_shell(\n [\n [(-0.48, -1.24, 14.86), (0.0, -1.48, 14.94), (0.48, -1.24, 14.86)],\n [(-0.62, -1.62, 14.28), (0.0, -1.96, 14.34), (0.62, -1.62, 14.28)],\n [(-0.64, -1.72, 13.56), (0.0, -2.08, 13.62), (0.64, -1.72, 13.56)],\n [(-0.52, -1.46, 12.72), (0.0, -1.76, 12.68), (0.52, -1.46, 12.72)],\n [(-0.38, -1.16, 12.08), (0.0, -1.36, 12.04), (0.38, -1.16, 12.08)],\n ],\n thickness=0.11,\n col_creases={1: 0.92},\n row_creases={2: 0.78},\n outward=(0, -1, 0),\n )\n c_lo, c_hi = halves(canopy_shell, (0, -1.8, 13.78), (0, -0.22, 1.0), gap=0.034)\n put_pair(\"cockpit_hood\", c_hi, \"main\", C, bevel=0.015)\n c_belly, c_mid = halves(c_lo, (0, -1.6, 12.68), (0, 0.15, 1.0), gap=0.030)\n put_pair(\"cockpit_tub\", c_mid, \"accent\", C, bevel=0.015)\n put_pair(\"cockpit_keel_low\", c_belly, \"main\", C, bevel=0.014)\n\n # Emergency release trim latch & pilot optical periscope slit on cockpit canopy\n latch = patch_shell(\n [\n [(-0.26, -1.52, 14.82), (0.0, -1.68, 14.88), (0.26, -1.52, 14.82)],\n [(-0.32, -1.76, 14.48), (0.0, -1.98, 14.52), (0.32, -1.76, 14.48)],\n ],\n thickness=0.06,\n subd_levels=2,\n col_creases={1: 0.9},\n outward=(0, -1, 0.25),\n )\n put_pair(\"cockpit_latch\", latch, \"trim\", C, bevel=0.01)\n\n periscope = patch_shell(\n [\n [(-0.36, -1.72, 14.44), (0.0, -1.94, 14.48), (0.36, -1.72, 14.44)],\n [(-0.40, -1.80, 14.26), (0.0, -2.02, 14.30), (0.40, -1.80, 14.26)],\n ],\n thickness=0.05,\n subd_levels=2,\n outward=(0, -1, 0.15),\n )\n put_pair(\"cockpit_visor\", periscope, \"visor\", C, bevel=0.008)\n peri_glow = prism([(-0.24, 14.34), (0.24, 14.34), (0.20, 14.40), (-0.20, 14.40)], -2.03, -1.96, \"xz\")\n put_pair(\"cockpit_optic\", peri_glow, \"glow_core\", C, bevel=0.0, smooth=False, outline=False)\n\n # Recessed ventral chest reactor lens aperture in cockpit tub\n bezel = transform(loft([(-0.18, circle(0.36, 20)), (0.06, circle(0.30, 20))]), basis_matrix((0, -1.96, 13.26), (0, -1, -0.18), (0, -0.18, 1)))\n lens = transform(loft([(0.01, circle(0.24, 20)), (0.07, circle(0.22, 20))]), basis_matrix((0, -1.96, 13.26), (0, -1, -0.18), (0, -0.18, 1)))\n iris = transform(loft([(0.05, circle(0.11, 16)), (0.085, circle(0.10, 16))]), basis_matrix((0, -1.96, 13.26), (0, -1, -0.18), (0, -0.18, 1)))\n put_pair(\"reactor_bezel\", bezel, \"metal\", C, bevel=0.008)\n put_pair(\"reactor_lens\", lens, \"sensor\", C, bevel=0.005)\n put_pair(\"reactor_iris\", iris, \"glow_core\", C, bevel=0.0, smooth=False, outline=False)\n\n # Pilot boarding grab-handles flanking the cockpit canopy\n grab = merge(\n cylinder(0.028, 13.55, 14.35, 8, at=(0.63, -1.66)),\n cylinder(0.028, -1.66, -1.52, 8, axis=\"y\", at=(0.63, 13.55)),\n cylinder(0.028, -1.66, -1.52, 8, axis=\"y\", at=(0.63, 14.35)),\n )\n put_pair(\"cockpit_grab\", grab, \"metal\", C, C, bevel=0.004)\n\n # ---- COMPOUND-CURVED PECTORAL & LATERAL TORSO SHELLS (parented to J[\"torso\"]) ----\n # Continuous 3D master shell wrapping from cockpit channel -> front intake -> side ribcage -> dorsal scapula\n pec_master = patch_shell(\n [\n [(0.58, -1.24, 14.96), (1.28, -1.16, 15.02), (1.76, -0.52, 14.88), (1.66, 0.88, 14.92)],\n [(0.66, -1.64, 14.32), (1.52, -1.52, 14.36), (1.98, -0.56, 14.22), (1.78, 1.06, 14.28)],\n [(0.66, -1.56, 13.48), (1.46, -1.40, 13.46), (1.86, -0.46, 13.38), (1.66, 1.02, 13.44)],\n [(0.54, -1.22, 12.56), (1.18, -1.08, 12.54), (1.52, -0.34, 12.52), (1.38, 0.84, 12.58)],\n ],\n thickness=0.095,\n row_creases={1: 0.86},\n col_creases={2: 0.65},\n outward=(1.0, -0.6, 0.1),\n )\n # Slice into 3 flush multi-role plates sharing exact compound curvature across 36 mm physical shadow seams!\n pec_lower, pec_upper = halves(pec_master, (1.2, -0.8, 13.68), (-0.18, -0.10, 1.0), gap=0.036)\n pec_front, pec_outer = halves(pec_upper, (1.56, -0.5, 14.4), (1.0, 0.32, 0.12), gap=0.034)\n put_pair(\"chest_pec_main\", pec_front, \"main\", T, T, bevel=0.015)\n put_pair(\"chest_pec_fender\", pec_outer, \"accent\", T, T, bevel=0.015)\n\n rib_lo, rib_hi = halves(pec_lower, (1.1, -0.6, 13.02), (0.22, -0.08, 1.0), gap=0.034)\n put_pair(\"chest_rib_hi\", rib_hi, \"accent\", T, T, bevel=0.014)\n put_pair(\"chest_rib_lo\", rib_lo, \"main\", T, T, bevel=0.014)\n\n # Sculpted Collar Turbine Intakes (trim cowl lip + dark duct + metal compressor louvers)\n intake_lip = patch_shell(\n [\n [(0.72, -1.48, 14.92), (1.38, -1.40, 14.96)],\n [(0.74, -1.66, 14.54), (1.44, -1.56, 14.56)],\n ],\n thickness=0.055,\n subd_levels=1,\n outward=(0.15, -1.0, 0.25),\n )\n put_pair(\"collar_intake_lip\", intake_lip, \"trim\", T, T, bevel=0.008)\n put_pair(\"collar_intake_vanes\", louver_bank((1.08, -1.48, 14.72), (0.12, -1.0, 0.18), (0, 0.18, 1), 0.56, 0.30, count=4, depth=0.10),\n \"metal\", T, T, smooth=False, bevel=0.005)\n\n # High swept armoured collar shrouds framing the sunken neck pit\n collar = patch_shell(\n [\n [(0.54, -0.96, 14.94), (0.98, -0.62, 15.00), (0.96, 0.68, 14.98), (0.52, 0.92, 14.95)],\n [(0.58, -0.78, 15.54), (1.06, -0.44, 15.62), (0.98, 0.58, 15.56), (0.50, 0.82, 15.48)],\n ],\n thickness=0.075,\n col_creases={1: 0.8},\n outward=(1.0, 0.0, 0.2),\n )\n put_pair(\"collar_shroud\", collar, \"main\", T, T, bevel=0.012)\n\n # Dorsal scapular spine plate & angled titanium heat-sink vents (seen from behind in flight)\n dorsal = patch_shell(\n [\n [(-0.78, 1.02, 15.12), (0.0, 1.24, 15.18), (0.78, 1.02, 15.12)],\n [(-1.12, 1.18, 14.05), (0.0, 1.42, 14.12), (1.12, 1.18, 14.05)],\n [(-0.88, 0.98, 12.42), (0.0, 1.22, 12.38), (0.88, 0.98, 12.42)],\n ],\n thickness=0.09,\n col_creases={1: 0.88},\n outward=(0, 1, 0),\n )\n put_pair(\"dorsal_carapace\", dorsal, \"accent\", T, bevel=0.014)\n put_pair(\"scapula_vents\", louver_bank((1.28, 1.08, 14.55), (0.35, 1.0, 0.15), (0, -0.15, 1), 0.44, 0.54, count=5),\n \"metal\", T, T, smooth=False, bevel=0.005)\n\n\ndef build_head(J):\n N, H = J[\"neck\"], J[\"head\"]\n # Articulated multi-piston mechanical neck column\n put_pair(\"neck_column\", cylinder(0.32, 15.15, 16.02, 16, at=(0, -0.04)), \"joint\", N, bevel=0.008)\n put_pair(\"neck_collar\", loft([(15.32, octo(0.86, 0.88, 0.20, y=-0.04)), (15.58, octo(0.76, 0.78, 0.18, y=-0.04))]),\n \"frame\", N, bevel=0.012)\n actuator(\"neck_piston\", (0.28, -0.28, 15.18), (0.24, -0.34, 15.96), r=0.052, jl=N, jr=N)\n\n # Inner sensor cranium chassis\n skull = aero_loft([\n [(x, y - 0.08, 15.88) for x, y in octo(0.76, 1.02, 0.22)],\n [(x, y - 0.12, 16.45) for x, y in octo(1.02, 1.38, 0.28)],\n [(x, y + 0.04, 16.96) for x, y in octo(0.88, 1.32, 0.26)],\n ], samples_per_span=3)\n put_pair(\"head_chassis\", skull, \"frame\", H, bevel=0.012)\n\n # Compound-curved forward-raked Kestrel interceptor cranium cowl (NO Gundam V-fin, NO face slits!)\n cranium = patch_shell(\n [\n [(-0.56, -0.66, 16.64), (-0.24, -1.06, 16.60), (0.0, -1.18, 16.58), (0.24, -1.06, 16.60), (0.56, -0.66, 16.64)],\n [(-0.64, -0.18, 16.96), (-0.30, -0.56, 17.08), (0.0, -0.68, 17.14), (0.30, -0.56, 17.08), (0.64, -0.18, 16.96)],\n [(-0.58, 0.42, 17.04), (-0.28, 0.26, 17.24), (0.0, 0.22, 17.30), (0.28, 0.26, 17.24), (0.58, 0.42, 17.04)],\n [(-0.40, 1.02, 16.72), (-0.20, 1.12, 16.86), (0.0, 1.18, 16.90), (0.20, 1.12, 16.86), (0.40, 1.02, 16.72)],\n ],\n thickness=0.075,\n col_creases={2: 0.95},\n row_creases={1: 0.55},\n outward=(0, -0.2, 1.0),\n )\n cr_rear, cr_front = halves(cranium, (0, 0.08, 17.0), (0, -1.0, 0.25), gap=0.028)\n put_pair(\"head_brow_cowl\", cr_front, \"main\", H, bevel=0.010)\n put_pair(\"head_occipital\", cr_rear, \"main\", H, bevel=0.010)\n\n # Dorsal longitudinal telemetry sensor crest (low-profile stealth blade along cranium spine)\n dorsal_sensor = aero_loft([\n [(-0.07, -0.78, 16.98), (0.07, -0.78, 16.98), (0.04, -0.68, 17.22), (-0.04, -0.68, 17.22)],\n [(-0.08, 0.05, 17.18), (0.08, 0.05, 17.18), (0.05, 0.12, 17.44), (-0.05, 0.12, 17.44)],\n [(-0.06, 0.88, 16.88), (0.06, 0.88, 16.88), (0.03, 1.06, 17.16), (-0.03, 1.06, 17.16)],\n ], samples_per_span=3)\n put_pair(\"head_dorsal_crest\", dorsal_sensor, \"trim\", H, bevel=0.006)\n crest_lens = prism([(-0.032, 17.02), (0.032, 17.02), (0.026, 17.18), (-0.026, 17.18)], -0.82, -0.66, \"xz\")\n put_pair(\"head_crest_lens\", crest_lens, \"sensor\", H, bevel=0.004)\n\n # Deep-set smoked wrap-around visor + twin predatory angled optic slits (`glow_eye` + `glow_hot`)\n visor = patch_shell(\n [\n [(-0.58, -0.52, 16.60), (-0.28, -0.92, 16.58), (0.0, -1.00, 16.56), (0.28, -0.92, 16.58), (0.58, -0.52, 16.60)],\n [(-0.56, -0.48, 16.34), (-0.26, -0.88, 16.32), (0.0, -0.95, 16.30), (0.26, -0.88, 16.32), (0.56, -0.48, 16.34)],\n ],\n thickness=0.05,\n subd_levels=2,\n outward=(0, -1, 0),\n )\n put_pair(\"head_visor_wrap\", visor, \"visor\", H, bevel=0.006)\n\n # Twin canted predator optic blades (canted 14 deg upward-outward, separated by nasal sensor bridge)\n eye_outer = prism([(0.08, 16.40), (0.48, 16.51), (0.44, 16.57), (0.09, 16.46)], -0.97, -0.84, \"xz\")\n eye_outer = transform(eye_outer, rot(\"Z\", 16, about=(0.08, -0.92, 16.44)))\n put_pair(\"head_eye_blade\", eye_outer, \"glow_eye\", H, H, bevel=0.0, smooth=False, outline=False)\n\n eye_core = prism([(0.12, 16.425), (0.34, 16.485), (0.32, 16.525), (0.13, 16.465)], -0.985, -0.88, \"xz\")\n eye_core = transform(eye_core, rot(\"Z\", 16, about=(0.08, -0.92, 16.44)))\n put_pair(\"head_eye_pupil\", eye_core, \"glow_hot\", H, H, bevel=0.0, smooth=False, outline=False)\n\n # Sculpted aero cheek fairings & angular jaw air-splitter keel (zero mouth slits, pure interceptor aero)\n cheek = patch_shell(\n [\n [(0.18, -0.90, 16.32), (0.54, -0.66, 16.44), (0.76, -0.06, 16.62), (0.68, 0.72, 16.58)],\n [(0.14, -0.84, 15.86), (0.48, -0.58, 15.96), (0.70, 0.02, 16.12), (0.60, 0.68, 16.16)],\n ],\n thickness=0.068,\n col_creases={1: 0.85},\n outward=(1.0, -0.5, -0.1),\n )\n put_pair(\"head_cheek_cowl\", cheek, \"main\", H, H, bevel=0.010)\n\n chin = aero_loft([\n [(-0.18, -0.86, 16.30), (0.18, -0.86, 16.30), (0.14, -0.62, 16.30), (-0.14, -0.62, 16.30)],\n [(-0.22, -0.96, 16.04), (0.22, -0.96, 16.04), (0.18, -0.64, 16.02), (-0.18, -0.64, 16.02)],\n [(-0.13, -0.84, 15.76), (0.13, -0.84, 15.76), (0.12, -0.58, 15.78), (-0.12, -0.58, 15.78)],\n ], samples_per_span=2)\n put_pair(\"head_chin_splitter\", chin, \"accent\", H, bevel=0.008)\n\n # Temple laser-rangefinder optical pods + Twin swept-back Kestrel aero-stabilizer ears\n ear_pod = transform(\n merge(\n loft([(-0.08, circle(0.16, 16)), (0.10, circle(0.14, 16))]),\n loft([(0.08, circle(0.10, 14)), (0.13, circle(0.09, 14))]),\n ),\n basis_matrix((0.72, -0.02, 16.52), (1.0, -0.08, 0.05), (0, 0, 1)),\n )\n ear_lens = transform(loft([(0.11, circle(0.075, 14)), (0.145, circle(0.070, 14))]),\n basis_matrix((0.72, -0.02, 16.52), (1.0, -0.08, 0.05), (0, 0, 1)))\n put_pair(\"head_rangefinder\", ear_pod, \"metal\", H, H, bevel=0.006)\n put_pair(\"head_range_lens\", ear_lens, \"sensor\", H, H, bevel=0.004)\n\n # Twin canted rear swept comms/sensor blades (signature hawk-eared silhouette from front, profile & rear!)\n stab = aero_loft([\n [(0.62, 0.06, 16.50), (0.74, 0.08, 16.46), (0.74, 0.42, 16.42), (0.62, 0.40, 16.46)],\n [(0.72, 0.56, 17.02), (0.81, 0.58, 16.98), (0.79, 0.86, 16.92), (0.70, 0.84, 16.96)],\n [(0.80, 1.08, 17.54), (0.85, 1.10, 17.51), (0.84, 1.24, 17.46), (0.79, 1.22, 17.49)],\n ], samples_per_span=3)\n st_base, st_tip = halves(stab, (0.76, 0.78, 17.24), (0.1, 0.45, 1.0), gap=0.020)\n put_pair(\"head_stabilizer\", st_base, \"accent\", H, H, bevel=0.008)\n put_pair(\"head_stabilizer_tip\", st_tip, \"trim\", H, H, bevel=0.006)\n\n\ndef build_arms(J):\n SL, SR = lr(J, \"shoulder\")\n UL, UR = lr(J, \"upperarm\")\n FL, FR = lr(J, \"forearm\")\n HL, HR = lr(J, \"hand\")\n\n # ---- SHOULDERS: 3-Tier Gull-Wing Variable-Sweep Pauldron + Outboard Attitude-Vernier Pod ----\n sh_chassis = aero_loft([\n [(1.52, y, z + 14.56) for y, z in octo(1.36, 1.28, 0.30)],\n [(2.76, y, z + 14.52) for y, z in octo(1.26, 1.18, 0.28)],\n ], samples_per_span=2)\n put_pair(\"shoulder_chassis\", sh_chassis, \"frame\", SL, SR, bevel=0.015)\n rotary_drum(\"shoulder_gimbal\", (2.42, 0.0, 14.45), 0.36, 0.62, SL, SR, axis=\"x\", cal_angle=90)\n\n # Compound-curved Gull-Wing upper carapace sweeping to crisp aero wingtips at x = +-4.32\n pauldron = patch_shell(\n [\n [(1.82, -0.92, 14.96), (2.92, -1.16, 15.32), (4.26, -0.62, 15.66)],\n [(1.86, 0.04, 15.26), (3.08, 0.06, 15.78), (4.36, 0.16, 15.92)],\n [(1.82, 0.96, 14.92), (2.94, 1.20, 15.26), (4.18, 0.88, 15.54)],\n ],\n thickness=0.085,\n row_creases={1: 0.90},\n outward=(0.25, 0.0, 1.0),\n )\n p_in, p_out = halves(pauldron, (3.12, 0.0, 15.5), (1.0, 0.06, -0.18), gap=0.036)\n put_pair(\"pauldron_in\", p_in, \"main\", SL, SR, bevel=0.014)\n put_pair(\"pauldron_out\", p_out, \"main\", SL, SR, bevel=0.014)\n\n # Nested outboard attitude-control vernier nacelle under the wingtip\n vpod = patch_shell(\n [\n [(3.18, -0.96, 15.22), (3.88, -0.82, 15.38), (4.18, -0.44, 15.22)],\n [(3.26, 0.04, 15.36), (4.06, 0.08, 15.48), (4.26, 0.12, 14.92)],\n [(3.16, 1.02, 15.16), (3.86, 0.94, 15.28), (4.12, 0.68, 14.84)],\n ],\n thickness=0.08,\n row_creases={1: 0.85},\n outward=(1.0, 0.0, -0.2),\n )\n vp_body, vp_strake = halves(vpod, (3.95, 0.0, 15.05), (1.0, 0.0, -0.45), gap=0.028)\n put_pair(\"pauldron_vpod\", vp_body, \"accent\", SL, SR, bevel=0.014)\n put_pair(\"pauldron_strake\", vp_strake, \"trim\", SL, SR, bevel=0.010)\n put_pair(\"pauldron_rcs_f\", louver_bank((3.62, -0.92, 15.16), (0.3, -1.0, -0.1), (0, -0.1, 1), 0.34, 0.22, count=3),\n \"metal\", SL, SR, smooth=False, bevel=0.005)\n put_pair(\"pauldron_rcs_r\", louver_bank((3.60, 0.98, 15.10), (0.3, 1.0, -0.1), (0, 0.1, 1), 0.34, 0.22, count=3),\n \"metal\", SL, SR, smooth=False, bevel=0.005)\n\n # Dorsal shoulder aero-winglet spoiler\n winglet = aero_loft([\n [(2.26, -0.32, 15.34), (2.40, -0.32, 15.34), (2.40, 0.68, 15.30), (2.26, 0.68, 15.30)],\n [(2.34, 0.05, 16.02), (2.44, 0.05, 16.02), (2.44, 0.88, 15.92), (2.34, 0.88, 15.92)],\n ], samples_per_span=2)\n put_pair(\"pauldron_winglet\", winglet, \"accent\", SL, SR, bevel=0.010)\n\n # Bearing anchor on left shoulder for optional emblem projection\n empty(\"bearing.shoulder.L\", (3.75, 0.05, 15.62), SL, dir=gltf_dir((0.45, 0.0, 0.89)), size=0.72)\n\n # ---- UPPER ARMS: Bicep/Tricep Split Compound Shells + Exposed Lateral Hydraulic Rod ----\n bicep_core = aero_loft([\n [(x + 2.48, y, 12.12) for x, y in octo(0.76, 0.82, 0.20)],\n [(x + 2.48, y, 13.25) for x, y in octo(0.84, 0.90, 0.22)],\n [(x + 2.46, y, 14.28) for x, y in octo(0.80, 0.86, 0.20)],\n ], samples_per_span=2)\n put_pair(\"upperarm_chassis\", bicep_core, \"joint\", UL, UR, bevel=0.012)\n actuator(\"bicep_piston\", (2.94, -0.06, 12.35), (2.92, -0.04, 13.92), r=0.062, jl=UL, jr=UR)\n\n bicep_f = patch_shell(\n [\n [(2.04, -0.22, 13.98), (2.50, -0.64, 14.02), (2.96, -0.22, 13.98)],\n [(2.02, -0.26, 13.18), (2.52, -0.72, 13.20), (3.00, -0.26, 13.18)],\n [(2.08, -0.20, 12.42), (2.50, -0.58, 12.40), (2.92, -0.20, 12.42)],\n ],\n thickness=0.07,\n col_creases={1: 0.82},\n outward=(0, -1, 0),\n )\n bf_lo, bf_hi = halves(bicep_f, (2.5, -0.6, 13.62), (0, 0, 1), gap=0.028)\n put_pair(\"bicep_cuff\", bf_hi, \"accent\", UL, UR, bevel=0.010)\n put_pair(\"bicep_front\", bf_lo, \"main\", UL, UR, bevel=0.012)\n\n tricep_r = patch_shell(\n [\n [(2.04, 0.22, 13.96), (2.50, 0.64, 14.00), (2.96, 0.22, 13.96)],\n [(2.02, 0.26, 13.18), (2.52, 0.70, 13.18), (3.00, 0.26, 13.18)],\n [(2.08, 0.20, 12.42), (2.50, 0.58, 12.40), (2.92, 0.20, 12.42)],\n ],\n thickness=0.07,\n col_creases={1: 0.82},\n outward=(0, 1, 0),\n )\n put_pair(\"tricep_rear\", tricep_r, \"main\", UL, UR, bevel=0.012)\n\n # Compound Rotary Elbow Drum + Hydraulic Damper\n rotary_drum(\"elbow_drum\", (2.50, 0.0, 11.95), 0.42, 0.86, UL, UR, axis=\"x\", cal_angle=180)\n actuator(\"elbow_damper\", (2.50, 0.56, 12.42), (2.50, 0.50, 11.45), r=0.072, jl=FL, jr=FR)\n\n # ---- FOREARMS: Sculpted Aero-Vambrace + Olecranon Guard + Hardpoint Latch ----\n fa_core = aero_loft([\n [(x + 2.50, y, 9.58) for x, y in octo(0.58, 0.68, 0.16)],\n [(x + 2.50, y, 10.90) for x, y in octo(0.74, 0.86, 0.20)],\n [(x + 2.50, y, 11.95) for x, y in octo(0.76, 0.88, 0.20)],\n ], samples_per_span=2)\n put_pair(\"forearm_chassis\", fa_core, \"frame\", FL, FR, bevel=0.012)\n\n # Outer compound aero-shield vambrace sweeping up into pointed elbow spur\n vambrace_out = patch_shell(\n [\n [(2.52, -0.52, 12.16), (3.12, -0.44, 12.06), (3.26, 0.08, 12.24), (2.82, 0.78, 12.48)],\n [(2.52, -0.64, 11.12), (3.24, -0.52, 11.08), (3.34, 0.04, 11.12), (2.92, 0.68, 11.16)],\n [(2.50, -0.50, 9.72), (2.94, -0.42, 9.70), (3.00, 0.02, 9.72), (2.74, 0.50, 9.74)],\n ],\n thickness=0.075,\n col_creases={2: 0.88},\n outward=(1.0, 0.0, 0.0),\n )\n vo_lo, vo_hi = halves(vambrace_out, (3.0, 0.0, 11.36), (-0.18, 0.08, 1.0), gap=0.030)\n put_pair(\"vambrace_spur\", vo_hi, \"main\", FL, FR, bevel=0.012)\n vo_main, vo_band = halves(vo_lo, (3.0, 0.0, 10.12), (0.0, 0.0, -1.0), gap=0.028)\n put_pair(\"vambrace_out\", vo_main, \"main\", FL, FR, bevel=0.012)\n put_pair(\"vambrace_cuff\", vo_band, \"trim\", FL, FR, bevel=0.010)\n\n # Recessed hardpoint rail on outer forearm\n hp = aero_loft([\n [(3.24, -0.32, 10.38), (3.38, -0.26, 10.42), (3.38, 0.28, 10.42), (3.24, 0.34, 10.38)],\n [(3.30, -0.34, 11.24), (3.46, -0.28, 11.20), (3.46, 0.30, 11.20), (3.30, 0.36, 11.24)],\n ], samples_per_span=2)\n put_pair(\"vambrace_hardpoint\", hp, \"accent\", FL, FR, bevel=0.010)\n latch_ring = transform(loft([(0.0, circle(0.14, 14)), (0.06, circle(0.12, 14))]),\n basis_matrix((3.43, 0.01, 10.82), (1, 0, 0.05), (0, 0, 1)))\n put_pair(\"vambrace_latch\", latch_ring, \"metal\", FL, FR, bevel=0.005)\n\n # Inner forearm fairing\n vambrace_in = patch_shell(\n [\n [(2.46, -0.50, 11.88), (2.02, -0.38, 11.84), (1.98, 0.38, 11.84), (2.46, 0.52, 11.88)],\n [(2.46, -0.54, 10.82), (1.98, -0.40, 10.80), (1.96, 0.40, 10.80), (2.46, 0.54, 10.82)],\n [(2.46, -0.44, 9.72), (2.10, -0.34, 9.70), (2.08, 0.34, 9.70), (2.46, 0.44, 9.72)],\n ],\n thickness=0.068,\n col_creases={1: 0.75, 2: 0.75},\n outward=(-1.0, 0.0, 0.0),\n )\n put_pair(\"vambrace_in\", vambrace_in, \"main\", FL, FR, bevel=0.012)\n\n # ---- ARTICULATED 5-DIGIT MECHANICAL MANIPULATORS (`hand.L/R`) ----\n put_pair(\"wrist_ball\", cylinder(0.26, 9.42, 9.74, 14, at=(2.50, 0.0)), \"joint\", HL, HR, bevel=0.006)\n put_pair(\"wrist_ring\", cylinder(0.31, 9.54, 9.64, 14, at=(2.50, 0.0)), \"metal\", HL, HR, bevel=0.005)\n\n # Palm actuator block + sculpted dorsal metacarpal armor backplate\n palm = loft([(8.96, octo(0.38, 0.76, 0.09, x=2.48, y=-0.02)), (9.48, octo(0.42, 0.74, 0.10, x=2.50, y=-0.02))])\n put_pair(\"hand_palm\", palm, \"frame\", HL, HR, bevel=0.012)\n\n hand_back = patch_shell(\n [\n [(2.66, -0.38, 9.52), (2.78, 0.0, 9.54), (2.66, 0.36, 9.52)],\n [(2.68, -0.40, 9.02), (2.82, 0.0, 9.04), (2.68, 0.38, 9.02)],\n ],\n thickness=0.055,\n col_creases={1: 0.85},\n outward=(1, 0, 0),\n )\n put_pair(\"hand_dorsal_armor\", hand_back, \"main\", HL, HR, bevel=0.008)\n\n # 4 individually segmented fingers curled cleanly around grip axis (x=2.36, y=-0.02, z=9.12)\n finger_bms = []\n knuckle_bms = []\n for i, fy in enumerate((-0.28, -0.10, 0.08, 0.25)):\n scale_l = (0.94, 1.0, 0.96, 0.84)[i]\n # Proximal phalanx curving down and inward around weapon grip\n p1 = loft([\n (8.98, octo(0.14, 0.13, 0.03, x=2.60, y=fy)),\n (8.70, octo(0.13, 0.12, 0.03, x=2.48, y=fy)),\n ])\n # Distal phalanx curling inward under grip\n p2 = loft([\n (8.72, octo(0.12, 0.11, 0.025, x=2.48, y=fy)),\n (8.78 + (1 - scale_l) * 0.08, octo(0.11, 0.10, 0.025, x=2.22, y=fy)),\n ])\n finger_bms.extend([p1, p2])\n knuckle_bms.append(cylinder(0.065, fy - 0.06, fy + 0.06, 10, axis=\"y\", at=(2.62, 8.98)))\n put_pair(\"hand_fingers\", merge(*finger_bms), \"frame\", HL, HR, bevel=0.008)\n put_pair(\"hand_knuckles\", merge(*knuckle_bms), \"metal\", HL, HR, bevel=0.004)\n\n # Opposable 2-segment thumb wrapping front of grip\n thumb = merge(\n loft([(9.36, octo(0.15, 0.16, 0.035, x=2.42, y=-0.42)), (9.10, octo(0.14, 0.15, 0.03, x=2.26, y=-0.48))]),\n loft([(9.12, octo(0.13, 0.14, 0.03, x=2.26, y=-0.48)), (9.04, octo(0.12, 0.12, 0.025, x=2.24, y=-0.24))]),\n )\n put_pair(\"hand_thumb\", thumb, \"joint\", HL, HR, bevel=0.008)\n\n\ndef build_legs(J):\n TL, TR = lr(J, \"thigh\")\n SL, SR = lr(J, \"shin\")\n FL, FR = lr(J, \"foot\")\n\n # ---- THIGHS: Femur Truss +Femoral Piston + 3-Piece Compound-Curved Carapace ----\n put_pair(\"hip_ball\", cylinder(0.46, 0.58, 1.58, 16, axis=\"x\", at=(0.0, 10.55)), \"joint\", TL, TR, bevel=0.008)\n femur = aero_loft([\n [(x + 1.20, y, 6.42) for x, y in octo(0.76, 0.92, 0.20)],\n [(x + 1.18, y, 8.65) for x, y in octo(1.18, 1.34, 0.30)],\n [(x + 1.16, y, 10.22) for x, y in octo(1.06, 1.20, 0.26)],\n ], samples_per_span=3)\n put_pair(\"thigh_femur\", femur, \"frame\", TL, TR, bevel=0.016)\n actuator(\"thigh_piston\", (1.20, -0.58, 7.15), (1.18, -0.68, 9.55), r=0.095, jl=TL, TR=None) if False else None\n actuator(\"thigh_piston\", (1.20, -0.56, 7.08), (1.18, -0.66, 9.48), r=0.09, jl=TL, jr=TR)\n\n # Front & outer compound-curved thigh carapace\n thigh_front = patch_shell(\n [\n [(0.58, -0.46, 10.06), (1.18, -1.04, 10.12), (1.96, -0.46, 10.02), (2.06, 0.36, 9.94)],\n [(0.54, -0.52, 8.85), (1.22, -1.16, 8.92), (2.08, -0.50, 8.84), (2.14, 0.42, 8.80)],\n [(0.68, -0.44, 7.22), (1.20, -0.96, 7.18), (1.78, -0.42, 7.22), (1.84, 0.32, 7.26)],\n ],\n thickness=0.085,\n col_creases={1: 0.88, 2: 0.72},\n outward=(0.35, -1.0, 0.0),\n )\n tf_lo, tf_hi = halves(thigh_front, (1.2, -0.8, 9.32), (-0.22, 0.12, 1.0), gap=0.034)\n put_pair(\"thigh_cuff_top\", tf_hi, \"accent\", TL, TR, bevel=0.014)\n tf_mid_lo, tf_mid_hi = halves(tf_lo, (1.2, -0.8, 8.12), (0.24, -0.10, 1.0), gap=0.034)\n put_pair(\"thigh_plate_up\", tf_mid_hi, \"main\", TL, TR, bevel=0.014)\n put_pair(\"thigh_plate_low\", tf_mid_lo, \"main\", TL, TR, bevel=0.014)\n\n # Outer thigh trim strake\n t_strake = aero_loft([\n [(2.04, -0.12, 7.85), (2.16, -0.08, 7.88), (2.16, 0.34, 7.88), (2.04, 0.38, 7.85)],\n [(2.12, -0.16, 9.18), (2.26, -0.10, 9.15), (2.26, 0.38, 9.15), (2.12, 0.42, 9.18)],\n ], samples_per_span=2)\n put_pair(\"thigh_strake\", t_strake, \"trim\", TL, TR, bevel=0.008)\n\n # Rear hamstring shell + vent louvers\n thigh_rear = patch_shell(\n [\n [(0.62, 0.44, 9.88), (1.22, 0.96, 9.92), (1.92, 0.48, 9.84)],\n [(0.64, 0.46, 8.62), (1.22, 1.00, 8.64), (1.90, 0.50, 8.60)],\n [(0.74, 0.40, 7.12), (1.20, 0.80, 7.08), (1.72, 0.42, 7.12)],\n ],\n thickness=0.075,\n col_creases={1: 0.82},\n outward=(0, 1, 0),\n )\n put_pair(\"thigh_rear_shell\", thigh_rear, \"main\", TL, TR, bevel=0.014)\n\n # ---- DOUBLE-DRUM KNEE JOINT + FLOATING LAYERED KNEE AERO-SPIKE (`shin.L/R`) ----\n rotary_drum(\"knee_upper\", (1.20, 0.04, 6.36), 0.42, 0.96, SL, SR, axis=\"x\", cal_angle=160)\n rotary_drum(\"knee_lower\", (1.20, 0.08, 5.82), 0.44, 1.02, SL, SR, axis=\"x\", cal_angle=200)\n # Optical side-marker lens on outboard knee cap\n knee_opt = cylinder(0.18, 1.82, 1.88, 16, axis=\"x\", at=(0.08, 5.82))\n put_pair(\"knee_optic\", knee_opt, \"sensor\", SL, SR, bevel=0.005)\n actuator(\"knee_rear_act\", (1.20, 0.64, 7.28), (1.20, 0.78, 5.42), r=0.095, jl=SL, jr=SR)\n\n # Twin machined patella guide rails + compound-curved knee cowl blade\n for side_k, kx in ((\"in\", 0.86), (\"out\", 1.54)):\n rail = loft([(5.95, octo(0.14, 0.26, 0.03, x=kx, y=-0.52)), (7.02, octo(0.12, 0.22, 0.03, x=kx, y=-0.62))])\n put_pair(f\"knee_rail_{side_k}\", rail, \"metal\", SL, SR, bevel=0.008)\n\n knee_cowl = patch_shell(\n [\n [(0.82, -0.72, 7.16), (1.20, -1.28, 7.22), (1.58, -0.72, 7.16)],\n [(0.68, -0.64, 6.38), (1.20, -1.36, 6.44), (1.72, -0.64, 6.38)],\n [(0.76, -0.62, 5.64), (1.20, -1.16, 5.60), (1.64, -0.62, 5.64)],\n ],\n thickness=0.085,\n col_creases={1: 0.94},\n row_creases={1: 0.72},\n outward=(0, -1, 0.15),\n )\n kc_body, kc_tip = halves(knee_cowl, (1.2, -1.0, 6.86), (0, -0.35, 1.0), gap=0.026)\n put_pair(\"knee_shield\", kc_body, \"accent\", SL, SR, bevel=0.014)\n put_pair(\"knee_crest\", kc_tip, \"trim\", SL, SR, bevel=0.010)\n\n # ---- SHINS & REVERSE-SWEPT CALF VECTOR-THRUSTER NACELLES (`shin.L/R`) ----\n tibia = aero_loft([\n [(x + 1.20, y + 0.08, 1.72) for x, y in octo(0.76, 0.92, 0.20)],\n [(x + 1.20, y + 0.06, 3.85) for x, y in octo(0.92, 1.08, 0.24)],\n [(x + 1.20, y + 0.04, 5.75) for x, y in octo(0.96, 1.12, 0.24)],\n ], samples_per_span=2)\n put_pair(\"shin_tibia\", tibia, \"frame\", SL, SR, bevel=0.015)\n actuator(\"achilles_in\", (0.96, 0.68, 2.68), (0.98, 0.84, 1.72), r=0.068, jl=SL, jr=SR)\n actuator(\"achilles_out\", (1.44, 0.68, 2.68), (1.42, 0.84, 1.72), r=0.068, jl=SL, jr=SR)\n\n # Razor-keeled aerodynamic front shin prow tapering to athletic ankle\n shin_prow = patch_shell(\n [\n [(0.68, -0.22, 5.56), (1.20, -1.08, 5.58), (1.82, -0.18, 5.54)],\n [(0.62, -0.26, 4.18), (1.20, -1.12, 4.20), (1.92, -0.20, 4.16)],\n [(0.72, -0.20, 2.86), (1.20, -0.96, 2.84), (1.76, -0.18, 2.86)],\n [(0.82, -0.14, 1.92), (1.20, -0.78, 1.90), (1.58, -0.14, 1.92)],\n ],\n thickness=0.082,\n col_creases={1: 0.94},\n outward=(0.15, -1.0, 0.0),\n )\n sp_lo, sp_hi = halves(shin_prow, (1.2, -0.7, 3.56), (0.20, -0.12, 1.0), gap=0.034)\n put_pair(\"shin_prow_hi\", sp_hi, \"main\", SL, SR, bevel=0.014)\n put_pair(\"shin_prow_lo\", sp_lo, \"main\", SL, SR, bevel=0.014)\n\n # Dramatic reverse-swept rear/outer calf aero-thruster nacelle (hero feature from behind in flight!)\n calf_nacelle = patch_shell(\n [\n [(0.68, 0.24, 5.48), (1.20, 1.24, 5.46), (1.96, 0.42, 5.38)],\n [(0.64, 0.34, 4.52), (1.22, 1.82, 4.56), (2.16, 0.56, 4.44)],\n [(0.74, 0.36, 3.38), (1.20, 1.42, 3.34), (1.94, 0.46, 3.36)],\n [(0.84, 0.30, 2.38), (1.20, 0.92, 2.32), (1.64, 0.34, 2.38)],\n ],\n thickness=0.085,\n col_creases={1: 0.88},\n row_creases={1: 0.78},\n outward=(0.25, 1.0, 0.1),\n )\n cn_lo, cn_hi = halves(calf_nacelle, (1.2, 1.2, 4.18), (-0.15, -0.25, 1.0), gap=0.036)\n put_pair(\"calf_fairing_hi\", cn_hi, \"main\", SL, SR, bevel=0.014)\n cn_fin, cn_mid = halves(cn_lo, (1.72, 0.6, 3.4), (-1.0, 0.25, 0.15), gap=0.030)\n put_pair(\"calf_fairing_lo\", cn_mid, \"accent\", SL, SR, bevel=0.014)\n put_pair(\"calf_outer_fin\", cn_fin, \"trim\", SL, SR, bevel=0.010)\n\n # Recessed heat-exchanger louvers + Multi-petal calf braking/lift vector thruster (`nozzle.calf.L/R`)\n put_pair(\"calf_louvers\", louver_bank((1.20, 1.24, 2.88), (0.0, 1.0, -0.28), (0, 0.28, 1), 0.48, 0.58, count=5),\n \"metal\", SL, SR, smooth=False, bevel=0.005)\n vectored_nozzle(\"calf_vec\", (1.22, 1.44, 4.26), (0.0, 0.50, -0.866), 0.33, 0.56, SL, SR, petals=6, kind=\"calf\")\n\n # ---- ARTICULATED RAPTOR LANDING FEET (`foot.L/R`, soles grounded cleanly at z = 0.0) ----\n rotary_drum(\"ankle_drum\", (1.20, 0.10, 1.55), 0.36, 0.82, FL, FR, axis=\"x\", cal_angle=0)\n actuator(\"instep_damper\", (1.20, -0.34, 1.62), (1.20, -0.96, 0.82), r=0.068, jl=FL, FR=None) if False else None\n actuator(\"instep_damper\", (1.20, -0.34, 1.62), (1.20, -0.96, 0.82), r=0.068, jl=FL, jr=FR)\n\n # Floating sculpted ankle guard spat\n spat = patch_shell(\n [\n [(0.72, -0.38, 2.16), (1.20, -0.98, 2.24), (1.68, -0.38, 2.16)],\n [(0.64, -0.46, 1.22), (1.20, -1.16, 1.18), (1.76, -0.46, 1.22)],\n ],\n thickness=0.072,\n col_creases={1: 0.90},\n outward=(0, -1, 0.2),\n )\n sp_b, sp_t = halves(spat, (1.2, -0.8, 1.92), (0, -0.2, 1.0), gap=0.024)\n put_pair(\"ankle_spat_main\", sp_b, \"main\", FL, FR, bevel=0.012)\n put_pair(\"ankle_spat_trim\", sp_t, \"trim\", FL, FR, bevel=0.008)\n\n # Arched mechanical foot bridge + split twin-talon front sabot + swept heel stabilizer spur\n bridge = aero_loft([\n [(x + 1.20, y - 0.10, 0.28) for x, y in octo(1.06, 1.82, 0.24)],\n [(x + 1.20, y - 0.02, 1.08) for x, y in octo(0.88, 1.34, 0.20)],\n ], samples_per_span=2)\n put_pair(\"foot_bridge\", bridge, \"frame\", FL, FR, bevel=0.014)\n\n # Upper vamp shell over instep\n vamp = patch_shell(\n [\n [(0.62, -0.42, 1.08), (1.20, -0.92, 1.16), (1.78, -0.42, 1.08)],\n [(0.58, -1.38, 0.68), (1.20, -1.78, 0.72), (1.82, -1.38, 0.68)],\n ],\n thickness=0.075,\n col_creases={1: 0.88},\n outward=(0, -0.6, 1.0),\n )\n put_pair(\"foot_vamp\", vamp, \"main\", FL, FR, bevel=0.012)\n\n # Cloven twin-talon forward claws (inner and outer aerodynamic toes)\n for tag, tx, sx_toe in ((\"in\", 0.90, -0.08), (\"out\", 1.50, 0.08)):\n talon = aero_loft([\n [(tx - 0.24, -1.16, 0.14), (tx + 0.24, -1.16, 0.14), (tx + 0.20, -1.12, 0.76), (tx - 0.20, -1.12, 0.76)],\n [(tx + sx_toe - 0.21, -1.86, 0.12), (tx + sx_toe + 0.21, -1.86, 0.12), (tx + sx_toe + 0.16, -1.82, 0.56), (tx + sx_toe - 0.16, -1.82, 0.56)],\n [(tx + sx_toe * 1.3 - 0.13, -2.42, 0.12), (tx + sx_toe * 1.3 + 0.13, -2.42, 0.12), (tx + sx_toe * 1.3 + 0.09, -2.34, 0.32), (tx + sx_toe * 1.3 - 0.09, -2.34, 0.32)],\n ], samples_per_span=2)\n t_tip, t_base = halves(talon, (tx, -2.02, 0.3), (0, 1.0, 0.15), gap=0.022)\n put_pair(f\"foot_talon_{tag}\", t_base, \"accent\", FL, FR, bevel=0.012)\n put_pair(f\"foot_claw_{tag}\", t_tip, \"trim\", FL, FR, bevel=0.008)\n\n sole = prism([\n (tx - 0.22, -1.12), (tx + 0.22, -1.12),\n (tx + sx_toe * 1.2 + 0.14, -2.36), (tx + sx_toe * 1.2 - 0.14, -2.36),\n ], 0.0, 0.13, \"xy\")\n put_pair(f\"sole_front_{tag}\", sole, \"joint\", FL, FR, bevel=0.008, smooth=False)\n\n # Rear heel stabilizer spur + grounded sole pad\n heel = aero_loft([\n [(0.72, 0.62, 0.14), (1.68, 0.62, 0.14), (1.60, 0.58, 0.98), (0.80, 0.58, 0.98)],\n [(0.78, 1.32, 0.14), (1.62, 1.32, 0.14), (1.52, 1.24, 0.72), (0.88, 1.24, 0.72)],\n [(0.92, 1.76, 0.16), (1.48, 1.76, 0.16), (1.40, 1.66, 0.44), (1.00, 1.66, 0.44)],\n ], samples_per_span=2)\n put_pair(\"foot_heel_spur\", heel, \"accent\", FL, FR, bevel=0.012)\n heel_sole = prism([(0.74, 0.48), (1.66, 0.48), (1.50, 1.70), (0.90, 1.70)], 0.0, 0.14, \"xy\")\n put_pair(\"sole_heel\", heel_sole, \"joint\", FL, FR, bevel=0.008, smooth=False)\n\n\ndef build_backpack_and_binders(J):\n B = J[\"backpack\"]\n BL, BR = lr(J, \"binder\")\n\n # ---- DORSAL VECTOR-THRUST FLIGHT PACK (`backpack`) ----\n pack_chassis = aero_loft([\n [(x, 1.18, y + 13.85) for x, y in octo(1.88, 2.28, 0.42)],\n [(x, 2.02, y + 13.82) for x, y in octo(1.76, 2.12, 0.40)],\n [(x, 2.48, y + 13.95) for x, y in octo(1.26, 1.56, 0.32)],\n ], samples_per_span=3)\n put_pair(\"pack_chassis\", pack_chassis, \"frame\", B, bevel=0.016)\n\n # Sculpted compound dorsal reactor cowling\n pack_cowl = patch_shell(\n [\n [(-0.92, 1.28, 15.16), (0.0, 1.52, 15.26), (0.92, 1.28, 15.16)],\n [(-1.12, 1.98, 14.32), (0.0, 2.48, 14.42), (1.12, 1.98, 14.32)],\n [(-1.02, 1.96, 13.28), (0.0, 2.42, 13.24), (1.02, 1.96, 13.28)],\n [(-0.68, 1.48, 12.48), (0.0, 1.82, 12.42), (0.68, 1.48, 12.48)],\n ],\n thickness=0.09,\n col_creases={1: 0.88},\n row_creases={1: 0.75},\n outward=(0, 1, 0.1),\n )\n pc_lo, pc_hi = halves(pack_cowl, (0, 2.1, 14.48), (0, -0.25, 1.0), gap=0.034)\n put_pair(\"pack_cowl_top\", pc_hi, \"accent\", B, bevel=0.014)\n put_pair(\"pack_cowl_body\", pc_lo, \"main\", B, bevel=0.014)\n\n # Central Overboost Reactor Turbine Core (stator vanes + machined shroud + glowing cyan core!)\n turb_m = basis_matrix((0, 2.42, 13.92), (0, 1, 0.12), (0, -0.12, 1))\n shroud = transform(\n merge(\n loft([(-0.18, circle(0.62, 24)), (0.16, circle(0.54, 24))]),\n loft([(0.12, circle(0.58, 24)), (0.24, circle(0.48, 24))]),\n ),\n turb_m,\n )\n put_pair(\"overboost_shroud\", shroud, \"metal\", B, bevel=0.008)\n\n stators = []\n for i in range(8):\n ang = 45 * i\n blade = prism([(0.14, 0.08), (0.44, 0.12), (0.44, 0.20), (0.14, 0.16)], -0.022, 0.022, \"xz\")\n stators.append(transform(blade, rot(\"Z\", ang)))\n put_pair(\"overboost_stators\", transform(merge(*stators), turb_m), \"frame\", B, bevel=0.004, smooth=False)\n\n core_glow = transform(loft([(0.12, circle(0.38, 20)), (0.17, circle(0.36, 20))]), turb_m)\n core_hub = transform(loft([(0.14, circle(0.14, 16)), (0.26, circle(0.06, 16))]), turb_m)\n put_pair(\"overboost_glow\", core_glow, \"glow_core\", B, bevel=0.0, smooth=False, outline=False)\n put_pair(\"overboost_hub\", core_hub, \"joint\", B, bevel=0.006)\n\n # Twin Compound-Curved Main Vector Engine Pods + 8-Petal Vectored Nozzles (`nozzle.main.L/R`)\n nacelle = patch_shell(\n [\n [(0.28, 1.54, 13.52), (0.76, 1.88, 13.68), (1.28, 1.58, 13.42)],\n [(0.32, 1.84, 12.92), (0.80, 2.48, 13.06), (1.36, 1.98, 12.86)],\n [(0.38, 1.98, 12.38), (0.78, 2.54, 12.48), (1.26, 2.08, 12.34)],\n ],\n thickness=0.085,\n col_creases={1: 0.85},\n outward=(0.35, 1.0, -0.2),\n )\n nac_collar, nac_body = halves(nacelle, (0.78, 2.1, 13.26), (0.0, -0.35, -1.0), gap=0.030)\n put_pair(\"main_nacelle_top\", nac_collar, \"accent\", B, B, bevel=0.012)\n put_pair(\"main_nacelle_body\", nac_body, \"main\", B, B, bevel=0.014)\n put_pair(\"main_nacelle_vents\", louver_bank((1.16, 1.94, 13.06), (0.8, 0.6, 0.1), (0, -0.1, 1), 0.32, 0.44, count=4),\n \"metal\", B, B, smooth=False, bevel=0.005)\n\n vectored_nozzle(\"main_eng\", (0.76, 2.12, 12.68), (0.06, 0.45, -0.89), 0.45, 0.86, B, B, petals=8, kind=\"main\")\n\n # ---- VARIABLE-GEOMETRY SWEPT GULL-WING AERO-BINDERS (`binder.L/R` at (+-0.9, 2.25, 14.7)) ----\n rotary_drum(\"binder_gimbal\", (0.90, 2.25, 14.70), 0.28, 0.56, BL, BR, axis=\"x\", cal_angle=45)\n actuator(\"binder_fold_act\", (0.72, 1.98, 14.22), (1.02, 2.36, 14.62), r=0.068, jl=B, jr=B)\n\n # Swept compound-curved gull-wing airfoil binder (authored on Left +X, mirrored cleanly to Right -X)\n wing = patch_shell(\n [\n [(0.96, 1.92, 14.88), (1.88, 2.18, 15.86), (2.96, 2.68, 16.78)],\n [(1.06, 2.38, 14.64), (2.06, 2.78, 15.48), (3.18, 3.32, 16.28)],\n [(0.98, 2.76, 14.12), (1.86, 3.16, 14.68), (2.78, 3.58, 15.22)],\n [(0.88, 2.64, 13.42), (1.42, 2.94, 13.68), (1.96, 3.22, 13.86)],\n ],\n thickness=0.082,\n row_creases={1: 0.90},\n outward=(0.75, -0.55, 0.35),\n )\n w_root, w_outer = halves(wing, (1.56, 2.6, 14.9), (1.0, 0.25, 0.35), gap=0.034)\n put_pair(\"binder_root_chine\", w_root, \"accent\", BL, BR, bevel=0.014)\n w_main, w_tip = halves(w_outer, (2.62, 3.0, 15.9), (1.0, 0.28, 0.42), gap=0.030)\n put_pair(\"binder_wing_main\", w_main, \"main\", BL, BR, bevel=0.014)\n put_pair(\"binder_wing_tip\", w_tip, \"trim\", BL, BR, bevel=0.012)\n\n # Stowed High-Frequency Plasma Blade Pylon along dorsal root spine of each binder\n pylon_m = Matrix.Translation((1.24, 2.18, 15.16)) @ rot(\"Y\", 42) @ rot(\"X\", -24)\n scabbard = loft([(-0.85, octo(0.20, 0.28, 0.05)), (0.95, octo(0.18, 0.24, 0.04))])\n hilt = merge(\n loft([(0.92, circle(0.11, 14)), (1.68, circle(0.095, 14))]),\n loft([(0.96, circle(0.14, 14)), (1.10, circle(0.14, 14))]),\n )\n pommel = loft([(1.64, circle(0.125, 14)), (1.82, circle(0.10, 14))])\n pip = loft([(1.02, circle(0.148, 12)), (1.06, circle(0.148, 12))])\n put_pair(\"binder_scabbard\", transform(scabbard, pylon_m), \"frame\", BL, BR, bevel=0.010)\n put_pair(\"binder_blade_hilt\", transform(hilt, pylon_m), \"metal\", BL, BR, bevel=0.006)\n put_pair(\"binder_blade_cap\", transform(pommel, pylon_m), \"trim\", BL, BR, bevel=0.006)\n put_pair(\"binder_blade_pip\", transform(pip, pylon_m), \"glow_core\", BL, BR, bevel=0.0, smooth=False, outline=False)\n\n # Ventral Binder Attitude/Strafe Thruster Pod + 6-Petal Vectored Nozzle (`nozzle.binder.L/R`)\n bpod = aero_loft([\n [(x + 1.24, y + 2.52, 14.32) for x, y in octo(0.56, 0.64, 0.14)],\n [(x + 1.34, y + 2.68, 13.86) for x, y in octo(0.66, 0.72, 0.16)],\n ], samples_per_span=2)\n put_pair(\"binder_thruster_pod\", bpod, \"frame\", BL, BR, bevel=0.012)\n vectored_nozzle(\"binder_vec\", (1.36, 2.72, 13.88), (0.24, 0.44, -0.865), 0.32, 0.58, BL, BR, petals=6, kind=\"binder\")\n\n\ndef build_carbon_0():\n J = striker_joints()\n J[\"frame\"][\"frame\"] = \"carbon_0\"\n J[\"frame\"][\"height\"] = 17.6\n build_pelvis(J)\n build_waist(J)\n build_torso_and_cockpit(J)\n build_head(J)\n build_arms(J)\n build_legs(J)\n build_backpack_and_binders(J)\n return J[\"frame\"]\n\n\ndef build_carbon_rifle():\n \"\"\"Bespoke twin-rail electromagnetic carbine (`carbon_rifle`), authored around grip origin pointing -Y.\"\"\"\n root = empty(\"carbon_rifle\", (0, 0, 0), weapon=\"rail_carbine\")\n\n # Ergonomic angled pistol grip + trigger guard\n grip = transform(loft([(-1.02, octo(0.28, 0.48, 0.07, y=0.04)), (0.24, octo(0.30, 0.50, 0.08, y=0.04))]), rot(\"X\", 15))\n put_pair(\"grip_handle\", grip, \"joint\", root, bevel=0.012)\n tguard = prism([(-0.62, -0.34), (-0.12, -0.34), (-0.02, 0.28), (-0.14, 0.28), (-0.20, -0.22), (-0.56, -0.22)], -0.09, 0.09, \"yz\")\n put_pair(\"trigger_guard\", tguard, \"frame\", root, bevel=0.008)\n\n # Compound-curved upper receiver (`main`) & lower receiver (`accent`)\n rec_up = aero_loft([\n [(x, 1.95, y + 0.88) for x, y in octo(0.56, 0.62, 0.14)],\n [(x, -0.45, y + 0.92) for x, y in octo(0.64, 0.68, 0.16)],\n [(x, -2.95, y + 0.88) for x, y in octo(0.54, 0.58, 0.14)],\n ], samples_per_span=3)\n put_pair(\"receiver_upper\", rec_up, \"main\", root, bevel=0.015)\n\n rec_low = aero_loft([\n [(x, 1.65, y + 0.44) for x, y in octo(0.48, 0.46, 0.10)],\n [(x, -0.65, y + 0.44) for x, y in octo(0.54, 0.50, 0.12)],\n [(x, -2.55, y + 0.52) for x, y in octo(0.46, 0.42, 0.10)],\n ], samples_per_span=2)\n put_pair(\"receiver_lower\", rec_low, \"accent\", root, bevel=0.014)\n\n # Skeletonized thumbhole buttstock\n stock = aero_loft([\n [(x, 1.80, y + 0.68) for x, y in octo(0.44, 0.72, 0.12)],\n [(x, 3.18, y + 0.52) for x, y in octo(0.38, 1.04, 0.12)],\n ], samples_per_span=2)\n put_pair(\"buttstock\", stock, \"frame\", root, bevel=0.014)\n buttpad = loft([(3.14, octo(0.40, 1.08, 0.12, y=0.52)), (3.34, octo(0.36, 1.02, 0.10, y=0.52))], axis=\"y\")\n put_pair(\"buttpad\", buttpad, \"joint\", root, bevel=0.010)\n\n # Forward-angled box magazine + vermilion trim baseplate\n mag = transform(loft([(-0.92, octo(0.32, 0.62, 0.08)), (0.28, octo(0.34, 0.64, 0.08))]),\n Matrix.Translation((0, -1.25, 0.18)) @ rot(\"X\", -18))\n mag_cap = transform(loft([(-1.06, octo(0.36, 0.68, 0.08)), (-0.90, octo(0.35, 0.66, 0.08))]),\n Matrix.Translation((0, -1.25, 0.18)) @ rot(\"X\", -18))\n put_pair(\"magazine\", mag, \"frame\", root, bevel=0.010)\n put_pair(\"mag_baseplate\", mag_cap, \"trim\", root, bevel=0.008)\n\n # Twin machined electromagnetic accelerator rails + glowing plasma induction channel!\n for tag, rz in ((\"top\", 0.94), (\"bot\", 0.58)):\n rail = loft([(-2.80, octo(0.34, 0.18, 0.04, y=rz)), (-6.28, octo(0.26, 0.15, 0.035, y=rz))], axis=\"y\")\n put_pair(f\"accel_rail_{tag}\", rail, \"metal\", root, bevel=0.008)\n\n plasma_strip = loft([(-2.90, octo(0.12, 0.10, 0.02, y=0.76)), (-6.12, octo(0.09, 0.08, 0.02, y=0.76))], axis=\"y\")\n put_pair(\"plasma_channel\", plasma_strip, \"glow_core\", root, bevel=0.0, smooth=False, outline=False)\n\n # Barrel cooling shroud clamps & muzzle brake collar\n for i, cy in enumerate((-3.55, -4.65, -5.65)):\n clamp = loft([(cy, octo(0.46, 0.62, 0.10, y=0.76)), (cy - 0.24, octo(0.46, 0.62, 0.10, y=0.76))], axis=\"y\")\n put_pair(f\"barrel_clamp{i}\", clamp, \"frame\" if i < 2 else \"trim\", root, bevel=0.008)\n\n muzzle_brake = loft([(-6.18, octo(0.38, 0.54, 0.09, y=0.76)), (-6.52, octo(0.32, 0.46, 0.08, y=0.76))], axis=\"y\")\n put_pair(\"muzzle_brake\", muzzle_brake, \"frame\", root, bevel=0.008)\n muzzle_glow = cylinder(0.08, -6.54, -6.50, 12, axis=\"y\", at=(0, 0.76))\n put_pair(\"muzzle_glow\", muzzle_glow, \"glow_beam\", root, bevel=0.0, smooth=False, outline=False)\n\n # Low-profile holographic targeting optic (`glow_eye` objective lens)\n optic = aero_loft([\n [(x, 0.42, y + 1.44) for x, y in octo(0.34, 0.36, 0.08)],\n [(x, -1.48, y + 1.44) for x, y in octo(0.38, 0.40, 0.09)],\n ], samples_per_span=2)\n put_pair(\"optic_body\", optic, \"frame\", root, bevel=0.010)\n optic_ring = cylinder(0.18, -1.56, -1.44, 16, axis=\"y\", at=(0, 1.44))\n optic_lens = cylinder(0.14, -1.58, -1.54, 16, axis=\"y\", at=(0, 1.44))\n put_pair(\"optic_bezel\", optic_ring, \"metal\", root, bevel=0.005)\n put_pair(\"optic_lens\", optic_lens, \"glow_eye\", root, bevel=0.0, smooth=False, outline=False)\n\n empty(\"muzzle\", (0, -6.56, 0.76), root, dir=gltf_dir((0, -1, 0)))\n return root\n","Overwrite":true,"Path":"~/work/sortie/kit/carbon_mech.py"}
input
{ "Content": "\"\"\"carbon_0 (\"Kestrel\", CX-00): original standard-class aerospace frame on block_dummy's 22-joint rig.\n\nBuilt directly on `mech.joints()` (exact 17.6 m striker/block_dummy skeleton) using compound-curved\nCatmull-Clark creased subdivision carapaces (`carbon_surf.patch_shell`), physical multi-plane seam\nsplits (`split_shell`), multi-material hydraulic actuators, double-drum joints, an articulated\ncockpit module, and 3-channel multi-petal vector thrusters (`main`, `binder`, `calf`).\n\"\"\"\nimport math\n\nfrom mathutils import Matrix, Vector\n\nfrom carbon_surf import actuator, aero_loft, basis_matrix, louver_bank, patch_shell, put_pair, rotary_drum, split_shell, vectored_nozzle\nfrom lib import circle, cylinder, empty, halves, loft, merge, octo, prism, rot, solid, transform\nfrom mech import gltf_dir, joints as striker_joints, lr\n\n\ndef build_pelvis(J):\n P = J[\"pelvis\"]\n # Sculpted structural pelvic chassis & hip gimbal yokes\n core = aero_loft([\n [(x, y, 9.72) for x, y in octo(0.86, 1.24, 0.24)],\n [(x, y, 10.22) for x, y in octo(2.15, 1.62, 0.38)],\n [(x, y, 10.68) for x, y in octo(2.42, 1.74, 0.42)],\n [(x, y, 11.02) for x, y in octo(1.92, 1.50, 0.35)],\n ], samples_per_span=3)\n put_pair(\"pelvis_chassis\", core, \"frame\", P, bevel=0.018)\n rotary_drum(\"hip_trunnion\", (1.58, 0.0, 10.55), 0.38, 0.58, P, P, axis=\"x\", cal_angle=15)\n\n # Central forward-swept aero codpiece keel + V-belt + recessed attitude vernier\n keel = patch_shell(\n [\n [(-0.34, -0.95, 10.98), (0.0, -1.16, 11.02), (0.34, -0.95, 10.98)],\n [(-0.42, -1.18, 10.52), (0.0, -1.46, 10.50), (0.42, -1.18, 10.52)],\n [(-0.36, -1.16, 9.96), (0.0, -1.44, 9.92), (0.36, -1.16, 9.96)],\n [(-0.22, -0.82, 9.52), (0.0, -1.04, 9.48), (0.22, -0.82, 9.52)],\n ],\n thickness=0.10,\n col_creases={1: 0.92},\n row_creases={1: 0.65},\n outward=(0, -1, 0),\n )\n k_top, k_bot = halves(keel, (0, -1.2, 10.56), (0, -0.15, 1), gap=0.032)\n put_pair(\"pelvis_belt_keel\", k_top, \"main\", P, bevel=0.014)\n k_mid, k_tip = halves(k_bot, (0, -1.2, 9.82), (0, 0.1, 1), gap=0.028)\n put_pair(\"codpiece_tip\", k_tip, \"trim\", P, bevel=0.012)\n put_pair(\"codpiece_body\", k_mid, \"accent\", P, bevel=0.014)\n put_pair(\"codpiece_vent\", louver_bank((0, -1.38, 10.18), (0, -1, -0.15), (0, -0.15, 1), 0.30, 0.28, count=4, depth=0.07),\n \"frame\", P, smooth=False, bevel=0.005)\n\n # Split compound-curved front chevron aero-faulds (swept forward for clean flight thigh clearance)\n f_skirt = patch_shell(\n [\n [(0.42, -1.16, 10.82), (1.12, -1.12, 10.80), (1.76, -0.88, 10.68)],\n [(0.46, -1.36, 10.42), (1.26, -1.34, 10.34), (1.96, -1.02, 10.20)],\n [(0.54, -1.42, 9.98), (1.38, -1.42, 9.80), (1.82, -1.10, 9.72)],\n ],\n thickness=0.075,\n row_creases={1: 0.80},\n outward=(0.25, -1.0, 0.1),\n )\n fs_lo, fs_hi = halves(f_skirt, (1.1, -1.3, 10.16), (-0.22, 0.08, 1.0), gap=0.032)\n put_pair(\"skirt_front_hi\", fs_hi, \"main\", P, P, bevel=0.014)\n put_pair(\"skirt_front_lo\", fs_lo, \"accent\", P, P, bevel=0.012)\n tab = patch_shell(\n [\n [(1.52, -1.30, 9.88), (1.84, -1.08, 9.78)],\n [(1.42, -1.38, 9.72), (1.74, -1.14, 9.62)],\n ],\n thickness=0.055,\n subd_levels=1,\n outward=(0.3, -1, -0.1),\n )\n put_pair(\"skirt_front_trim\", tab, \"trim\", P, P, bevel=0.008)\n\n # Side hip vernier pods (sleek horizontal aero nacelles flanking hip joints)\n side_pod = patch_shell(\n [\n [(1.82, -0.88, 10.72), (1.92, 0.05, 10.76), (1.78, 1.02, 10.68)],\n [(2.22, -0.96, 10.32), (2.40, 0.08, 10.35), (2.22, 1.18, 10.24)],\n [(2.04, -0.76, 9.72), (2.18, 0.12, 9.70), (2.02, 1.08, 9.65)],\n ],\n thickness=0.08,\n row_creases={1: 0.88},\n outward=(1, 0, 0.1),\n )\n sp_lo, sp_hi = halves(side_pod, (2.1, 0.0, 10.38), (0.15, 0.05, 1.0), gap=0.032)\n put_pair(\"hip_pod_top\", sp_hi, \"main\", P, P, bevel=0.014)\n put_pair(\"hip_pod_low\", sp_lo, \"accent\", P, P, bevel=0.014)\n put_pair(\"hip_pod_vent\", louver_bank((2.08, 1.06, 10.18), (0.35, 1.0, 0.0), (0, 0, 1), 0.28, 0.42, count=4),\n \"metal\", P, P, smooth=False, bevel=0.006)\n\n # Rear tail-stabilizer spine & overlapping compound rear skirt plates\n tail = aero_loft([\n [(x, y + 0.95, 10.92) for x, y in octo(0.62, 0.42, 0.12)],\n [(x, y + 1.32, 10.38) for x, y in octo(0.56, 0.58, 0.14)],\n [(x, y + 1.48, 9.68) for x, y in octo(0.38, 0.48, 0.10)],\n [(x, y + 1.24, 9.28) for x, y in octo(0.24, 0.30, 0.06)],\n ], samples_per_span=3)\n put_pair(\"tail_spine\", tail, \"accent\", P, bevel=0.014)\n put_pair(\"tail_louvers\", louver_bank((0, 1.44, 10.12), (0, 1, -0.2), (0, 0.2, 1), 0.34, 0.56, count=5),\n \"metal\", P, smooth=False, bevel=0.005)\n\n r_skirt = patch_shell(\n [\n [(0.32, 1.05, 10.78), (1.08, 1.08, 10.76), (1.68, 0.86, 10.62)],\n [(0.34, 1.34, 10.18), (1.18, 1.36, 10.14), (1.76, 1.04, 10.02)],\n [(0.30, 1.28, 9.52), (1.06, 1.30, 9.46), (1.52, 0.98, 9.48)],\n ],\n thickness=0.075,\n row_creases={1: 0.82},\n outward=(0.25, 1.0, 0.05),\n )\n rs_lo, rs_hi = halves(r_skirt, (1.0, 1.25, 10.02), (0.18, 0.0, 1.0), gap=0.032)\n put_pair(\"skirt_rear_hi\", rs_hi, \"main\", P, P, bevel=0.014)\n put_pair(\"skirt_rear_lo\", rs_lo, \"main\", P, P, bevel=0.014)\n\n\ndef build_waist(J):\n W = J[\"waist\"]\n # Pinched articulated spinal column + segmented flexible corset + crossed chrome-rod hydraulics\n spine = aero_loft([\n [(x, y + 0.04, 10.88) for x, y in octo(1.36, 1.22, 0.32)],\n [(x, y + 0.02, 11.42) for x, y in octo(1.24, 1.14, 0.30)],\n [(x, y + 0.00, 11.98) for x, y in octo(1.48, 1.30, 0.34)],\n ], samples_per_span=3)\n put_pair(\"waist_core\", spine, \"joint\", W, bevel=0.015)\n\n # Dorsal articulated thoracic vertebrae blocks (visible from behind!)\n for i, zc in enumerate((11.12, 11.44, 11.76)):\n vert_plate = patch_shell(\n [\n [(-0.46, 0.56, zc - 0.11), (0.0, 0.78, zc - 0.12), (0.46, 0.56, zc - 0.11)],\n [(-0.50, 0.62, zc + 0.11), (0.0, 0.86, zc + 0.10), (0.50, 0.62, zc + 0.11)],\n ],\n thickness=0.065,\n subd_levels=1,\n col_creases={1: 0.9},\n outward=(0, 1, 0),\n )\n put_pair(f\"spine_vert{i}\", vert_plate, \"frame\", W, bevel=0.01)\n\n # Segmented front abdominal armor corset ribs\n for i, (zc, wy, hw) in enumerate(((11.14, -0.78, 0.56), (11.46, -0.86, 0.62), (11.78, -0.94, 0.68))):\n rib = patch_shell(\n [\n [(-hw, wy + 0.22, zc - 0.12), (0.0, wy - 0.04, zc - 0.13), (hw, wy + 0.22, zc - 0.12)],\n [(-hw * 1.05, wy + 0.20, zc + 0.12), (0.0, wy - 0.08, zc + 0.13), (hw * 1.05, wy + 0.20, zc + 0.12)],\n ],\n thickness=0.06,\n subd_levels=2,\n col_creases={1: 0.85},\n outward=(0, -1, 0),\n )\n put_pair(f\"ab_corset{i}\", rib, \"frame\" if i < 2 else \"accent\", W, bevel=0.01)\n\n # Dual front & rear hydraulic stabilizer actuators with bright metal piston shafts\n actuator(\"waist_act_f\", (0.64, -0.34, 10.92), (0.84, -0.46, 11.96), r=0.085, jl=W, jr=W)\n actuator(\"waist_act_r\", (0.58, 0.44, 10.92), (0.76, 0.52, 11.96), r=0.085, jl=W, jr=W)\n\n\ndef build_torso_and_cockpit(J):\n T = J[\"torso\"]\n C = J[\"cockpit\"]\n\n # Inner thoracic structural frame + exposed side rib trusses + clavicle pistons\n chest_core = aero_loft([\n [(x, y, 11.90) for x, y in octo(1.66, 1.44, 0.36)],\n [(x, y - 0.06, 12.75) for x, y in octo(2.28, 1.92, 0.45)],\n [(x, y - 0.10, 13.95) for x, y in octo(2.88, 2.28, 0.54)],\n [(x, y - 0.04, 14.88) for x, y in octo(2.62, 2.04, 0.48)],\n [(x, y + 0.04, 15.32) for x, y in octo(1.68, 1.44, 0.36)],\n ], samples_per_span=3)\n put_pair(\"torso_chassis\", chest_core, \"frame\", T, bevel=0.02)\n actuator(\"clavicle_strut\", (0.66, -0.22, 15.12), (1.82, -0.08, 14.72), r=0.08, jl=T, jr=T, body_role=\"frame\", rod_role=\"metal\")\n\n # ---- COCKPIT MODULE (parented to J[\"cockpit\"] so it hinges/moves as the true pilot hatch) ----\n # Forward-jutting interceptor keel canopy carapace\n canopy_shell = patch_shell(\n [\n [(-0.48, -1.24, 14.86), (0.0, -1.48, 14.94), (0.48, -1.24, 14.86)],\n [(-0.62, -1.62, 14.28), (0.0, -1.96, 14.34), (0.62, -1.62, 14.28)],\n [(-0.64, -1.72, 13.56), (0.0, -2.08, 13.62), (0.64, -1.72, 13.56)],\n [(-0.52, -1.46, 12.72), (0.0, -1.76, 12.68), (0.52, -1.46, 12.72)],\n [(-0.38, -1.16, 12.08), (0.0, -1.36, 12.04), (0.38, -1.16, 12.08)],\n ],\n thickness=0.11,\n col_creases={1: 0.92},\n row_creases={2: 0.78},\n outward=(0, -1, 0),\n )\n c_lo, c_hi = halves(canopy_shell, (0, -1.8, 13.78), (0, -0.22, 1.0), gap=0.034)\n put_pair(\"cockpit_hood\", c_hi, \"main\", C, bevel=0.015)\n c_belly, c_mid = halves(c_lo, (0, -1.6, 12.68), (0, 0.15, 1.0), gap=0.030)\n put_pair(\"cockpit_tub\", c_mid, \"accent\", C, bevel=0.015)\n put_pair(\"cockpit_keel_low\", c_belly, \"main\", C, bevel=0.014)\n\n # Emergency release trim latch & pilot optical periscope slit on cockpit canopy\n latch = patch_shell(\n [\n [(-0.26, -1.52, 14.82), (0.0, -1.68, 14.88), (0.26, -1.52, 14.82)],\n [(-0.32, -1.76, 14.48), (0.0, -1.98, 14.52), (0.32, -1.76, 14.48)],\n ],\n thickness=0.06,\n subd_levels=2,\n col_creases={1: 0.9},\n outward=(0, -1, 0.25),\n )\n put_pair(\"cockpit_latch\", latch, \"trim\", C, bevel=0.01)\n\n periscope = patch_shell(\n [\n [(-0.36, -1.72, 14.44), (0.0, -1.94, 14.48), (0.36, -1.72, 14.44)],\n [(-0.40, -1.80, 14.26), (0.0, -2.02, 14.30), (0.40, -1.80, 14.26)],\n ],\n thickness=0.05,\n subd_levels=2,\n outward=(0, -1, 0.15),\n )\n put_pair(\"cockpit_visor\", periscope, \"visor\", C, bevel=0.008)\n peri_glow = prism([(-0.24, 14.34), (0.24, 14.34), (0.20, 14.40), (-0.20, 14.40)], -2.03, -1.96, \"xz\")\n put_pair(\"cockpit_optic\", peri_glow, \"glow_core\", C, bevel=0.0, smooth=False, outline=False)\n\n # Recessed ventral chest reactor lens aperture in cockpit tub\n bezel = transform(loft([(-0.18, circle(0.36, 20)), (0.06, circle(0.30, 20))]), basis_matrix((0, -1.96, 13.26), (0, -1, -0.18), (0, -0.18, 1)))\n lens = transform(loft([(0.01, circle(0.24, 20)), (0.07, circle(0.22, 20))]), basis_matrix((0, -1.96, 13.26), (0, -1, -0.18), (0, -0.18, 1)))\n iris = transform(loft([(0.05, circle(0.11, 16)), (0.085, circle(0.10, 16))]), basis_matrix((0, -1.96, 13.26), (0, -1, -0.18), (0, -0.18, 1)))\n put_pair(\"reactor_bezel\", bezel, \"metal\", C, bevel=0.008)\n put_pair(\"reactor_lens\", lens, \"sensor\", C, bevel=0.005)\n put_pair(\"reactor_iris\", iris, \"glow_core\", C, bevel=0.0, smooth=False, outline=False)\n\n # Pilot boarding grab-handles flanking the cockpit canopy\n grab = merge(\n cylinder(0.028, 13.55, 14.35, 8, at=(0.63, -1.66)),\n cylinder(0.028, -1.66, -1.52, 8, axis=\"y\", at=(0.63, 13.55)),\n cylinder(0.028, -1.66, -1.52, 8, axis=\"y\", at=(0.63, 14.35)),\n )\n put_pair(\"cockpit_grab\", grab, \"metal\", C, C, bevel=0.004)\n\n # ---- COMPOUND-CURVED PECTORAL & LATERAL TORSO SHELLS (parented to J[\"torso\"]) ----\n # Continuous 3D master shell wrapping from cockpit channel -> front intake -> side ribcage -> dorsal scapula\n pec_master = patch_shell(\n [\n [(0.58, -1.24, 14.96), (1.28, -1.16, 15.02), (1.76, -0.52, 14.88), (1.66, 0.88, 14.92)],\n [(0.66, -1.64, 14.32), (1.52, -1.52, 14.36), (1.98, -0.56, 14.22), (1.78, 1.06, 14.28)],\n [(0.66, -1.56, 13.48), (1.46, -1.40, 13.46), (1.86, -0.46, 13.38), (1.66, 1.02, 13.44)],\n [(0.54, -1.22, 12.56), (1.18, -1.08, 12.54), (1.52, -0.34, 12.52), (1.38, 0.84, 12.58)],\n ],\n thickness=0.095,\n row_creases={1: 0.86},\n col_creases={2: 0.65},\n outward=(1.0, -0.6, 0.1),\n )\n # Slice into 3 flush multi-role plates sharing exact compound curvature across 36 mm physical shadow seams!\n pec_lower, pec_upper = halves(pec_master, (1.2, -0.8, 13.68), (-0.18, -0.10, 1.0), gap=0.036)\n pec_front, pec_outer = halves(pec_upper, (1.56, -0.5, 14.4), (1.0, 0.32, 0.12), gap=0.034)\n put_pair(\"chest_pec_main\", pec_front, \"main\", T, T, bevel=0.015)\n put_pair(\"chest_pec_fender\", pec_outer, \"accent\", T, T, bevel=0.015)\n\n rib_lo, rib_hi = halves(pec_lower, (1.1, -0.6, 13.02), (0.22, -0.08, 1.0), gap=0.034)\n put_pair(\"chest_rib_hi\", rib_hi, \"accent\", T, T, bevel=0.014)\n put_pair(\"chest_rib_lo\", rib_lo, \"main\", T, T, bevel=0.014)\n\n # Sculpted Collar Turbine Intakes (trim cowl lip + dark duct + metal compressor louvers)\n intake_lip = patch_shell(\n [\n [(0.72, -1.48, 14.92), (1.38, -1.40, 14.96)],\n [(0.74, -1.66, 14.54), (1.44, -1.56, 14.56)],\n ],\n thickness=0.055,\n subd_levels=1,\n outward=(0.15, -1.0, 0.25),\n )\n put_pair(\"collar_intake_lip\", intake_lip, \"trim\", T, T, bevel=0.008)\n put_pair(\"collar_intake_vanes\", louver_bank((1.08, -1.48, 14.72), (0.12, -1.0, 0.18), (0, 0.18, 1), 0.56, 0.30, count=4, depth=0.10),\n \"metal\", T, T, smooth=False, bevel=0.005)\n\n # High swept armoured collar shrouds framing the sunken neck pit\n collar = patch_shell(\n [\n [(0.54, -0.96, 14.94), (0.98, -0.62, 15.00), (0.96, 0.68, 14.98), (0.52, 0.92, 14.95)],\n [(0.58, -0.78, 15.54), (1.06, -0.44, 15.62), (0.98, 0.58, 15.56), (0.50, 0.82, 15.48)],\n ],\n thickness=0.075,\n col_creases={1: 0.8},\n outward=(1.0, 0.0, 0.2),\n )\n put_pair(\"collar_shroud\", collar, \"main\", T, T, bevel=0.012)\n\n # Dorsal scapular spine plate & angled titanium heat-sink vents (seen from behind in flight)\n dorsal = patch_shell(\n [\n [(-0.78, 1.02, 15.12), (0.0, 1.24, 15.18), (0.78, 1.02, 15.12)],\n [(-1.12, 1.18, 14.05), (0.0, 1.42, 14.12), (1.12, 1.18, 14.05)],\n [(-0.88, 0.98, 12.42), (0.0, 1.22, 12.38), (0.88, 0.98, 12.42)],\n ],\n thickness=0.09,\n col_creases={1: 0.88},\n outward=(0, 1, 0),\n )\n put_pair(\"dorsal_carapace\", dorsal, \"accent\", T, bevel=0.014)\n put_pair(\"scapula_vents\", louver_bank((1.28, 1.08, 14.55), (0.35, 1.0, 0.15), (0, -0.15, 1), 0.44, 0.54, count=5),\n \"metal\", T, T, smooth=False, bevel=0.005)\n\n\ndef build_head(J):\n N, H = J[\"neck\"], J[\"head\"]\n # Articulated multi-piston mechanical neck column\n put_pair(\"neck_column\", cylinder(0.32, 15.15, 16.02, 16, at=(0, -0.04)), \"joint\", N, bevel=0.008)\n put_pair(\"neck_collar\", loft([(15.32, octo(0.86, 0.88, 0.20, y=-0.04)), (15.58, octo(0.76, 0.78, 0.18, y=-0.04))]),\n \"frame\", N, bevel=0.012)\n actuator(\"neck_piston\", (0.28, -0.28, 15.18), (0.24, -0.34, 15.96), r=0.052, jl=N, jr=N)\n\n # Inner sensor cranium chassis\n skull = aero_loft([\n [(x, y - 0.08, 15.88) for x, y in octo(0.76, 1.02, 0.22)],\n [(x, y - 0.12, 16.45) for x, y in octo(1.02, 1.38, 0.28)],\n [(x, y + 0.04, 16.96) for x, y in octo(0.88, 1.32, 0.26)],\n ], samples_per_span=3)\n put_pair(\"head_chassis\", skull, \"frame\", H, bevel=0.012)\n\n # Compound-curved forward-raked Kestrel interceptor cranium cowl (NO Gundam V-fin, NO face slits!)\n cranium = patch_shell(\n [\n [(-0.56, -0.66, 16.64), (-0.24, -1.06, 16.60), (0.0, -1.18, 16.58), (0.24, -1.06, 16.60), (0.56, -0.66, 16.64)],\n [(-0.64, -0.18, 16.96), (-0.30, -0.56, 17.08), (0.0, -0.68, 17.14), (0.30, -0.56, 17.08), (0.64, -0.18, 16.96)],\n [(-0.58, 0.42, 17.04), (-0.28, 0.26, 17.24), (0.0, 0.22, 17.30), (0.28, 0.26, 17.24), (0.58, 0.42, 17.04)],\n [(-0.40, 1.02, 16.72), (-0.20, 1.12, 16.86), (0.0, 1.18, 16.90), (0.20, 1.12, 16.86), (0.40, 1.02, 16.72)],\n ],\n thickness=0.075,\n col_creases={2: 0.95},\n row_creases={1: 0.55},\n outward=(0, -0.2, 1.0),\n )\n cr_rear, cr_front = halves(cranium, (0, 0.08, 17.0), (0, -1.0, 0.25), gap=0.028)\n put_pair(\"head_brow_cowl\", cr_front, \"main\", H, bevel=0.010)\n put_pair(\"head_occipital\", cr_rear, \"main\", H, bevel=0.010)\n\n # Dorsal longitudinal telemetry sensor crest (low-profile stealth blade along cranium spine)\n dorsal_sensor = aero_loft([\n [(-0.07, -0.78, 16.98), (0.07, -0.78, 16.98), (0.04, -0.68, 17.22), (-0.04, -0.68, 17.22)],\n [(-0.08, 0.05, 17.18), (0.08, 0.05, 17.18), (0.05, 0.12, 17.44), (-0.05, 0.12, 17.44)],\n [(-0.06, 0.88, 16.88), (0.06, 0.88, 16.88), (0.03, 1.06, 17.16), (-0.03, 1.06, 17.16)],\n ], samples_per_span=3)\n put_pair(\"head_dorsal_crest\", dorsal_sensor, \"trim\", H, bevel=0.006)\n crest_lens = prism([(-0.032, 17.02), (0.032, 17.02), (0.026, 17.18), (-0.026, 17.18)], -0.82, -0.66, \"xz\")\n put_pair(\"head_crest_lens\", crest_lens, \"sensor\", H, bevel=0.004)\n\n # Deep-set smoked wrap-around visor + twin predatory angled optic slits (`glow_eye` + `glow_hot`)\n visor = patch_shell(\n [\n [(-0.58, -0.52, 16.60), (-0.28, -0.92, 16.58), (0.0, -1.00, 16.56), (0.28, -0.92, 16.58), (0.58, -0.52, 16.60)],\n [(-0.56, -0.48, 16.34), (-0.26, -0.88, 16.32), (0.0, -0.95, 16.30), (0.26, -0.88, 16.32), (0.56, -0.48, 16.34)],\n ],\n thickness=0.05,\n subd_levels=2,\n outward=(0, -1, 0),\n )\n put_pair(\"head_visor_wrap\", visor, \"visor\", H, bevel=0.006)\n\n # Twin canted predator optic blades (canted 14 deg upward-outward, separated by nasal sensor bridge)\n eye_outer = prism([(0.08, 16.40), (0.48, 16.51), (0.44, 16.57), (0.09, 16.46)], -0.97, -0.84, \"xz\")\n eye_outer = transform(eye_outer, rot(\"Z\", 16, about=(0.08, -0.92, 16.44)))\n put_pair(\"head_eye_blade\", eye_outer, \"glow_eye\", H, H, bevel=0.0, smooth=False, outline=False)\n\n eye_core = prism([(0.12, 16.425), (0.34, 16.485), (0.32, 16.525), (0.13, 16.465)], -0.985, -0.88, \"xz\")\n eye_core = transform(eye_core, rot(\"Z\", 16, about=(0.08, -0.92, 16.44)))\n put_pair(\"head_eye_pupil\", eye_core, \"glow_hot\", H, H, bevel=0.0, smooth=False, outline=False)\n\n # Sculpted aero cheek fairings & angular jaw air-splitter keel (zero mouth slits, pure interceptor aero)\n cheek = patch_shell(\n [\n [(0.18, -0.90, 16.32), (0.54, -0.66, 16.44), (0.76, -0.06, 16.62), (0.68, 0.72, 16.58)],\n [(0.14, -0.84, 15.86), (0.48, -0.58, 15.96), (0.70, 0.02, 16.12), (0.60, 0.68, 16.16)],\n ],\n thickness=0.068,\n col_creases={1: 0.85},\n outward=(1.0, -0.5, -0.1),\n )\n put_pair(\"head_cheek_cowl\", cheek, \"main\", H, H, bevel=0.010)\n\n chin = aero_loft([\n [(-0.18, -0.86, 16.30), (0.18, -0.86, 16.30), (0.14, -0.62, 16.30), (-0.14, -0.62, 16.30)],\n [(-0.22, -0.96, 16.04), (0.22, -0.96, 16.04), (0.18, -0.64, 16.02), (-0.18, -0.64, 16.02)],\n [(-0.13, -0.84, 15.76), (0.13, -0.84, 15.76), (0.12, -0.58, 15.78), (-0.12, -0.58, 15.78)],\n ], samples_per_span=2)\n put_pair(\"head_chin_splitter\", chin, \"accent\", H, bevel=0.008)\n\n # Temple laser-rangefinder optical pods + Twin swept-back Kestrel aero-stabilizer ears\n ear_pod = transform(\n merge(\n loft([(-0.08, circle(0.16, 16)), (0.10, circle(0.14, 16))]),\n loft([(0.08, circle(0.10, 14)), (0.13, circle(0.09, 14))]),\n ),\n basis_matrix((0.72, -0.02, 16.52), (1.0, -0.08, 0.05), (0, 0, 1)),\n )\n ear_lens = transform(loft([(0.11, circle(0.075, 14)), (0.145, circle(0.070, 14))]),\n basis_matrix((0.72, -0.02, 16.52), (1.0, -0.08, 0.05), (0, 0, 1)))\n put_pair(\"head_rangefinder\", ear_pod, \"metal\", H, H, bevel=0.006)\n put_pair(\"head_range_lens\", ear_lens, \"sensor\", H, H, bevel=0.004)\n\n # Twin canted rear swept comms/sensor blades (signature hawk-eared silhouette from front, profile & rear!)\n stab = aero_loft([\n [(0.62, 0.06, 16.50), (0.74, 0.08, 16.46), (0.74, 0.42, 16.42), (0.62, 0.40, 16.46)],\n [(0.72, 0.56, 17.02), (0.81, 0.58, 16.98), (0.79, 0.86, 16.92), (0.70, 0.84, 16.96)],\n [(0.80, 1.08, 17.54), (0.85, 1.10, 17.51), (0.84, 1.24, 17.46), (0.79, 1.22, 17.49)],\n ], samples_per_span=3)\n st_base, st_tip = halves(stab, (0.76, 0.78, 17.24), (0.1, 0.45, 1.0), gap=0.020)\n put_pair(\"head_stabilizer\", st_base, \"accent\", H, H, bevel=0.008)\n put_pair(\"head_stabilizer_tip\", st_tip, \"trim\", H, H, bevel=0.006)\n\n\ndef build_arms(J):\n SL, SR = lr(J, \"shoulder\")\n UL, UR = lr(J, \"upperarm\")\n FL, FR = lr(J, \"forearm\")\n HL, HR = lr(J, \"hand\")\n\n # ---- SHOULDERS: 3-Tier Gull-Wing Variable-Sweep Pauldron + Outboard Attitude-Vernier Pod ----\n sh_chassis = aero_loft([\n [(1.52, y, z + 14.56) for y, z in octo(1.36, 1.28, 0.30)],\n [(2.76, y, z + 14.52) for y, z in octo(1.26, 1.18, 0.28)],\n ], samples_per_span=2)\n put_pair(\"shoulder_chassis\", sh_chassis, \"frame\", SL, SR, bevel=0.015)\n rotary_drum(\"shoulder_gimbal\", (2.42, 0.0, 14.45), 0.36, 0.62, SL, SR, axis=\"x\", cal_angle=90)\n\n # Compound-curved Gull-Wing upper carapace sweeping to crisp aero wingtips at x = +-4.32\n pauldron = patch_shell(\n [\n [(1.82, -0.92, 14.96), (2.92, -1.16, 15.32), (4.26, -0.62, 15.66)],\n [(1.86, 0.04, 15.26), (3.08, 0.06, 15.78), (4.36, 0.16, 15.92)],\n [(1.82, 0.96, 14.92), (2.94, 1.20, 15.26), (4.18, 0.88, 15.54)],\n ],\n thickness=0.085,\n row_creases={1: 0.90},\n outward=(0.25, 0.0, 1.0),\n )\n p_in, p_out = halves(pauldron, (3.12, 0.0, 15.5), (1.0, 0.06, -0.18), gap=0.036)\n put_pair(\"pauldron_in\", p_in, \"main\", SL, SR, bevel=0.014)\n put_pair(\"pauldron_out\", p_out, \"main\", SL, SR, bevel=0.014)\n\n # Nested outboard attitude-control vernier nacelle under the wingtip\n vpod = patch_shell(\n [\n [(3.18, -0.96, 15.22), (3.88, -0.82, 15.38), (4.18, -0.44, 15.22)],\n [(3.26, 0.04, 15.36), (4.06, 0.08, 15.48), (4.26, 0.12, 14.92)],\n [(3.16, 1.02, 15.16), (3.86, 0.94, 15.28), (4.12, 0.68, 14.84)],\n ],\n thickness=0.08,\n row_creases={1: 0.85},\n outward=(1.0, 0.0, -0.2),\n )\n vp_body, vp_strake = halves(vpod, (3.95, 0.0, 15.05), (1.0, 0.0, -0.45), gap=0.028)\n put_pair(\"pauldron_vpod\", vp_body, \"accent\", SL, SR, bevel=0.014)\n put_pair(\"pauldron_strake\", vp_strake, \"trim\", SL, SR, bevel=0.010)\n put_pair(\"pauldron_rcs_f\", louver_bank((3.62, -0.92, 15.16), (0.3, -1.0, -0.1), (0, -0.1, 1), 0.34, 0.22, count=3),\n \"metal\", SL, SR, smooth=False, bevel=0.005)\n put_pair(\"pauldron_rcs_r\", louver_bank((3.60, 0.98, 15.10), (0.3, 1.0, -0.1), (0, 0.1, 1), 0.34, 0.22, count=3),\n \"metal\", SL, SR, smooth=False, bevel=0.005)\n\n # Dorsal shoulder aero-winglet spoiler\n winglet = aero_loft([\n [(2.26, -0.32, 15.34), (2.40, -0.32, 15.34), (2.40, 0.68, 15.30), (2.26, 0.68, 15.30)],\n [(2.34, 0.05, 16.02), (2.44, 0.05, 16.02), (2.44, 0.88, 15.92), (2.34, 0.88, 15.92)],\n ], samples_per_span=2)\n put_pair(\"pauldron_winglet\", winglet, \"accent\", SL, SR, bevel=0.010)\n\n # Bearing anchor on left shoulder for optional emblem projection\n empty(\"bearing.shoulder.L\", (3.75, 0.05, 15.62), SL, dir=gltf_dir((0.45, 0.0, 0.89)), size=0.72)\n\n # ---- UPPER ARMS: Bicep/Tricep Split Compound Shells + Exposed Lateral Hydraulic Rod ----\n bicep_core = aero_loft([\n [(x + 2.48, y, 12.12) for x, y in octo(0.76, 0.82, 0.20)],\n [(x + 2.48, y, 13.25) for x, y in octo(0.84, 0.90, 0.22)],\n [(x + 2.46, y, 14.28) for x, y in octo(0.80, 0.86, 0.20)],\n ], samples_per_span=2)\n put_pair(\"upperarm_chassis\", bicep_core, \"joint\", UL, UR, bevel=0.012)\n actuator(\"bicep_piston\", (2.94, -0.06, 12.35), (2.92, -0.04, 13.92), r=0.062, jl=UL, jr=UR)\n\n bicep_f = patch_shell(\n [\n [(2.04, -0.22, 13.98), (2.50, -0.64, 14.02), (2.96, -0.22, 13.98)],\n [(2.02, -0.26, 13.18), (2.52, -0.72, 13.20), (3.00, -0.26, 13.18)],\n [(2.08, -0.20, 12.42), (2.50, -0.58, 12.40), (2.92, -0.20, 12.42)],\n ],\n thickness=0.07,\n col_creases={1: 0.82},\n outward=(0, -1, 0),\n )\n bf_lo, bf_hi = halves(bicep_f, (2.5, -0.6, 13.62), (0, 0, 1), gap=0.028)\n put_pair(\"bicep_cuff\", bf_hi, \"accent\", UL, UR, bevel=0.010)\n put_pair(\"bicep_front\", bf_lo, \"main\", UL, UR, bevel=0.012)\n\n tricep_r = patch_shell(\n [\n [(2.04, 0.22, 13.96), (2.50, 0.64, 14.00), (2.96, 0.22, 13.96)],\n [(2.02, 0.26, 13.18), (2.52, 0.70, 13.18), (3.00, 0.26, 13.18)],\n [(2.08, 0.20, 12.42), (2.50, 0.58, 12.40), (2.92, 0.20, 12.42)],\n ],\n thickness=0.07,\n col_creases={1: 0.82},\n outward=(0, 1, 0),\n )\n put_pair(\"tricep_rear\", tricep_r, \"main\", UL, UR, bevel=0.012)\n\n # Compound Rotary Elbow Drum + Hydraulic Damper\n rotary_drum(\"elbow_drum\", (2.50, 0.0, 11.95), 0.42, 0.86, UL, UR, axis=\"x\", cal_angle=180)\n actuator(\"elbow_damper\", (2.50, 0.56, 12.42), (2.50, 0.50, 11.45), r=0.072, jl=FL, jr=FR)\n\n # ---- FOREARMS: Sculpted Aero-Vambrace + Olecranon Guard + Hardpoint Latch ----\n fa_core = aero_loft([\n [(x + 2.50, y, 9.58) for x, y in octo(0.58, 0.68, 0.16)],\n [(x + 2.50, y, 10.90) for x, y in octo(0.74, 0.86, 0.20)],\n [(x + 2.50, y, 11.95) for x, y in octo(0.76, 0.88, 0.20)],\n ], samples_per_span=2)\n put_pair(\"forearm_chassis\", fa_core, \"frame\", FL, FR, bevel=0.012)\n\n # Outer compound aero-shield vambrace sweeping up into pointed elbow spur\n vambrace_out = patch_shell(\n [\n [(2.52, -0.52, 12.16), (3.12, -0.44, 12.06), (3.26, 0.08, 12.24), (2.82, 0.78, 12.48)],\n [(2.52, -0.64, 11.12), (3.24, -0.52, 11.08), (3.34, 0.04, 11.12), (2.92, 0.68, 11.16)],\n [(2.50, -0.50, 9.72), (2.94, -0.42, 9.70), (3.00, 0.02, 9.72), (2.74, 0.50, 9.74)],\n ],\n thickness=0.075,\n col_creases={2: 0.88},\n outward=(1.0, 0.0, 0.0),\n )\n vo_lo, vo_hi = halves(vambrace_out, (3.0, 0.0, 11.36), (-0.18, 0.08, 1.0), gap=0.030)\n put_pair(\"vambrace_spur\", vo_hi, \"main\", FL, FR, bevel=0.012)\n vo_main, vo_band = halves(vo_lo, (3.0, 0.0, 10.12), (0.0, 0.0, -1.0), gap=0.028)\n put_pair(\"vambrace_out\", vo_main, \"main\", FL, FR, bevel=0.012)\n put_pair(\"vambrace_cuff\", vo_band, \"trim\", FL, FR, bevel=0.010)\n\n # Recessed hardpoint rail on outer forearm\n hp = aero_loft([\n [(3.24, -0.32, 10.38), (3.38, -0.26, 10.42), (3.38, 0.28, 10.42), (3.24, 0.34, 10.38)],\n [(3.30, -0.34, 11.24), (3.46, -0.28, 11.20), (3.46, 0.30, 11.20), (3.30, 0.36, 11.24)],\n ], samples_per_span=2)\n put_pair(\"vambrace_hardpoint\", hp, \"accent\", FL, FR, bevel=0.010)\n latch_ring = transform(loft([(0.0, circle(0.14, 14)), (0.06, circle(0.12, 14))]),\n basis_matrix((3.43, 0.01, 10.82), (1, 0, 0.05), (0, 0, 1)))\n put_pair(\"vambrace_latch\", latch_ring, \"metal\", FL, FR, bevel=0.005)\n\n # Inner forearm fairing\n vambrace_in = patch_shell(\n [\n [(2.46, -0.50, 11.88), (2.02, -0.38, 11.84), (1.98, 0.38, 11.84), (2.46, 0.52, 11.88)],\n [(2.46, -0.54, 10.82), (1.98, -0.40, 10.80), (1.96, 0.40, 10.80), (2.46, 0.54, 10.82)],\n [(2.46, -0.44, 9.72), (2.10, -0.34, 9.70), (2.08, 0.34, 9.70), (2.46, 0.44, 9.72)],\n ],\n thickness=0.068,\n col_creases={1: 0.75, 2: 0.75},\n outward=(-1.0, 0.0, 0.0),\n )\n put_pair(\"vambrace_in\", vambrace_in, \"main\", FL, FR, bevel=0.012)\n\n # ---- ARTICULATED 5-DIGIT MECHANICAL MANIPULATORS (`hand.L/R`) ----\n put_pair(\"wrist_ball\", cylinder(0.26, 9.42, 9.74, 14, at=(2.50, 0.0)), \"joint\", HL, HR, bevel=0.006)\n put_pair(\"wrist_ring\", cylinder(0.31, 9.54, 9.64, 14, at=(2.50, 0.0)), \"metal\", HL, HR, bevel=0.005)\n\n # Palm actuator block + sculpted dorsal metacarpal armor backplate\n palm = loft([(8.96, octo(0.38, 0.76, 0.09, x=2.48, y=-0.02)), (9.48, octo(0.42, 0.74, 0.10, x=2.50, y=-0.02))])\n put_pair(\"hand_palm\", palm, \"frame\", HL, HR, bevel=0.012)\n\n hand_back = patch_shell(\n [\n [(2.66, -0.38, 9.52), (2.78, 0.0, 9.54), (2.66, 0.36, 9.52)],\n [(2.68, -0.40, 9.02), (2.82, 0.0, 9.04), (2.68, 0.38, 9.02)],\n ],\n thickness=0.055,\n col_creases={1: 0.85},\n outward=(1, 0, 0),\n )\n put_pair(\"hand_dorsal_armor\", hand_back, \"main\", HL, HR, bevel=0.008)\n\n # 4 individually segmented fingers curled cleanly around grip axis (x=2.36, y=-0.02, z=9.12)\n finger_bms = []\n knuckle_bms = []\n for i, fy in enumerate((-0.28, -0.10, 0.08, 0.25)):\n scale_l = (0.94, 1.0, 0.96, 0.84)[i]\n # Proximal phalanx curving down and inward around weapon grip\n p1 = loft([\n (8.98, octo(0.14, 0.13, 0.03, x=2.60, y=fy)),\n (8.70, octo(0.13, 0.12, 0.03, x=2.48, y=fy)),\n ])\n # Distal phalanx curling inward under grip\n p2 = loft([\n (8.72, octo(0.12, 0.11, 0.025, x=2.48, y=fy)),\n (8.78 + (1 - scale_l) * 0.08, octo(0.11, 0.10, 0.025, x=2.22, y=fy)),\n ])\n finger_bms.extend([p1, p2])\n knuckle_bms.append(cylinder(0.065, fy - 0.06, fy + 0.06, 10, axis=\"y\", at=(2.62, 8.98)))\n put_pair(\"hand_fingers\", merge(*finger_bms), \"frame\", HL, HR, bevel=0.008)\n put_pair(\"hand_knuckles\", merge(*knuckle_bms), \"metal\", HL, HR, bevel=0.004)\n\n # Opposable 2-segment thumb wrapping front of grip\n thumb = merge(\n loft([(9.36, octo(0.15, 0.16, 0.035, x=2.42, y=-0.42)), (9.10, octo(0.14, 0.15, 0.03, x=2.26, y=-0.48))]),\n loft([(9.12, octo(0.13, 0.14, 0.03, x=2.26, y=-0.48)), (9.04, octo(0.12, 0.12, 0.025, x=2.24, y=-0.24))]),\n )\n put_pair(\"hand_thumb\", thumb, \"joint\", HL, HR, bevel=0.008)\n\n\ndef build_legs(J):\n TL, TR = lr(J, \"thigh\")\n SL, SR = lr(J, \"shin\")\n FL, FR = lr(J, \"foot\")\n\n # ---- THIGHS: Femur Truss +Femoral Piston + 3-Piece Compound-Curved Carapace ----\n put_pair(\"hip_ball\", cylinder(0.46, 0.58, 1.58, 16, axis=\"x\", at=(0.0, 10.55)), \"joint\", TL, TR, bevel=0.008)\n femur = aero_loft([\n [(x + 1.20, y, 6.42) for x, y in octo(0.76, 0.92, 0.20)],\n [(x + 1.18, y, 8.65) for x, y in octo(1.18, 1.34, 0.30)],\n [(x + 1.16, y, 10.22) for x, y in octo(1.06, 1.20, 0.26)],\n ], samples_per_span=3)\n put_pair(\"thigh_femur\", femur, \"frame\", TL, TR, bevel=0.016)\n actuator(\"thigh_piston\", (1.20, -0.58, 7.15), (1.18, -0.68, 9.55), r=0.095, jl=TL, TR=None) if False else None\n actuator(\"thigh_piston\", (1.20, -0.56, 7.08), (1.18, -0.66, 9.48), r=0.09, jl=TL, jr=TR)\n\n # Front & outer compound-curved thigh carapace\n thigh_front = patch_shell(\n [\n [(0.58, -0.46, 10.06), (1.18, -1.04, 10.12), (1.96, -0.46, 10.02), (2.06, 0.36, 9.94)],\n [(0.54, -0.52, 8.85), (1.22, -1.16, 8.92), (2.08, -0.50, 8.84), (2.14, 0.42, 8.80)],\n [(0.68, -0.44, 7.22), (1.20, -0.96, 7.18), (1.78, -0.42, 7.22), (1.84, 0.32, 7.26)],\n ],\n thickness=0.085,\n col_creases={1: 0.88, 2: 0.72},\n outward=(0.35, -1.0, 0.0),\n )\n tf_lo, tf_hi = halves(thigh_front, (1.2, -0.8, 9.32), (-0.22, 0.12, 1.0), gap=0.034)\n put_pair(\"thigh_cuff_top\", tf_hi, \"accent\", TL, TR, bevel=0.014)\n tf_mid_lo, tf_mid_hi = halves(tf_lo, (1.2, -0.8, 8.12), (0.24, -0.10, 1.0), gap=0.034)\n put_pair(\"thigh_plate_up\", tf_mid_hi, \"main\", TL, TR, bevel=0.014)\n put_pair(\"thigh_plate_low\", tf_mid_lo, \"main\", TL, TR, bevel=0.014)\n\n # Outer thigh trim strake\n t_strake = aero_loft([\n [(2.04, -0.12, 7.85), (2.16, -0.08, 7.88), (2.16, 0.34, 7.88), (2.04, 0.38, 7.85)],\n [(2.12, -0.16, 9.18), (2.26, -0.10, 9.15), (2.26, 0.38, 9.15), (2.12, 0.42, 9.18)],\n ], samples_per_span=2)\n put_pair(\"thigh_strake\", t_strake, \"trim\", TL, TR, bevel=0.008)\n\n # Rear hamstring shell + vent louvers\n thigh_rear = patch_shell(\n [\n [(0.62, 0.44, 9.88), (1.22, 0.96, 9.92), (1.92, 0.48, 9.84)],\n [(0.64, 0.46, 8.62), (1.22, 1.00, 8.64), (1.90, 0.50, 8.60)],\n [(0.74, 0.40, 7.12), (1.20, 0.80, 7.08), (1.72, 0.42, 7.12)],\n ],\n thickness=0.075,\n col_creases={1: 0.82},\n outward=(0, 1, 0),\n )\n put_pair(\"thigh_rear_shell\", thigh_rear, \"main\", TL, TR, bevel=0.014)\n\n # ---- DOUBLE-DRUM KNEE JOINT + FLOATING LAYERED KNEE AERO-SPIKE (`shin.L/R`) ----\n rotary_drum(\"knee_upper\", (1.20, 0.04, 6.36), 0.42, 0.96, SL, SR, axis=\"x\", cal_angle=160)\n rotary_drum(\"knee_lower\", (1.20, 0.08, 5.82), 0.44, 1.02, SL, SR, axis=\"x\", cal_angle=200)\n # Optical side-marker lens on outboard knee cap\n knee_opt = cylinder(0.18, 1.82, 1.88, 16, axis=\"x\", at=(0.08, 5.82))\n put_pair(\"knee_optic\", knee_opt, \"sensor\", SL, SR, bevel=0.005)\n actuator(\"knee_rear_act\", (1.20, 0.64, 7.28), (1.20, 0.78, 5.42), r=0.095, jl=SL, jr=SR)\n\n # Twin machined patella guide rails + compound-curved knee cowl blade\n for side_k, kx in ((\"in\", 0.86), (\"out\", 1.54)):\n rail = loft([(5.95, octo(0.14, 0.26, 0.03, x=kx, y=-0.52)), (7.02, octo(0.12, 0.22, 0.03, x=kx, y=-0.62))])\n put_pair(f\"knee_rail_{side_k}\", rail, \"metal\", SL, SR, bevel=0.008)\n\n knee_cowl = patch_shell(\n [\n [(0.82, -0.72, 7.16), (1.20, -1.28, 7.22), (1.58, -0.72, 7.16)],\n [(0.68, -0.64, 6.38), (1.20, -1.36, 6.44), (1.72, -0.64, 6.38)],\n [(0.76, -0.62, 5.64), (1.20, -1.16, 5.60), (1.64, -0.62, 5.64)],\n ],\n thickness=0.085,\n col_creases={1: 0.94},\n row_creases={1: 0.72},\n outward=(0, -1, 0.15),\n )\n kc_body, kc_tip = halves(knee_cowl, (1.2, -1.0, 6.86), (0, -0.35, 1.0), gap=0.026)\n put_pair(\"knee_shield\", kc_body, \"accent\", SL, SR, bevel=0.014)\n put_pair(\"knee_crest\", kc_tip, \"trim\", SL, SR, bevel=0.010)\n\n # ---- SHINS & REVERSE-SWEPT CALF VECTOR-THRUSTER NACELLES (`shin.L/R`) ----\n tibia = aero_loft([\n [(x + 1.20, y + 0.08, 1.72) for x, y in octo(0.76, 0.92, 0.20)],\n [(x + 1.20, y + 0.06, 3.85) for x, y in octo(0.92, 1.08, 0.24)],\n [(x + 1.20, y + 0.04, 5.75) for x, y in octo(0.96, 1.12, 0.24)],\n ], samples_per_span=2)\n put_pair(\"shin_tibia\", tibia, \"frame\", SL, SR, bevel=0.015)\n actuator(\"achilles_in\", (0.96, 0.68, 2.68), (0.98, 0.84, 1.72), r=0.068, jl=SL, jr=SR)\n actuator(\"achilles_out\", (1.44, 0.68, 2.68), (1.42, 0.84, 1.72), r=0.068, jl=SL, jr=SR)\n\n # Razor-keeled aerodynamic front shin prow tapering to athletic ankle\n shin_prow = patch_shell(\n [\n [(0.68, -0.22, 5.56), (1.20, -1.08, 5.58), (1.82, -0.18, 5.54)],\n [(0.62, -0.26, 4.18), (1.20, -1.12, 4.20), (1.92, -0.20, 4.16)],\n [(0.72, -0.20, 2.86), (1.20, -0.96, 2.84), (1.76, -0.18, 2.86)],\n [(0.82, -0.14, 1.92), (1.20, -0.78, 1.90), (1.58, -0.14, 1.92)],\n ],\n thickness=0.082,\n col_creases={1: 0.94},\n outward=(0.15, -1.0, 0.0),\n )\n sp_lo, sp_hi = halves(shin_prow, (1.2, -0.7, 3.56), (0.20, -0.12, 1.0), gap=0.034)\n put_pair(\"shin_prow_hi\", sp_hi, \"main\", SL, SR, bevel=0.014)\n put_pair(\"shin_prow_lo\", sp_lo, \"main\", SL, SR, bevel=0.014)\n\n # Dramatic reverse-swept rear/outer calf aero-thruster nacelle (hero feature from behind in flight!)\n calf_nacelle = patch_shell(\n [\n [(0.68, 0.24, 5.48), (1.20, 1.24, 5.46), (1.96, 0.42, 5.38)],\n [(0.64, 0.34, 4.52), (1.22, 1.82, 4.56), (2.16, 0.56, 4.44)],\n [(0.74, 0.36, 3.38), (1.20, 1.42, 3.34), (1.94, 0.46, 3.36)],\n [(0.84, 0.30, 2.38), (1.20, 0.92, 2.32), (1.64, 0.34, 2.38)],\n ],\n thickness=0.085,\n col_creases={1: 0.88},\n row_creases={1: 0.78},\n outward=(0.25, 1.0, 0.1),\n )\n cn_lo, cn_hi = halves(calf_nacelle, (1.2, 1.2, 4.18), (-0.15, -0.25, 1.0), gap=0.036)\n put_pair(\"calf_fairing_hi\", cn_hi, \"main\", SL, SR, bevel=0.014)\n cn_fin, cn_mid = halves(cn_lo, (1.72, 0.6, 3.4), (-1.0, 0.25, 0.15), gap=0.030)\n put_pair(\"calf_fairing_lo\", cn_mid, \"accent\", SL, SR, bevel=0.014)\n put_pair(\"calf_outer_fin\", cn_fin, \"trim\", SL, SR, bevel=0.010)\n\n # Recessed heat-exchanger louvers + Multi-petal calf braking/lift vector thruster (`nozzle.calf.L/R`)\n put_pair(\"calf_louvers\", louver_bank((1.20, 1.24, 2.88), (0.0, 1.0, -0.28), (0, 0.28, 1), 0.48, 0.58, count=5),\n \"metal\", SL, SR, smooth=False, bevel=0.005)\n vectored_nozzle(\"calf_vec\", (1.22, 1.44, 4.26), (0.0, 0.50, -0.866), 0.33, 0.56, SL, SR, petals=6, kind=\"calf\")\n\n # ---- ARTICULATED RAPTOR LANDING FEET (`foot.L/R`, soles grounded cleanly at z = 0.0) ----\n rotary_drum(\"ankle_drum\", (1.20, 0.10, 1.55), 0.36, 0.82, FL, FR, axis=\"x\", cal_angle=0)\n actuator(\"instep_damper\", (1.20, -0.34, 1.62), (1.20, -0.96, 0.82), r=0.068, jl=FL, FR=None) if False else None\n actuator(\"instep_damper\", (1.20, -0.34, 1.62), (1.20, -0.96, 0.82), r=0.068, jl=FL, jr=FR)\n\n # Floating sculpted ankle guard spat\n spat = patch_shell(\n [\n [(0.72, -0.38, 2.16), (1.20, -0.98, 2.24), (1.68, -0.38, 2.16)],\n [(0.64, -0.46, 1.22), (1.20, -1.16, 1.18), (1.76, -0.46, 1.22)],\n ],\n thickness=0.072,\n col_creases={1: 0.90},\n outward=(0, -1, 0.2),\n )\n sp_b, sp_t = halves(spat, (1.2, -0.8, 1.92), (0, -0.2, 1.0), gap=0.024)\n put_pair(\"ankle_spat_main\", sp_b, \"main\", FL, FR, bevel=0.012)\n put_pair(\"ankle_spat_trim\", sp_t, \"trim\", FL, FR, bevel=0.008)\n\n # Arched mechanical foot bridge + split twin-talon front sabot + swept heel stabilizer spur\n bridge = aero_loft([\n [(x + 1.20, y - 0.10, 0.28) for x, y in octo(1.06, 1.82, 0.24)],\n [(x + 1.20, y - 0.02, 1.08) for x, y in octo(0.88, 1.34, 0.20)],\n ], samples_per_span=2)\n put_pair(\"foot_bridge\", bridge, \"frame\", FL, FR, bevel=0.014)\n\n # Upper vamp shell over instep\n vamp = patch_shell(\n [\n [(0.62, -0.42, 1.08), (1.20, -0.92, 1.16), (1.78, -0.42, 1.08)],\n [(0.58, -1.38, 0.68), (1.20, -1.78, 0.72), (1.82, -1.38, 0.68)],\n ],\n thickness=0.075,\n col_creases={1: 0.88},\n outward=(0, -0.6, 1.0),\n )\n put_pair(\"foot_vamp\", vamp, \"main\", FL, FR, bevel=0.012)\n\n # Cloven twin-talon forward claws (inner and outer aerodynamic toes)\n for tag, tx, sx_toe in ((\"in\", 0.90, -0.08), (\"out\", 1.50, 0.08)):\n talon = aero_loft([\n [(tx - 0.24, -1.16, 0.14), (tx + 0.24, -1.16, 0.14), (tx + 0.20, -1.12, 0.76), (tx - 0.20, -1.12, 0.76)],\n [(tx + sx_toe - 0.21, -1.86, 0.12), (tx + sx_toe + 0.21, -1.86, 0.12), (tx + sx_toe + 0.16, -1.82, 0.56), (tx + sx_toe - 0.16, -1.82, 0.56)],\n [(tx + sx_toe * 1.3 - 0.13, -2.42, 0.12), (tx + sx_toe * 1.3 + 0.13, -2.42, 0.12), (tx + sx_toe * 1.3 + 0.09, -2.34, 0.32), (tx + sx_toe * 1.3 - 0.09, -2.34, 0.32)],\n ], samples_per_span=2)\n t_tip, t_base = halves(talon, (tx, -2.02, 0.3), (0, 1.0, 0.15), gap=0.022)\n put_pair(f\"foot_talon_{tag}\", t_base, \"accent\", FL, FR, bevel=0.012)\n put_pair(f\"foot_claw_{tag}\", t_tip, \"trim\", FL, FR, bevel=0.008)\n\n sole = prism([\n (tx - 0.22, -1.12), (tx + 0.22, -1.12),\n (tx + sx_toe * 1.2 + 0.14, -2.36), (tx + sx_toe * 1.2 - 0.14, -2.36),\n ], 0.0, 0.13, \"xy\")\n put_pair(f\"sole_front_{tag}\", sole, \"joint\", FL, FR, bevel=0.008, smooth=False)\n\n # Rear heel stabilizer spur + grounded sole pad\n heel = aero_loft([\n [(0.72, 0.62, 0.14), (1.68, 0.62, 0.14), (1.60, 0.58, 0.98), (0.80, 0.58, 0.98)],\n [(0.78, 1.32, 0.14), (1.62, 1.32, 0.14), (1.52, 1.24, 0.72), (0.88, 1.24, 0.72)],\n [(0.92, 1.76, 0.16), (1.48, 1.76, 0.16), (1.40, 1.66, 0.44), (1.00, 1.66, 0.44)],\n ], samples_per_span=2)\n put_pair(\"foot_heel_spur\", heel, \"accent\", FL, FR, bevel=0.012)\n heel_sole = prism([(0.74, 0.48), (1.66, 0.48), (1.50, 1.70), (0.90, 1.70)], 0.0, 0.14, \"xy\")\n put_pair(\"sole_heel\", heel_sole, \"joint\", FL, FR, bevel=0.008, smooth=False)\n\n\ndef build_backpack_and_binders(J):\n B = J[\"backpack\"]\n BL, BR = lr(J, \"binder\")\n\n # ---- DORSAL VECTOR-THRUST FLIGHT PACK (`backpack`) ----\n pack_chassis = aero_loft([\n [(x, 1.18, y + 13.85) for x, y in octo(1.88, 2.28, 0.42)],\n [(x, 2.02, y + 13.82) for x, y in octo(1.76, 2.12, 0.40)],\n [(x, 2.48, y + 13.95) for x, y in octo(1.26, 1.56, 0.32)],\n ], samples_per_span=3)\n put_pair(\"pack_chassis\", pack_chassis, \"frame\", B, bevel=0.016)\n\n # Sculpted compound dorsal reactor cowling\n pack_cowl = patch_shell(\n [\n [(-0.92, 1.28, 15.16), (0.0, 1.52, 15.26), (0.92, 1.28, 15.16)],\n [(-1.12, 1.98, 14.32), (0.0, 2.48, 14.42), (1.12, 1.98, 14.32)],\n [(-1.02, 1.96, 13.28), (0.0, 2.42, 13.24), (1.02, 1.96, 13.28)],\n [(-0.68, 1.48, 12.48), (0.0, 1.82, 12.42), (0.68, 1.48, 12.48)],\n ],\n thickness=0.09,\n col_creases={1: 0.88},\n row_creases={1: 0.75},\n outward=(0, 1, 0.1),\n )\n pc_lo, pc_hi = halves(pack_cowl, (0, 2.1, 14.48), (0, -0.25, 1.0), gap=0.034)\n put_pair(\"pack_cowl_top\", pc_hi, \"accent\", B, bevel=0.014)\n put_pair(\"pack_cowl_body\", pc_lo, \"main\", B, bevel=0.014)\n\n # Central Overboost Reactor Turbine Core (stator vanes + machined shroud + glowing cyan core!)\n turb_m = basis_matrix((0, 2.42, 13.92), (0, 1, 0.12), (0, -0.12, 1))\n shroud = transform(\n merge(\n loft([(-0.18, circle(0.62, 24)), (0.16, circle(0.54, 24))]),\n loft([(0.12, circle(0.58, 24)), (0.24, circle(0.48, 24))]),\n ),\n turb_m,\n )\n put_pair(\"overboost_shroud\", shroud, \"metal\", B, bevel=0.008)\n\n stators = []\n for i in range(8):\n ang = 45 * i\n blade = prism([(0.14, 0.08), (0.44, 0.12), (0.44, 0.20), (0.14, 0.16)], -0.022, 0.022, \"xz\")\n stators.append(transform(blade, rot(\"Z\", ang)))\n put_pair(\"overboost_stators\", transform(merge(*stators), turb_m), \"frame\", B, bevel=0.004, smooth=False)\n\n core_glow = transform(loft([(0.12, circle(0.38, 20)), (0.17, circle(0.36, 20))]), turb_m)\n core_hub = transform(loft([(0.14, circle(0.14, 16)), (0.26, circle(0.06, 16))]), turb_m)\n put_pair(\"overboost_glow\", core_glow, \"glow_core\", B, bevel=0.0, smooth=False, outline=False)\n put_pair(\"overboost_hub\", core_hub, \"joint\", B, bevel=0.006)\n\n # Twin Compound-Curved Main Vector Engine Pods + 8-Petal Vectored Nozzles (`nozzle.main.L/R`)\n nacelle = patch_shell(\n [\n [(0.28, 1.54, 13.52), (0.76, 1.88, 13.68), (1.28, 1.58, 13.42)],\n [(0.32, 1.84, 12.92), (0.80, 2.48, 13.06), (1.36, 1.98, 12.86)],\n [(0.38, 1.98, 12.38), (0.78, 2.54, 12.48), (1.26, 2.08, 12.34)],\n ],\n thickness=0.085,\n col_creases={1: 0.85},\n outward=(0.35, 1.0, -0.2),\n )\n nac_collar, nac_body = halves(nacelle, (0.78, 2.1, 13.26), (0.0, -0.35, -1.0), gap=0.030)\n put_pair(\"main_nacelle_top\", nac_collar, \"accent\", B, B, bevel=0.012)\n put_pair(\"main_nacelle_body\", nac_body, \"main\", B, B, bevel=0.014)\n put_pair(\"main_nacelle_vents\", louver_bank((1.16, 1.94, 13.06), (0.8, 0.6, 0.1), (0, -0.1, 1), 0.32, 0.44, count=4),\n \"metal\", B, B, smooth=False, bevel=0.005)\n\n vectored_nozzle(\"main_eng\", (0.76, 2.12, 12.68), (0.06, 0.45, -0.89), 0.45, 0.86, B, B, petals=8, kind=\"main\")\n\n # ---- VARIABLE-GEOMETRY SWEPT GULL-WING AERO-BINDERS (`binder.L/R` at (+-0.9, 2.25, 14.7)) ----\n rotary_drum(\"binder_gimbal\", (0.90, 2.25, 14.70), 0.28, 0.56, BL, BR, axis=\"x\", cal_angle=45)\n actuator(\"binder_fold_act\", (0.72, 1.98, 14.22), (1.02, 2.36, 14.62), r=0.068, jl=B, jr=B)\n\n # Swept compound-curved gull-wing airfoil binder (authored on Left +X, mirrored cleanly to Right -X)\n wing = patch_shell(\n [\n [(0.96, 1.92, 14.88), (1.88, 2.18, 15.86), (2.96, 2.68, 16.78)],\n [(1.06, 2.38, 14.64), (2.06, 2.78, 15.48), (3.18, 3.32, 16.28)],\n [(0.98, 2.76, 14.12), (1.86, 3.16, 14.68), (2.78, 3.58, 15.22)],\n [(0.88, 2.64, 13.42), (1.42, 2.94, 13.68), (1.96, 3.22, 13.86)],\n ],\n thickness=0.082,\n row_creases={1: 0.90},\n outward=(0.75, -0.55, 0.35),\n )\n w_root, w_outer = halves(wing, (1.56, 2.6, 14.9), (1.0, 0.25, 0.35), gap=0.034)\n put_pair(\"binder_root_chine\", w_root, \"accent\", BL, BR, bevel=0.014)\n w_main, w_tip = halves(w_outer, (2.62, 3.0, 15.9), (1.0, 0.28, 0.42), gap=0.030)\n put_pair(\"binder_wing_main\", w_main, \"main\", BL, BR, bevel=0.014)\n put_pair(\"binder_wing_tip\", w_tip, \"trim\", BL, BR, bevel=0.012)\n\n # Stowed High-Frequency Plasma Blade Pylon along dorsal root spine of each binder\n pylon_m = Matrix.Translation((1.24, 2.18, 15.16)) @ rot(\"Y\", 42) @ rot(\"X\", -24)\n scabbard = loft([(-0.85, octo(0.20, 0.28, 0.05)), (0.95, octo(0.18, 0.24, 0.04))])\n hilt = merge(\n loft([(0.92, circle(0.11, 14)), (1.68, circle(0.095, 14))]),\n loft([(0.96, circle(0.14, 14)), (1.10, circle(0.14, 14))]),\n )\n pommel = loft([(1.64, circle(0.125, 14)), (1.82, circle(0.10, 14))])\n pip = loft([(1.02, circle(0.148, 12)), (1.06, circle(0.148, 12))])\n put_pair(\"binder_scabbard\", transform(scabbard, pylon_m), \"frame\", BL, BR, bevel=0.010)\n put_pair(\"binder_blade_hilt\", transform(hilt, pylon_m), \"metal\", BL, BR, bevel=0.006)\n put_pair(\"binder_blade_cap\", transform(pommel, pylon_m), \"trim\", BL, BR, bevel=0.006)\n put_pair(\"binder_blade_pip\", transform(pip, pylon_m), \"glow_core\", BL, BR, bevel=0.0, smooth=False, outline=False)\n\n # Ventral Binder Attitude/Strafe Thruster Pod + 6-Petal Vectored Nozzle (`nozzle.binder.L/R`)\n bpod = aero_loft([\n [(x + 1.24, y + 2.52, 14.32) for x, y in octo(0.56, 0.64, 0.14)],\n [(x + 1.34, y + 2.68, 13.86) for x, y in octo(0.66, 0.72, 0.16)],\n ], samples_per_span=2)\n put_pair(\"binder_thruster_pod\", bpod, \"frame\", BL, BR, bevel=0.012)\n vectored_nozzle(\"binder_vec\", (1.36, 2.72, 13.88), (0.24, 0.44, -0.865), 0.32, 0.58, BL, BR, petals=6, kind=\"binder\")\n\n\ndef build_carbon_0():\n J = striker_joints()\n J[\"frame\"][\"frame\"] = \"carbon_0\"\n J[\"frame\"][\"height\"] = 17.6\n build_pelvis(J)\n build_waist(J)\n build_torso_and_cockpit(J)\n build_head(J)\n build_arms(J)\n build_legs(J)\n build_backpack_and_binders(J)\n return J[\"frame\"]\n\n\ndef build_carbon_rifle():\n \"\"\"Bespoke twin-rail electromagnetic carbine (`carbon_rifle`), authored around grip origin pointing -Y.\"\"\"\n root = empty(\"carbon_rifle\", (0, 0, 0), weapon=\"rail_carbine\")\n\n # Ergonomic angled pistol grip + trigger guard\n grip = transform(loft([(-1.02, octo(0.28, 0.48, 0.07, y=0.04)), (0.24, octo(0.30, 0.50, 0.08, y=0.04))]), rot(\"X\", 15))\n put_pair(\"grip_handle\", grip, \"joint\", root, bevel=0.012)\n tguard = prism([(-0.62, -0.34), (-0.12, -0.34), (-0.02, 0.28), (-0.14, 0.28), (-0.20, -0.22), (-0.56, -0.22)], -0.09, 0.09, \"yz\")\n put_pair(\"trigger_guard\", tguard, \"frame\", root, bevel=0.008)\n\n # Compound-curved upper receiver (`main`) & lower receiver (`accent`)\n rec_up = aero_loft([\n [(x, 1.95, y + 0.88) for x, y in octo(0.56, 0.62, 0.14)],\n [(x, -0.45, y + 0.92) for x, y in octo(0.64, 0.68, 0.16)],\n [(x, -2.95, y + 0.88) for x, y in octo(0.54, 0.58, 0.14)],\n ], samples_per_span=3)\n put_pair(\"receiver_upper\", rec_up, \"main\", root, bevel=0.015)\n\n rec_low = aero_loft([\n [(x, 1.65, y + 0.44) for x, y in octo(0.48, 0.46, 0.10)],\n [(x, -0.65, y + 0.44) for x, y in octo(0.54, 0.50, 0.12)],\n [(x, -2.55, y + 0.52) for x, y in octo(0.46, 0.42, 0.10)],\n ], samples_per_span=2)\n put_pair(\"receiver_lower\", rec_low, \"accent\", root, bevel=0.014)\n\n # Skeletonized thumbhole buttstock\n stock = aero_loft([\n [(x, 1.80, y + 0.68) for x, y in octo(0.44, 0.72, 0.12)],\n [(x, 3.18, y + 0.52) for x, y in octo(0.38, 1.04, 0.12)],\n ], samples_per_span=2)\n put_pair(\"buttstock\", stock, \"frame\", root, bevel=0.014)\n buttpad = loft([(3.14, octo(0.40, 1.08, 0.12, y=0.52)), (3.34, octo(0.36, 1.02, 0.10, y=0.52))], axis=\"y\")\n put_pair(\"buttpad\", buttpad, \"joint\", root, bevel=0.010)\n\n # Forward-angled box magazine + vermilion trim baseplate\n mag = transform(loft([(-0.92, octo(0.32, 0.62, 0.08)), (0.28, octo(0.34, 0.64, 0.08))]),\n Matrix.Translation((0, -1.25, 0.18)) @ rot(\"X\", -18))\n mag_cap = transform(loft([(-1.06, octo(0.36, 0.68, 0.08)), (-0.90, octo(0.35, 0.66, 0.08))]),\n Matrix.Translation((0, -1.25, 0.18)) @ rot(\"X\", -18))\n put_pair(\"magazine\", mag, \"frame\", root, bevel=0.010)\n put_pair(\"mag_baseplate\", mag_cap, \"trim\", root, bevel=0.008)\n\n # Twin machined electromagnetic accelerator rails + glowing plasma induction channel!\n for tag, rz in ((\"top\", 0.94), (\"bot\", 0.58)):\n rail = loft([(-2.80, octo(0.34, 0.18, 0.04, y=rz)), (-6.28, octo(0.26, 0.15, 0.035, y=rz))], axis=\"y\")\n put_pair(f\"accel_rail_{tag}\", rail, \"metal\", root, bevel=0.008)\n\n plasma_strip = loft([(-2.90, octo(0.12, 0.10, 0.02, y=0.76)), (-6.12, octo(0.09, 0.08, 0.02, y=0.76))], axis=\"y\")\n put_pair(\"plasma_channel\", plasma_strip, \"glow_core\", root, bevel=0.0, smooth=False, outline=False)\n\n # Barrel cooling shroud clamps & muzzle brake collar\n for i, cy in enumerate((-3.55, -4.65, -5.65)):\n clamp = loft([(cy, octo(0.46, 0.62, 0.10, y=0.76)), (cy - 0.24, octo(0.46, 0.62, 0.10, y=0.76))], axis=\"y\")\n put_pair(f\"barrel_clamp{i}\", clamp, \"frame\" if i < 2 else \"trim\", root, bevel=0.008)\n\n muzzle_brake = loft([(-6.18, octo(0.38, 0.54, 0.09, y=0.76)), (-6.52, octo(0.32, 0.46, 0.08, y=0.76))], axis=\"y\")\n put_pair(\"muzzle_brake\", muzzle_brake, \"frame\", root, bevel=0.008)\n muzzle_glow = cylinder(0.08, -6.54, -6.50, 12, axis=\"y\", at=(0, 0.76))\n put_pair(\"muzzle_glow\", muzzle_glow, \"glow_beam\", root, bevel=0.0, smooth=False, outline=False)\n\n # Low-profile holographic targeting optic (`glow_eye` objective lens)\n optic = aero_loft([\n [(x, 0.42, y + 1.44) for x, y in octo(0.34, 0.36, 0.08)],\n [(x, -1.48, y + 1.44) for x, y in octo(0.38, 0.40, 0.09)],\n ], samples_per_span=2)\n put_pair(\"optic_body\", optic, \"frame\", root, bevel=0.010)\n optic_ring = cylinder(0.18, -1.56, -1.44, 16, axis=\"y\", at=(0, 1.44))\n optic_lens = cylinder(0.14, -1.58, -1.54, 16, axis=\"y\", at=(0, 1.44))\n put_pair(\"optic_bezel\", optic_ring, \"metal\", root, bevel=0.005)\n put_pair(\"optic_lens\", optic_lens, \"glow_eye\", root, bevel=0.0, smooth=False, outline=False)\n\n empty(\"muzzle\", (0, -6.56, 0.76), root, dir=gltf_dir((0, -1, 0)))\n return root\n", "Overwrite": true, "Path": "~/work/sortie/kit/carbon_mech.py" }result, 1 line
Created file.