A mech game prototype, pushed by Gemini 4 Argon
agent (cont.)
+3:45read_file{"Path":"~/work/sortie/kit/lab/board_plate.py"}
input
{ "Path": "~/work/sortie/kit/lab/board_plate.py" }result, 302 lines
Showing lines 1-301 of 301 1: """Harness (line A), plate armour: gothic and Maximilian harness taken seriously (docs/study-atelier.md). 2: 3: Domed pauldrons over three stacked lames and a haute piece at the neck, a pigeon breasted cuirass with 4: a medial ridge under a fluted plackart rising to a point, a fauld and tassets of lames, couters and 5: poleyns with fluted fans, fluted vambraces, ridged cuisses and greaves. Every edge is a rolled rim in 6: gold, the main hems roped. Rich and ornate: the gold carries the value against the wine. 7: 8: Grades by plate count (plates(J, P, g)): the light a fluted dome without lames, a breast without a 9: plackart, one lame per skirt, an arming sleeve and the core block. The medium the board's line knight. 10: The heavy four pauldron lames under a taller haute piece and a besagew, the plackart in two lames, three 11: gorget lames, tassets of four, fluted add-ons over the vambraces, cuisses and greaves, six sabaton lames. 12: """ 13: import math 14: 15: import frame_std 16: from knightkit import Sheet, addon, band, by, cap, curve, flutes, helm, joint_covers, lames, lin, put, put2, rim, rivets, smooth, spline, tent 17: from lib import clip, copy 18: from makers import atelier 19: from makers.atelier import bearing_at, lr 20: from makers.shell import subtract 21: 22: CHEST_C = (0, -.15) 23: CHEST_K = (1.08, 1.0) 24: BREAST_R = [.98, 1.3, 1.5, 1.52, 1.45, 1.3, 1.12] # waist to neck: the pigeon breast is fullest low 25: FRONT = lin(-172, -8, 41) 26: 27: 28: breast_r = curve(BREAST_R) 29: 30: 31: def cuirass(u, z, grow=0.0, z0=12.15, z1=15.05): 32: """A point on the breastplate's surface at plan angle u and height z, grown out by `grow`.""" 33: h = min(max((z - z0) / (z1 - z0), 0.0), 1.0) 34: a = math.radians(u) 35: # the pigeon breast: the front pushed forward, fullest a third of the way up 36: r = breast_r(h) + .18 * math.sin(math.pi * min(h / .75, 1.0)) * max(0.0, -math.sin(a)) ** 3 + grow 37: return (CHEST_C[0] + r * CHEST_K[0] * math.cos(a), CHEST_C[1] + r * CHEST_K[1] * math.sin(a), z) 38: 39: 40: def chest(P, J, g): 41: T, C = J["torso"], J["cockpit"] 42: light, heavy = g == "light", g == "heavy" 43: H = T if light else C # the light's cockpit is the core block behind: its breast does not open 44: z0 = 12.15 45: top = lambda u: 15.05 - .32 * tent(u, -90, 48) - .5 * smooth(abs(u + 90), 58, 80) # a round neck, the armholes cut low 46: ridge = lambda u, v: .17 * tent(u, -90, 16) ** 1.6 * (1 - smooth(v, .88, 1)) # a sharp keel, the planes either side flatter 47: breast = Sheet(lambda u, v: cuirass(u, z0 + (top(u) - z0) * v), FRONT, lin(0, 1, 16), .14, disp=ridge, inside=(0, 0, 13.6)) 48: bm = breast.bm() 49: # the hatch is the medial panel, the ridge down its middle: two seams down the breast, no box 50: hatch = clip(copy(bm), x=(-.7, .7), y=(-60, -.9), z=(12.86, 16)) 51: bm = subtract(bm, frame_std.box(-.73, .73, -3, -.9, 12.82, 16)) 52: P.solid("breast", bm, "main", T, bevel=.012) 53: P.solid("hatch", hatch, "accent", H, bevel=.01) 54: neck = breast.edge("v1", out=.02) 55: rim(P, "breast_rim_l", [p for p in neck if p.x > .76], .075, T, rope=1.0) 56: rim(P, "breast_rim_r", [p for p in neck if p.x < -.76], .075, T, rope=1.0) 57: rim(P, "hatch_rim", [p for p in neck if abs(p.x) < .68], .075, H, rope=1.0) 58: if not light: 59: # the plackart: proud of the lower breast, rising to a point under the hatch, fluted. The castellan's in 60: # two lames, the upper one proud of the lower 61: for i in range(by(g, 0, 1, 2)): 62: pz0 = z0 + .02 if i == 0 else 12.5 63: ptop = (lambda u: 12.62 + .62 * tent(u, -90, 34)) if i == 0 else (lambda u: 13.0 + .66 * tent(u, -90, 30)) 64: grow = .17 + .1 * i 65: plack = Sheet(lambda u, v, ptop=ptop, grow=grow, pz0=pz0: cuirass(u, pz0 + (ptop(u) - pz0) * v, grow), lin(-166 + 10 * i, -14 - 10 * i, 30), 66: lin(0, 1, 7), .16, disp=lambda u, v: .04 * flutes(u, -150, -30, 9, .5) * (1 - smooth(v, .7, 1)), inside=(0, 0, 12.6)) 67: pb = plack.bm() 68: # its middle rides the hatch, so the pod can leave 69: P.solid(f"plackart_mid{i}", clip(copy(pb), x=(-.7, .7)), "main", C, bevel=.012) 70: P.solid(f"plackart{i}", subtract(pb, frame_std.box(-.73, .73, -3, 0, 11, 14.5)), "main", T, bevel=.012) 71: pr = plack.edge("v1", out=.02) 72: rim(P, f"plackart_rim_mid{i}", [p for p in pr if abs(p.x) < .68], .065, C) 73: rim(P, f"plackart_rim_l{i}", [p for p in pr if p.x > .76], .065, T) 74: rim(P, f"plackart_rim_r{i}", [p for p in pr if p.x < -.76], .065, T) 75: bearing_at("chest", (.95, -1.62, 14.2), (0, -1, 0), T, .8) 76: # the backplate either side of the pack 77: back = band((0, .15), 12.2, lambda u: 15.0 - .35 * smooth(u, 55, 80), [1.0, 1.4, 1.55, 1.5, 1.3], lin(14, 82, 10), nv=10, kx=1.04, ky=.92, t=.14) 78: put(P, "backplate", back, "main", T, T) 79: rim(P, "backplate_rim", back.edge("v1", out=.02), .06, T, T, role="main") 80: # the gorget: lames round the neck, one to three 81: for i, (za, zb, ra, rb) in enumerate([(14.82, 15.14, 1.12, .98), (15.06, 15.36, .98, .9), (15.28, 15.56, .9, .84)][:by(g, 1, 2, 3)]): 82: gg = band((0, .05), za, zb, [ra, (ra + rb) / 2 + .03, rb], lin(-170, -10, 24), nv=4, kx=1.05, ky=.98, t=.1) 83: put(P, f"gorget{i}", gg, "main", T) 84: rim(P, f"gorget_rim{i}", gg.edge("v1", out=.01), .05, T, role="trim" if heavy else "main") 85: if heavy: 86: # flank plates over the ribs, fluted 87: fl = band((1.0, -.05), 12.6, 14.3, [.84, .9, .86], lin(-50, 40, 14), nv=6, t=.12, disp=lambda u, v: .035 * flutes(u, -45, 35, 4, .5)) 88: put(P, "flank", fl, "main", T, T) 89: rim(P, "flank_rim", fl.edge("v0", out=.015), .055, T, T, rope=1.0) 90: 91: 92: def waist(P, J, g): 93: W = J["waist"] 94: for i, (za, zb, ra, rb) in enumerate([(12.3, 11.5, .84, .96), (11.75, 11.2, .86, .98)][:by(g, 0, 1, 2)]): 95: s = band((0, -.12), zb, za, [rb, (ra + rb) / 2 + .02, ra], lin(-168, -12, 24), nv=4, kx=1.08, t=.12) 96: put(P, f"fauld_w{i}", s, "main", W) 97: rim(P, f"fauld_w_rim{i}", s.edge("v0", out=.01), .05, W, role="main") 98: 99: 100: def pelvis(P, J, g): 101: Pv = J["pelvis"] 102: heavy = g == "heavy" 103: fl = [(11.24, 10.84, 1.16, 1.3), (10.96, 10.52, 1.28, 1.42), (10.66, 10.24, 1.36, 1.5)] 104: n = by(g, 1, 2, 3) 105: for i, (za, zb, ra, rb) in enumerate(fl[3 - n:] if n < 3 else fl): 106: s = band((0, 0), zb, za, [rb, (ra + rb) / 2 + .03, ra], lin(-172, -8, 28), nv=4, kx=1.06, ky=.84, t=.14) 107: put(P, f"fauld{i}", s, "main", Pv) 108: rim(P, f"fauld_rim{i}", s.edge("v0", out=.01), .055, Pv, role="trim" if i == n - 1 or heavy else "main") 109: P.solid("crotch", atelier.sheet([(-.5, 10.6), (.5, 10.6), (.42, 10.1), (.14, 9.66), (-.14, 9.66), (-.42, 10.1)], 110: [(-1.02, 10.6), (-.38, 10.6), (-.38, 9.66), (-.8, 9.66)], None), "main", Pv) 111: # tassets: lames over each thigh, each overlapping the one below: one, three or four 112: nt = by(g, 1, 3, 4) 113: for i in range(nt): 114: za = 10.66 - .46 * i 115: zb = za - .6 116: r0, r1 = .96 + .05 * i, 1.06 + .06 * i 117: s = band((1.12, -.12), zb, za, lambda u, v, r0=r0, r1=r1: r1 + (r0 - r1) * v + .05 * math.sin(math.pi * v), lin(-162, -28, 20), 118: nv=5, kx=1.0, ky=.98, t=.12) 119: put(P, f"tasset{i}", s, "main", Pv, Pv) 120: rim(P, f"tasset_rim{i}", s.edge("v0", out=.015), .055, Pv, Pv, role="trim" if i == nt - 1 or heavy else "main") 121: if heavy: 122: lames(P, "tasset_side", (1.35, 0), 10.5, 3, .5, .4, 1.16, -.03, lin(-44, 44, 12), Pv, Pv, "main", "trim") 123: for i, (za, zb) in enumerate([(10.95, 10.35), (10.45, 9.8), (9.95, 9.3)][:by(g, 1, 2, 3)]): 124: s = band((0, 0), zb, za, [1.38 + i * .12, 1.3 + i * .1, 1.22 + i * .06], lin(10, 86, 12), nv=4, kx=1.0, ky=.92, t=.14) 125: put(P, f"culet{i}", s, "main", Pv, Pv) 126: rim(P, f"culet_rim{i}", s.edge("v0", out=.01), .05, Pv, Pv, role="main") 127: 128: 129: PC = (2.32, .02) 130: 131: 132: def shoulder(P, J, g): 133: S = lr(J, "shoulder") 134: heavy = g == "heavy" 135: k = by(g, .8, 1.0, 1.06) 136: # the dome: domed from the pad down to a roped hem, fluted from the crown 137: prof = [(.42, 15.16), (.88 * k, 15.06), (1.14 * k, 14.8), (1.27 * k, 14.42 + (1 - k) * .6), (1.32 * k, 14.12 + (1 - k) * 1.0)] 138: sp = spline(prof) 139: dip = lambda u: .3 * max(0.0, math.cos(math.radians(u))) # every lower edge sweeps down outboard 140: 141: def f(u, v): 142: r, z = sp(v) 143: a = math.radians(u) 144: return (PC[0] + r * math.cos(a), PC[1] + r * .92 * math.sin(a), z - dip(u) * v * v) 145: dome = Sheet(f, lin(-142, 142, 44), lin(0, 1, 12), .14, 146: disp=lambda u, v: .06 * flutes(u, -120, 120, 11, .45) * smooth(v, .15, .4) * (1 - smooth(v, .8, .95)), inside=(PC[0], PC[1], 14.0)) 147: put(P, "pauldron", dome, "main", *S) 148: rim(P, "pauldron_rim", dome.edge("v1", out=.02), .08, *S, rope=1.0) 149: P.solid("pauldron_landing", band(PC, 14.96, 15.14, .52, lin(-180, 180, 24), nv=1, t=.5).bm(), "main", *S, bevel=.01) 150: if g == "light": 151: return 152: # lames under it, two or four, their edges sweeping down outboard 153: n = by(g, 0, 2, 4) 154: for i in range(n): 155: za = lambda u, i=i: 14.24 - .36 * i - dip(u) * (1 + .4 * i) 156: zb = lambda u, i=i: 13.7 - .36 * i - dip(u) * (1.4 + .4 * i) 157: s = band(PC, zb, za, [1.42 * k + .06 * i, 1.37 * k + .05 * i, 1.26 * k + .04 * i], lin(-124 + 8 * i, 124 - 8 * i, 30), nv=4, ky=.92, t=.13) 158: put(P, f"pauldron_lame{i}", s, "main", *S) 159: rim(P, f"pauldron_lame_rim{i}", s.edge("v0", out=.015), .065, *S, role="trim" if heavy else "main") 160: # the haute piece: a flange standing up on the inboard edge, framing the helm, taller on the castellan 161: hh = by(g, 0, .22, .5) 162: hp = band(PC, 14.9, lambda u: 15.42 + hh * tent(u, 180, 42) + (hh - .22), [.84, .86, .9], lin(146, 214, 12), nv=5, ky=.92, t=.1) 163: put(P, "haute_piece", hp, "main", *S) 164: rim(P, "haute_piece_rim", hp.edge("v1", out=.01), .055, *S, rope=1.0) 165: if heavy: 166: # a besagew, a fluted rondel before the armpit 167: bes = Sheet(cap((1.7, -1.12, 13.5), (-.3, -1, 0), (.56, .56, .14)), lin(0, 360, 32), lin(0, 86, 6), .1, wrap=True, 168: disp=lambda u, v: .035 * flutes(u, 0, 360, 10, .5) * smooth(v, 20, 50), inside=(1.7, -.7, 13.5)) 169: put(P, "besagew", bes, "accent", *S) 170: rim(P, "besagew_rim", bes.edge("v1", out=.01), .06, *S, rope=1.0, closed=True) 171: P.solid("besagew_boss", rivets([((1.66, -1.28, 13.5), (-.3, -1, 0))], r=.14), "metal", *S, bevel=0) 172: for side, j, sx in (("L", S[0], 1), ("R", S[1], -1)): 173: bearing_at(f"shoulder.{side}", ((PC[0] + 1.18) * sx, 0, 14.4), (sx, 0, -.3), j, .5) 174: 175: 176: def upperarm(P, J, g): 177: UA = lr(J, "upperarm") 178: if g == "light": 179: return # the arming sleeve (joint_covers) under the dome 180: s = band((2.45, 0), 12.4, 13.5, [.56, .54, .5], lin(-150, 150, 26), nv=5, t=.14) 181: put(P, "rerebrace", s, "main", *UA) 182: rim(P, "rerebrace_rim", s.edge("v0", out=.01), .05, *UA, role="main") 183: if g == "heavy": 184: lames(P, "rerebrace_lame", (2.45, 0), 13.55, 2, .36, .3, .64, -.03, lin(-150, 150, 26), *UA, "main", "trim") 185: 186: 187: def forearm(P, J, g): 188: FA = lr(J, "forearm") 189: heavy = g == "heavy" 190: fl = lambda u, v: .032 * (flutes(u, -158, -42, 4, .5) + flutes(u, 42, 158, 4, .5)) * smooth(v, .1, .3) * (1 - smooth(v, .85, 1)) 191: s = band((2.5, 0), 9.86, 11.5, [.58, .52, .46], lin(-165, 165, 40), nv=8, kx=.92, t=.14, disp=None if g == "light" else fl) 192: put(P, "vambrace", s, "main", *FA) 193: rim(P, "vambrace_rim", s.edge("v0", out=.015), .055, *FA, rope=1.0) 194: # the couter: a dome over the back of the elbow, a fluted fan outboard from the medium up 195: cop = Sheet(cap((2.5, .18, 11.95), (.35, 1, 0), (.64, .6, .5)), lin(0, 360, 24), lin(0, 84, 8), .12, wrap=True, inside=(2.5, 0, 11.95)) 196: put(P, "couter", cop, "main", *FA) 197: rim(P, "couter_rim", cop.edge("v1", out=.01), .05, *FA, closed=True, role="main") 198: if g == "light": 199: return 200: fr = by(g, 0, 1.0, 1.25) 201: fan = Sheet(cap((2.9, .12, 11.95), (1, .25, 0), (.72 * fr, .66 * fr, .14)), lin(0, 360, 36), lin(0, 86, 7), .08, wrap=True, 202: disp=lambda u, v: .045 * flutes(u, 0, 360, 12, .5) * smooth(v, 20, 50), inside=(2.6, .12, 11.95)) 203: put(P, "couter_fan", fan, "main", *FA) 204: rim(P, "couter_fan_rim", fan.edge("v1", out=.01), .05, *FA, rope=1.0, closed=True) 205: if heavy: 206: addon(P, "vambrace_plate", (2.5, 0), lambda v: .64 - .06 * v, lin(-150, -50, 12), 10.0, 11.3, .3, *FA, "main", kx=.92, 207: disp=lambda u, v: .03 * flutes(u, -145, -55, 4, .5), rope=1.0) 208: cuff = band((2.5, 0), 9.5, 9.95, [.64, .6], lin(-165, 165, 30), nv=2, kx=.92, t=.1) 209: put(P, "vambrace_cuff", cuff, "main", *FA) 210: rim(P, "vambrace_cuff_rim", cuff.edge("v0", out=.01), .05, *FA) 211: 212: 213: def thigh(P, J, g): 214: TH = lr(J, "thigh") 215: s = band((1.16, -.05), 6.75, 9.7, [.72, .78, .84, .86], lin(-162, -18, 24), nv=10, t=.2, disp=lambda u, v: .06 * tent(u, -90, 12)) 216: put(P, "cuisse", s, "main", *TH) 217: rim(P, "cuisse_rim", s.edge("v0", out=.015), .06, *TH) 218: if g == "light": 219: return 220: b = band((1.16, -.05), 7.0, 9.5, [.72, .8, .84], lin(28, 152, 16), nv=6, t=.18) 221: put(P, "cuisse_back", b, "main", *TH) 222: if g == "heavy": 223: addon(P, "cuisse_plate", (1.16, -.05), lambda v: .98 + .04 * v, lin(-140, -40, 14), 7.5, 9.45, .6, *TH, "main", 224: disp=lambda u, v: .035 * flutes(u, -135, -45, 5, .5), rope=1.0) 225: lames(P, "cuisse_lame", (1.16, -.06), 7.3, 2, .34, .3, .8, -.02, lin(-158, -22, 18), *TH, "main", "trim") 226: 227: 228: GC = (1.2, .02) 229: 230: 231: def shin(P, J, g): 232: SH = lr(J, "shin") 233: heavy = g == "heavy" 234: # the poleyn: a domed cop over the knee; from the medium up lames above and below and fluted fans 235: cop = Sheet(cap((1.2, -.36, 6.12), (0, -1, 0), (.6, .62, .34)), lin(0, 360, 24), lin(0, 86, 8), .14, wrap=True, inside=(1.2, 0, 6.12)) 236: put(P, "poleyn", cop, "main", *SH) 237: rim(P, "poleyn_rim", cop.edge("v1", out=.01), .06, *SH, rope=1.0, closed=True) 238: if g != "light": 239: fk = by(g, 0, 1.0, 1.2) 240: for nm, c, ax, rr in (("o", (1.86, -.18, 6.1), (1, -.2, 0), (.66 * fk, .6 * fk, .12)), ("i", (.62, -.2, 6.1), (-1, -.2, 0), (.42 * fk, .4 * fk, .08))): 241: fan = Sheet(cap(c, ax, rr), lin(0, 360, 32), lin(0, 86, 6), .07, wrap=True, 242: disp=lambda u, v: .04 * flutes(u, 0, 360, 11, .5) * smooth(v, 20, 50), inside=(1.2, -.2, 6.1)) 243: put(P, f"poleyn_fan_{nm}", fan, "main", *SH) 244: rim(P, f"poleyn_fan_rim_{nm}", fan.edge("v1", out=.01), .045, *SH, closed=True, role="trim" if heavy else "main") 245: ls = [(6.95, 6.6, .66, .72), (5.62, 5.3, .7, .66), (7.25, 6.9, .64, .7), (5.36, 5.04, .72, .68)][:by(g, 0, 2, 4)] 246: for i, (za, zb, ra, rb) in enumerate(ls): 247: s = band((1.2, -.16), zb, za, [rb, ra], lin(-158, -22, 18), nv=3, ky=1.05, t=.12) 248: put(P, f"poleyn_lame{i}", s, "main", *SH) 249: rim(P, f"poleyn_lame_rim{i}", s.edge("v0", out=.01), .045, *SH, role="trim" if heavy else "main") 250: # the greave: a ridge down the shin, the bell over the ankle; the calf plate swells behind 251: gr = band(GC, 1.75, 5.5, [1.06, .86, .7, .66, .68, .62, .55], lin(-174, -6, 32), nv=14, ky=1.12, t=.16, 252: disp=lambda u, v: .1 * tent(u, -90, 14) * (1 - smooth(v, .9, 1))) 253: put(P, "greave", gr, "main", *SH) 254: rim(P, "greave_rim", gr.edge("v0", out=.02), .07, *SH, rope=1.0) 255: calf = band(GC, 1.95, 5.35, [1.0, .82, .66, .74, .82, .66], by(g, lin(40, 140, 14), lin(12, 168, 20), lin(12, 168, 20)), nv=12, ky=1.12, 256: t=by(g, .1, .14, .14)) 257: put(P, "greave_calf", calf, "main", *SH) 258: rim(P, "greave_calf_rim", calf.edge("v0", out=.02), .06, *SH, role="main") 259: if heavy: 260: # broad reinforcing greaves: a front and a calf plate over the base, ridged, widening the lower leg 261: addon(P, "greave_plate", GC, lambda v: [1.18, 1.0, .88, .86, .88][min(int(v * 4.999), 4)] + .04, lin(-160, -20, 18), 2.3, 5.2, .5, *SH, 262: "main", ky=1.12, disp=lambda u, v: .12 * tent(u, -90, 20), rope=1.0) 263: addon(P, "calf_plate", GC, lambda v: [1.1, .94, .8, .9, .94][min(int(v * 4.999), 4)] + .04, lin(30, 150, 14), 2.4, 5.0, 0.0, *SH, "main", 264: ky=1.12, studs=2) 265: for side, j, sx in (("L", SH[0], 1), ("R", SH[1], -1)): 266: bearing_at(f"shin.{side}", (1.2 * sx, GC[1] - .8, 4.0), (0, -1, 0), j, .4) 267: 268: 269: def back(P, J, g): 270: """A fluted shell over the pack, ivory, rimmed in gold. The castellan's is broader, its tanks plated over.""" 271: from knightkit import back_layers 272: if g == "light": 273: return 274: B = J["backpack"] 275: k = by(g, 0, 0.0, .45) 276: s = band((0, 1.5), 12.8 - k * .3, lambda u: 14.5 + .2 * tent(u, 90, 40), [1.2 + k, 1.26 + k, 1.2 + k], lin(52, 128, 20), nv=8, kx=.88, t=.12, 277: disp=lambda u, v: .045 * flutes(u, 60, 120, 6, .5)) 278: put(P, "pack_shell", s, "accent", B) 279: rim(P, "pack_shell_rim", s.edge("u0", out=.02)[::-1] + s.edge("v0", out=.02) + s.edge("u1", out=.02), .06, B, rope=1.0 if k else 0.0) 280: back_layers(P, J, g, "main") 281: 282: 283: def plates(J, P, g="medium"): 284: from knightkit import head_layers, sabaton, shoulder_root 285: helm(P, J, g, lambda P, J: head_layers(P, J, g)) 286: chest(P, J, g) 287: waist(P, J, g) 288: pelvis(P, J, g) 289: shoulder(P, J, g) 290: shoulder_root(P, J) 291: upperarm(P, J, g) 292: forearm(P, J, g) 293: thigh(P, J, g) 294: shin(P, J, g) 295: sab = by(g, ((.55, -1.2), (-1.0, -3.3)), ((.55, -.35), (-.2, -1.1), (-.95, -1.85), (-1.7, -3.3)), 296: ((.55, -.1), (.05, -.7), (-.55, -1.3), (-1.15, -1.9), (-1.75, -2.5), (-2.35, -3.3))) 297: sabaton(P, J, lames=sab, point=1.0, rims="front", rope=0.0) 298: atelier.backpack(P, J, g) 299: back(P, J, g) 300: atelier.binder(P, J, g) 301: joint_covers(P, J, g, style="quilt", fauld="mail")read_file{"EndLine":250,"Path":"~/work/sortie/kit/makers/atelier.py","StartLine":1}
input
{ "EndLine": 250, "Path": "~/work/sortie/kit/makers/atelier.py", "StartLine": 1 }result, 251 lines
Showing lines 1-250 of 604 1: """The houses' atelier plates: the captive maker of the houses, knightly frames built to order. 2: 3: Motif (docs/visual-language.md, docs/study-atelier.md), held on every plate and grade: 4: flared sheets every plate is a sheet bent round one axis, a cylinder or a cone, never a box: round 5: in plan, straight lines up and down. Limbs, skirts and pauldrons flare toward their 6: free edge (the greave into a bell over the ankle, the vambrace to the wrist, the 7: tassets and the pauldrons to their hems). The chest is the one solid, round in plan. 8: flared pauldrons a flat roof carrying the mount pad over a cone that flares down and out to a gold 9: hem, a flange swept up along its outboard edge 10: crest fin one tall blade on the helm's centre line, raked back 11: tall, narrow a small helm sunk between the pauldron flanges, a pinched waist, long greaves, set by 12: `stance` (atelier builds only) 13: Everything else stays plain. Grades are thickness, size and wrap of the same sheets: 14: light the knight: thin sheets, wide gaps, small pauldrons, the longest crest, a rear core block 15: cockpit that ejects whole (on a `core` node), harkens under the chest corners, no hatch 16: medium the line knight: fuller sheets, the chest hatch over the frame socket, a round backpack 17: heavy the castellan: sheets that wrap, wide pauldrons with a second lame, a high gorget, knee fans, 18: a tabard, a broad pack shroud, a kite shield on the left forearm pad with a lance racked 19: along its front edge 20: Heel spinners (a wheel under a curved fender) on every grade. 21: 22: Livery roles, colour blocked: main for most sheets, accent in bounded fields (the crest, a chevron 23: breastplate and the hatch, the core's or the pack's rear panel, a long panel down each greave, the 24: heavy's tabard and shield pale), trim on the pauldron hems and the crest's edge. Bearing anchors in 25: the standard places (left shoulder, chest left, right shoulder, both greaves), plus the back panel 26: and the heavy's tabard and shield. 27: 28: plates(J, "medium") one grade everywhere 29: plates(J, {"chest": "heavy", "default": "light"}) grade per segment 30: The light chest has no hatch and goes with the light backpack (the core block): a light chest under a 31: medium or heavy backpack leaves no cockpit. 32: """ 33: import math 34: 35: import bmesh 36: import bpy 37: from mathutils import Matrix, Vector 38: 39: import frame_std 40: from lib import circle, clip, copy, cylinder, empty, loft, merge, nozzle, octo, prism, rot, solid, transform, two_view 41: from makers.shell import Plates, inset, subtract 42: from mech import gltf_dir, nozzle_pair, place 43: 44: CHAMFER = .03 45: ROOF = frame_std.ROOF 46: SEGMENTS = ("head", "chest", "waist", "pelvis", "shoulder", "upperarm", "forearm", "thigh", "shin", "foot", "backpack", "binder") 47: 48: 49: def by(g, light, medium, heavy): 50: return {"light": light, "medium": medium, "heavy": heavy}[g] 51: 52: 53: def lr(J, part): 54: return J[part, "L"], J[part, "R"] 55: 56: 57: # ---- outlines and sheets ---------------------------------------------------------------------------------- 58: def bez(p0, c, p1, n=6): 59: """Points along a quadratic curve from p0 toward p1 bent toward c: p0 included, p1 not.""" 60: out = [] 61: for i in range(n): 62: t = i / n 63: out.append(((1 - t) ** 2 * p0[0] + 2 * (1 - t) * t * c[0] + t * t * p1[0], (1 - t) ** 2 * p0[1] + 2 * (1 - t) * t * c[1] + t * t * p1[1])) 64: return out 65: 66: 67: def angles(a0, a1, step=12): 68: n = max(2, int(abs(a1 - a0) / step)) 69: return [a0 + (a1 - a0) * i / n for i in range(n + 1)] 70: 71: 72: def ring(c, r, a0, a1, t=None, step=12): 73: """A plan outline round a vertical axis at c: the arc of an ellipse with radii r from angle a0 to a1 74: (degrees, 0 is +x, -90 the front). With t, closed by the same arc t further in: a sheet of even 75: thickness. Without, closed by its chord.""" 76: a = [math.radians(x) for x in angles(a0, a1, step)] 77: out = [(c[0] + r[0] * math.cos(x), c[1] + r[1] * math.sin(x)) for x in a] 78: if t is None: 79: return out 80: return out + [(c[0] + (r[0] - t) * math.cos(x), c[1] + (r[1] - t) * math.sin(x)) for x in reversed(a)] 81: 82: 83: def flare(c, rings, a0, a1, t, step=12): 84: """A sheet t thick round a vertical axis through c, from angle a0 to a1, lofted through rings 85: [(z, rx, ry)]: a cylinder or a cone, flaring where the radii grow. A ring's z may be a function of 86: the angle (degrees), for a pointed or swept edge. A closed solid.""" 87: a = angles(a0, a1, step) 88: bm = bmesh.new() 89: loops = [] 90: for z, rx, ry in rings: 91: loop = [] 92: for d, r0, r1 in [(x, rx, ry) for x in a] + [(x, rx - t, ry - t) for x in reversed(a)]: 93: q = math.radians(d) 94: zz = z(d) if callable(z) else z 95: loop.append(bm.verts.new((c[0] + r0 * math.cos(q), c[1] + r1 * math.sin(q), zz))) 96: loops.append(loop) 97: n = len(loops[0]) 98: for p, q in zip(loops, loops[1:]): 99: for i in range(n): 100: j = (i + 1) % n 101: bm.faces.new((p[i], p[j], q[j], q[i])) 102: bm.faces.new(list(reversed(loops[0]))) 103: bm.faces.new(loops[-1]) 104: bmesh.ops.recalc_face_normals(bm, faces=bm.faces) 105: return bm 106: 107: 108: def halfplane(poly, a, b): 109: """The part of a convex polygon left of the line a->b (Sutherland-Hodgman, one edge).""" 110: side = lambda p: (b[0] - a[0]) * (p[1] - a[1]) - (b[1] - a[1]) * (p[0] - a[0]) 111: out = [] 112: for i, p in enumerate(poly): 113: q = poly[(i + 1) % len(poly)] 114: sp, sq = side(p), side(q) 115: if sp >= 0: 116: out.append(p) 117: if (sp >= 0) != (sq >= 0): 118: t = sp / (sp - sq) 119: out.append((p[0] + (q[0] - p[0]) * t, p[1] + (q[1] - p[1]) * t)) 120: return out 121: 122: 123: def rect(x0, x1, z0, z1): 124: return [(x0, z0), (x1, z0), (x1, z1), (x0, z1)] 125: 126: 127: def sheet(front_o, side_o, plan_o): 128: """A solid: the front, side and plan outlines intersected.""" 129: return two_view(front_o, side_o, plan_o) 130: 131: 132: def bearing_at(name, at, normal, parent, size): 133: n = Vector(normal).normalized() 134: return empty(f"bearing.{name}", Vector(at) + n * .02, parent, dir=gltf_dir(-n), size=size) 135: 136: 137: GROW = {"light": -.05, "medium": 0.0, "heavy": .1} # how far a grade's limb sheets stand out from the medium's 138: 139: 140: # ---- head ------------------------------------------------------------------------------------------------- 141: # The helm is drawn round the frame's head block, then everything on the head joint (the block too) 142: # is seated lower, so the chin sits on the pauldron roofs between the flanges. 143: HEAD_DROP = .72 144: 145: 146: def helm_plan(k=0.0): 147: """The helm in plan: a sharp prow at the front, straight cheeks, a round back.""" 148: w = .5 + k 149: left = [(0, -.86 - k), (.26 + k, -.64 - k), (w, -.3)] + bez((w, .36), (w - .02, .68 + k), (0, .7 + k)) 150: right = [(-x, y) for x, y in reversed(left[1:])] 151: return left + [(0, .7 + k)] + right 152: 153: 154: def head(P, J, g): 155: H = J["head"] 156: _head(P, J, g) 157: m = Matrix.Translation((0, 0, -HEAD_DROP)) 158: for o in H.children: 159: if o.type == "MESH": 160: for v in o.data.vertices: 161: v.co = m @ v.co 162: 163: 164: def _head(P, J, g): 165: H = J["head"] 166: k = by(g, -.03, 0.0, .03) 167: hp = helm_plan(k) 168: w = .5 + k 169: # the crown over a jutting brow, the visor and the faceplate under it, the nape guard behind: one 170: # prow in plan, so the eye slit runs in a V 171: vee = lambda z, d=0.0: [(-w - d, z + .12), (0, z), (w + d, z + .12)] # the brow and the visor run in a shallow V 172: P.solid("head_helmet", sheet(vee(16.38, .02) + [(w, 16.9), (.3, 17.2), (-.3, 17.2), (-w, 16.9)], 173: [(-1.08, 16.4), (.7, 16.4), (.7, 16.9), (.45, 17.2), (-.35, 17.2), (-1.0, 16.72)], inset(hp, -.05)), "main", H) 174: P.solid("head_visor", sheet(vee(16.17) + list(reversed(vee(16.4))), rect(-1.2, -.1, 16.1, 16.6), inset(hp, .08)), "visor", H, bevel=.01) 175: solid(f"{P.n}_head_slit", sheet(vee(16.25) + list(reversed(vee(16.33))), rect(-1.2, -.24, 16.1, 16.6), inset(hp, .06)), "glow_eye", H, 176: outline=False) 177: face = sheet(list(reversed(vee(16.19))) + [(-w + .1, 16.0), (-.16, 15.78), (.16, 15.78), (w - .1, 16.0)], 178: [(-.95, 16.32), (-.88, 15.78), (.1, 15.78), (.1, 16.32)], hp) 179: # a breathing slot down the prow, dark inside 180: face = subtract(face, frame_std.box(-.035, .035, -1.2, -.66, 15.88, 16.18)) 181: P.solid("head_face", face, "main", H) 182: P.solid("head_slot", frame_std.box(-.04, .04, -.74, -.64, 15.88, 16.18), "joint", H, bevel=.005) 183: flare_ = by(g, .1, .14, .2) 184: P.solid("head_nape", sheet(rect(-w - .02, w + .02, 15.78, 16.47), [(.05, 16.47), (.72, 16.47), (.72 + flare_, 15.78), (.05, 15.78)], 185: inset(hp, -.04 - flare_)), "main", H) 186: P.solid("head_ear", cylinder(.12, w - .02, w + .09, 12, axis="x", at=(.0, 16.4)), "frame", H, H, bevel=.01) 187: # the crest fin: one blade on the centre line from the brow, raked back, its leading edge in trim. 188: # The light's sweeps furthest back, the heavy's stands tallest and runs down the nape 189: c = by(g, -.1, 0.0, .25) 190: lead = [(-.8, 16.95), (-.52, 17.4 + c * .4), (-.08, 17.9 + c), (.26, 18.1 + c)] 191: tail = [(.48, 18.0 + c), (.6, 17.5 + c * .5)] 192: if g == "light": 193: lead = [(-.8, 16.95), (-.45, 17.32), (.1, 17.72), (.8, 17.96)] 194: tail = [(1.2, 17.9), (1.0, 17.6), (.62, 17.2)] 195: tail += [(.82, 17.0), (.86, 16.3), (.66, 16.4), (.6, 16.95)] if g == "heavy" else [(.66, 17.0), (.6, 16.95)] 196: t = by(g, .055, .065, .08) 197: P.solid("head_crest", sheet(rect(-t, t, 16.2, 18.6), lead + tail, None), "accent", H, bevel=.015) 198: P.solid("head_crest_root", sheet(rect(-t - .06, t + .06, 16.9, 17.32), [(-.82, 16.9), (-.5, 17.32), (.5, 17.32), (.66, 16.9)], None), "main", H) 199: edge = [(y - .06, z + .06) for y, z in lead] + [(y + .06, z - .07) for y, z in reversed(lead)] 200: solid(f"{P.n}_head_crest_edge", sheet(rect(-t - .014, t + .014, 16.2, 18.6), edge, None), "trim", H, bevel=.008) 201: 202: 203: # ---- torso ------------------------------------------------------------------------------------------------ 204: CHEVRON = (13.3, .32) # the breastplate's accent field: above a V with its point at z on the centre line, rising per metre out 205: 206: 207: def chest(P, J, g): 208: """A breastplate round in plan, narrow at the waist and flaring to the shoulders. Above a chevron it 209: is the accent field, the hatch with it. Light covers the socket with one plate (its cockpit is the 210: core block behind), medium and heavy carry the hatch on the cockpit joint so it leaves with the pod.""" 211: T, C = J["torso"], J["cockpit"] 212: k = by(g, -.06, 0.0, .1) 213: bf = [(-.9 - k, 12.5), (.9 + k, 12.5), (1.46 + k, 14.2), (1.46 + k, 14.75), (1.3 + k, 15.0), (-1.3 - k, 15.0), (-1.46 - k, 14.75), 214: (-1.46 - k, 14.2)] 215: back = by(g, -.6, -.3, -.1) 216: bs = [(-1.25, 12.5), (-2.1, 13.3), (-2.1, 14.7), (-1.95, 15.0), (back, 15.0), (back, 12.5)] 217: r = (1.5 + k, 1.1 + k) 218: plan = ring((0, -.5), r, 180, 360, t=.16) if g == "light" else ring((0, -.5), r, 165 - k * 80, 375 + k * 80) 219: z0, s = CHEVRON 220: hi_f = halfplane(halfplane(bf, (-3, z0 + 3 * s), (0, z0)), (0, z0), (3, z0 + 3 * s)) 221: hi = sheet(hi_f, bs, plan) 222: vee = [(0, z0 - .08), (4, z0 - .08 + 4 * s), (4, 20), (-4, 20), (-4, z0 - .08 + 4 * s)] 223: lo = subtract(sheet(bf, bs, plan), prism(vee, -4, 4, "xz")) 224: if g != "light": 225: hatch = sheet([(-.48, 12.98), (.48, 12.98), (.6, 13.12), (.6, 14.36), (-.6, 14.36), (-.6, 13.12)], bs, plan) 226: hatch = clip(hatch, y=(-60, -1.0)) 227: hole = lambda: frame_std.box(-.66, .66, -3, 0, 12.92, 14.42) 228: hi, lo = subtract(hi, hole()), subtract(lo, hole()) 229: P.solid("hatch", hatch, "accent", C) 230: P.solid("hatch_well", frame_std.box(-.7, .7, -1.3, -.98, 12.94, 14.4), "joint", T, bevel=.01) 231: solid(f"{P.n}_hatch_handle", frame_std.box(-.16, .16, -1.72, -1.6, 13.5, 13.58), "frame", C, .01) 232: P.solid("chest_hi", hi, "accent", T) 233: P.solid("chest_lo", lo, "main", T) 234: bearing_at("chest", (.95, -.5 - r[1] * math.sqrt(max(0, 1 - (.95 / r[0]) ** 2)), 14.35), (0, -1, 0), T, .9) 235: # the gorget round the neck, rising to the chin on the heavy grade 236: top = by(g, 15.2, 15.3, 15.62) 237: P.solid("gorget", flare((0, .05), [(14.92, 1.1, 1.04), (top, 1.0, .96)], 195, 345, by(g, .12, .16, .2)), "main", T) 238: P.solid("belly", flare((0, -.36), [(11.95, .86 + k, .78), (12.52, 1.0 + k, .9)], 185, 355, by(g, .12, .2, .26)), "main", T) 239: if g != "light": 240: # back plates either side of the backpack, round in plan 241: P.solid("chest_back", flare((0, .35), [(13.0, 1.62 + k, .98), (14.95, 1.66 + k, 1.02)], 12, 80, by(g, 0, .22, .3)), "main", T, T) 242: if g == "heavy": 243: # side plates over the ribs, the reactor vents in them 244: P.solid("chest_side", sheet(rect(1.3, 1.72, 12.7, 14.4), [(-.7, 12.7), (.7, 12.7), (.78, 14.4), (-.78, 14.4)], 245: ring((.9, 0), (.84, .86), -70, 70)), "main", T, T) 246: slats = merge(*[prism([(-.4, z), (.4, z), (.4, z + .08), (-.4, z + .08)], 1.7, 1.78, "yz") for z in (13.1, 13.3, 13.5, 13.7)]) 247: P.solid("chest_vent", slats, "frame", T, T, bevel=.008) 248: if g == "light": 249: harkens(P, J) 250:read_file{"EndLine":604,"Path":"~/work/sortie/kit/makers/atelier.py","StartLine":251}
input
{ "EndLine": 604, "Path": "~/work/sortie/kit/makers/atelier.py", "StartLine": 251 }result, 355 lines
Showing lines 251-604 of 604 251: 252: def harkens(P, J): 253: """Harken launchers under the chest corners, muzzles forward and a little out: a pod, a reel showing 254: outboard, a clawed anchor in the muzzle. harken.L/R sit at the muzzles.""" 255: T = J["torso"] 256: x, y, z = 1.36, -1.28, 12.92 257: d = Vector((.3, -1, 0)).normalized() 258: pod = loft([(0, circle(.24, 12)), (-.9, circle(.26, 12)), (-1.0, circle(.22, 12))]) 259: P.solid("harken_pod", place(pod, Vector((x, y, z)) - d, d), "main", T, T) 260: P.solid("harken_reel", cylinder(.2, x + .14, x + .3, 14, axis="x", at=(-.62, z)), "joint", T, T, bevel=.01) 261: P.solid("harken_adapter", frame_std.box(1.0, 1.3, -.95, -.3, z - .12, z + .12), "frame", T, T, bevel=.015) 262: for s, sx in (("L", 1), ("R", -1)): 263: ds = Vector((d.x * sx, d.y, 0)) 264: p = Vector((x * sx, y, z)) + ds * .06 265: j = empty(f"harken.{s}", p, T, dir=gltf_dir(ds)) 266: solid(f"{P.n}_harken_ring.{s}", place(loft([(0, circle(.2, 14)), (-.07, circle(.18, 14))]), p, ds), "frame", j) 267: solid(f"{P.n}_harken_spike.{s}", place(loft([(0, circle(.1, 8)), (-.14, circle(.11, 8)), (-.42, circle(.012, 8))]), p, ds), "metal", j) 268: 269: 270: def waist(P, J, g): 271: """A pinched abdomen sheet flaring up to the chest, the frame's rams showing either side. Heavy 272: closes the back too.""" 273: W = J["waist"] 274: k = by(g, -.04, 0.0, .17) 275: rings = [(11.2, .72 + k * .9, .62 + k * .3), (11.95, .86 + k, .7 + k * .3)] 276: P.solid("waist_front", flare((0, -.12), rings, 185, 355, by(g, .12, .2, .26)), "main", W) 277: if g == "heavy": 278: P.solid("waist_back", flare((0, .12), rings, 20, 160, .2), "main", W) 279: 280: 281: def pelvis(P, J, g): 282: """A fauld round the front of the belt, a pointed crotch plate, long front tassets flaring round the 283: thighs to pointed hems, side tassets under the hip pads, a culet behind in one or two lames. The 284: heavy hangs a tabard between the tassets.""" 285: Pv = J["pelvis"] 286: P.solid("fauld", flare((0, 0), [(10.55, 1.42, 1.06), (11.08, 1.32, 1.0)], 185, 355, by(g, .14, .22, .28)), "main", Pv) 287: P.solid("crotch", sheet([(-.5, 10.6), (.5, 10.6), (.42, 10.1), (.14, 9.66), (-.14, 9.66), (-.42, 10.1)], 288: [(-1.02, 10.6), (-.38, 10.6), (-.38, 9.66), (-.8, 9.66)], None), "main", Pv) 289: bot = by(g, 9.45, 9.15, 8.95) 290: G = GROW[g] 291: hem = lambda a: bot + .42 * min(1.0, abs(a - 268) / 62) # pointed at the front of the thigh 292: P.solid("tasset", flare((1.12, -.1), [(10.78, .86 + G, .92 + G), (hem, 1.12 + G, 1.12 + G)], 200, 330, by(g, .1, .16, .22)), "main", Pv, Pv) 293: P.solid("tasset_hinge", frame_std.box(1.82, 2.12, -.22, .22, 10.42, 10.6), "frame", Pv, Pv, bevel=.012) 294: zs = by(g, 9.45, 9.25, 9.0) 295: P.solid("tasset_side", flare((1.32, 0), [(10.5, .78, .82), (zs, 1.2 + G, .98 + G)], -62, 62, by(g, .1, .14, .2)), "main", Pv, Pv) 296: lames = by(g, [(10.95, 10.05)], [(10.95, 10.2), (10.32, 9.62)], [(10.95, 10.1), (10.22, 8.75)]) 297: for i, (za, zb) in enumerate(lames): 298: a = (8, 88) if g == "heavy" and i else (12, 86) 299: P.solid(f"culet{i}", flare((0, 0), [(za, 1.2 + i * .06, 1.08 + i * .06), (zb, 1.34 + i * .14, 1.24 + i * .14)], *a, by(g, .12, .16, .22)), 300: "main", Pv, Pv) 301: if g == "heavy": 302: tab = lambda a: 8.55 + .3 * min(1.0, abs(a - 270) / 22) 303: P.solid("tabard", flare((0, -.3), [(10.6, .9, .98), (tab, 1.0, 1.04)], 248, 292, .1), "accent", Pv) 304: bearing_at("tabard", (0, -1.36, 9.7), (0, -1, 0), Pv, .6) 305: 306: 307: # ---- arms ------------------------------------------------------------------------------------------------- 308: PAULDRON_C = (2.36, 0.0) 309: # per grade: the cone's radii at the roof, at the hem, the hem's height, the flange's rise, thickness 310: PAULDRON = {"light": dict(top=(.66, .76), hem=(.84, .86), zf=14.12, rise=.36, t=.1), 311: "medium": dict(top=(.76, .84), hem=(1.24, 1.02), zf=13.58, rise=.52, t=.14), 312: "heavy": dict(top=(.8, .88), hem=(1.44, 1.14), zf=13.36, rise=.66, t=.18)} 313: 314: 315: def shoulder(P, J, g): 316: """The pauldron: a flat roof at the pad height on every grade, a cone flaring from it down and out to 317: a gold hem, a flange swept up along the outboard edge of the roof. The heavy hangs a second lame 318: under the hem. A root cover fills the step from the chest.""" 319: S = lr(J, "shoulder") 320: p = PAULDRON[g] 321: c, a = PAULDRON_C, 125 322: (rx0, ry0), (rx1, ry1), zf, t = p["top"], p["hem"], p["zf"], p["t"] 323: P.solid("pauldron", flare(c, [(ROOF - .02, rx0, ry0), (zf, rx1, ry1)], -a, a, t), "main", *S) 324: P.solid("pauldron_roof", loft([(ROOF - .24, ring(c, (rx0 + .03, ry0 + .03), -a, a)), (ROOF, ring(c, (rx0 + .03, ry0 + .03), -a, a))]), "main", *S) 325: # the flange: rising from the roof's edge and leaning out, highest at the outboard point 326: rise = p["rise"] 327: top = lambda d: ROOF + rise * (1 - .85 * (d / 72) ** 2) 328: P.solid("pauldron_flange", flare(c, [(ROOF - .2, rx0 + .02, ry0 + .02), (top, rx0 + .18, ry0 + .12)], -72, 72, .1), "main", *S) 329: rz = lambda z, d: (rx0 + (rx1 - rx0) * (ROOF - z) / (ROOF - zf) + d, ry0 + (ry1 - ry0) * (ROOF - z) / (ROOF - zf) + d) 330: P.solid("pauldron_hem", flare(c, [(zf + .2, *rz(zf + .2, .07)), (zf - .03, *rz(zf - .03, .07))], -a, a, t + .12), "trim", *S, bevel=.012) 331: if g == "heavy": 332: P.solid("pauldron_lame", flare(c, [(zf + .2, rx1 - .02, ry1 - .02), (zf - .5, rx1 + .2, ry1 + .1)], -112, 112, .14), "main", *S) 333: P.solid("shoulder_bracket", frame_std.box(2.8, 2.96, -.14, .14, 14.3, 14.56), "frame", *S, bevel=.02) 334: P.solid("shoulder_root", sheet(rect(1.6, 2.0, 14.0, 15.05), [(-.8, 14.0), (.25, 14.0), (.25, 15.05), (-.5, 15.05), (-.8, 14.8)], 335: ring((1.8, -.1), (.3, .72), 180, 360)), "main", *S) 336: xb = c[0] + (rx0 + rx1) / 2 337: for side, j, sx in (("L", S[0], 1), ("R", S[1], -1)): 338: bearing_at(f"shoulder.{side}", (xb * sx, 0, (ROOF + zf) / 2), (sx, 0, -(rx1 - rx0) / (ROOF - zf)), j, .5) 339: 340: 341: def upperarm(P, J, g): 342: """A sleeve round the bone, open toward the body, widening a little to the elbow: light a front and a 343: back sheet.""" 344: UA = lr(J, "upperarm") 345: G = GROW[g] 346: rings = [(13.72, .5 + G, .5 + G), (12.5, .56 + G, .55 + G)] 347: if g == "light": 348: P.solid("upperarm", flare((2.45, 0), rings, -75, 70, .12), "main", *UA) 349: P.solid("upperarm_back", flare((2.45, 0), rings, 100, 150, .12), "main", *UA) 350: else: 351: P.solid("upperarm", flare((2.45, 0), rings, -by(g, 0, 150, 165), by(g, 0, 150, 165), by(g, 0, .2, .3)), "main", *UA) 352: 353: 354: def forearm(P, J, g): 355: """A vambrace flaring to the wrist, the weapon pad proud of its outer face, and a pointed couter 356: over the back of the elbow.""" 357: FA = lr(J, "forearm") 358: G = GROW[g] 359: rx = lambda r: min(r + G, .53) if G > 0 else r + G # the outer face stays inside the pad 360: rings = [(11.55, rx(.44), .52 + G), (10.9, rx(.5), .58 + G), (9.82, rx(.56) + (.06 if G > 0 else 0), .66 + G)] 361: if g == "light": 362: P.solid("forearm", flare((2.5, 0), rings, -80, 80, .12), "main", *FA) 363: P.solid("forearm_back", flare((2.5, 0), rings, 105, 160, .12), "main", *FA) 364: else: 365: P.solid("forearm", flare((2.5, 0), rings, -by(g, 0, 150, 170), by(g, 0, 160, 170), by(g, 0, .2, .28)), "main", *FA) 366: k = by(g, -.08, 0.0, .08) 367: P.solid("couter", sheet([(2.05, 11.45), (2.95 + k, 11.45), (3.02 + k, 11.95), (2.85 + k, 12.4 + k), (2.05, 12.4 + k)], 368: [(-.1, 12.4 + k), (.42, 12.4 + k), (.8 + k, 11.92), (.42, 11.45), (-.1, 11.45)], ring((2.5, .1), (.62 + k, .8 + k), -100, 120)), 369: "main", *FA) 370: if g == "heavy": 371: shield(P, J) 372: 373: 374: SHIELD_CANT = -25.0 # the shield turns this far about the vertical toward the front 375: 376: 377: def shield(P, J): 378: """The castellan's kite shield on the left forearm pad, round in plan, canted toward the front, a pale 379: down its face, a lance racked along its front edge.""" 380: F = J["forearm", "L"] 381: at = frame_std.PADS["forearm"][1] 382: x0 = at[0] + frame_std.PAD_T + .1 # the pad's face 383: turn = lambda bm: transform(bm, rot("Z", SHIELD_CANT, about=(x0, 0, at[2]))) 384: solid(f"{P.n}_shield_mount", frame_std.box(x0, x0 + .3, -.22, .22, 10.2, 10.64), "frame", F, .015) 385: xs = x0 + .3 386: outer = bez((xs, -1.4), (xs + .7, 0), (xs, 1.4), 20) + [(xs, 1.4)] 387: face = outer + [(x - .16, y) for x, y in reversed(outer)] 388: kite = [(-1.4, 12.9), (1.4, 12.9), (1.3, 10.2), (0, 7.4), (-1.3, 10.2)] 389: solid(f"{P.n}_shield", turn(sheet(rect(xs - .3, xs + .9, 7.3, 13.0), kite, face)), "main", F, CHAMFER, smooth=True) 390: pale = [(x + .04, y) for x, y in outer if abs(y) < .36] 391: pale = pale + [(x - .1, y) for x, y in reversed(pale)] 392: solid(f"{P.n}_shield_pale", turn(sheet(rect(xs - .3, xs + 1.0, 8.0, 12.7), [(-.34, 12.7), (.34, 12.7), (.34, 8.5), (0, 8.0), (-.34, 8.5)], pale)), 393: "accent", F, .015, smooth=True) 394: # a gold chief across the top edge 395: chief = [(x + .03, y) for x, y in outer] + [(x - .19, y) for x, y in reversed(outer)] 396: solid(f"{P.n}_shield_chief", turn(sheet(rect(xs - .3, xs + 1.0, 12.68, 12.98), [(-1.46, 12.68), (1.46, 12.68), (1.46, 12.98), (-1.46, 12.98)], chief)), 397: "trim", F, .01, smooth=True) 398: b = Vector((xs + .45, 0, 11.3)) 399: bearing_at("shield", rot("Z", SHIELD_CANT, about=(x0, 0, at[2])) @ b, rot("Z", SHIELD_CANT).to_3x3() @ Vector((1, 0, 0)), F, 1.6) 400: # the lance: shaft, vamplate and a long cone, upright in two clamps ahead of the shield 401: lx, ly = xs + .1, -1.72 402: for z in (8.6, 11.9): 403: solid(f"{P.n}_lance_clamp{z:.0f}", turn(frame_std.box(lx - .12, lx + .12, ly, -1.28, z - .12, z + .12)), "frame", F, .01) 404: solid(f"{P.n}_lance_shaft", turn(cylinder(.13, 6.4, 9.6, 10, at=(lx, ly))), "frame", F, smooth=True) 405: vamp = loft([(9.6, circle(.2, 16, lx, ly)), (9.95, circle(.62, 16, lx, ly)), (10.05, circle(.58, 16, lx, ly)), (10.1, circle(.34, 16, lx, ly))]) 406: solid(f"{P.n}_lance_vamplate", turn(vamp), "accent", F, .01, smooth=True) 407: cone = loft([(10.05, circle(.34, 16, lx, ly)), (14.5, circle(.2, 16, lx, ly)), (18.2, circle(.02, 16, lx, ly))]) 408: solid(f"{P.n}_lance", turn(cone), "main", F, .01, smooth=True) 409: solid(f"{P.n}_lance_ring", turn(cylinder(.24, 12.6, 12.8, 16, at=(lx, ly))), "trim", F, smooth=True) 410: 411: 412: # ---- legs ------------------------------------------------------------------------------------------------- 413: # Drawn on the striker rig. stance() then shortens the thigh to a band under the tassets and lengthens 414: # the greave, so the thigh is drawn about three times as tall as it stands. 415: GREAVE_C = (1.2, .02) 416: # the greave's rings (z, rx, ry): narrow under the knee, a slight swell, then the bell over the ankle 417: GREAVE = [(5.68, .5, .62), (4.3, .54, .66), (3.5, .6, .72), (2.7, .76, .84), (2.2, .92, .94), (1.82, 1.06, 1.04)] 418: CALF = [(5.4, .58, .7), (4.2, .62, .86), (3.2, .64, .8), (2.4, .82, .88), (1.95, 1.0, .98)] 419: 420: 421: def thigh(P, J, g): 422: """A front sheet and a back guard round the bone, narrowing to the knee: light thin with the frame 423: between them, heavy nearly closed.""" 424: TH = lr(J, "thigh") 425: G = GROW[g] 426: W = by(g, 0, 0, .14) # the heavy's thighs broaden outward 427: c = (1.16 + W / 2, -.05) 428: rings = [(9.62, .82 + G + W / 2, .84 + G), (6.85, .66 + G + W / 2, .7 + G)] 429: a = by(g, (205, 335), (195, 345), (185, 355)) 430: P.solid("thigh", flare(c, rings, *a, by(g, .16, .3, .36)), "main", *TH) 431: a = by(g, (40, 140), (25, 155), (12, 168)) 432: P.solid("thigh_back", flare(c, [(9.5, .8 + G + W / 2, .84 + G), (7.0, .66 + G + W / 2, .72 + G)], *a, by(g, .16, .2, .3)), "main", *TH) 433: 434: 435: def shin(P, J, g): 436: """A poleyn of three overlapping lames over the knee, as wide as the greave top. The greave: narrow 437: under the knee, flaring to a bell over the ankle, a front sheet and a calf sheet with the frame 438: between them at the sides (narrow seams on the heavy), a long accent panel down its front. The 439: heavy adds fans on both sides of the knee.""" 440: SH = lr(J, "shin") 441: G = GROW[g] 442: pc = (1.2, -.18) 443: # the middle lame stands proudest, the cap; the lowest comes to a point under it 444: lames = [(6.98, 6.52, .62, .82), (6.62, 5.9, .76, 1.17), (6.02, 5.42, .64, .88)] if g != "light" else [(6.9, 6.34, .6, .8), (6.4, 5.5, .68, 1.06)] 445: for i, (za, zb, rx, ry) in enumerate(lames): 446: bot = (lambda a, zb=zb: zb + .4 * min(1.0, abs(a - 270) / 60)) if i == len(lames) - 1 else zb 447: P.solid(f"poleyn{i}", flare(pc, [(za, rx + G, ry + G), (bot, rx + G + .04, ry + G + .06)], 200, 340, by(g, .14, .2, .26)), "main", *SH) 448: grow = lambda rs, d: [(z, rx + d, ry + d) for z, rx, ry in rs] 449: a, t = by(g, (200, 340), (190, 350), (183, 357)), by(g, .12, .2, .3) 450: P.solid("greave", flare(GREAVE_C, grow(GREAVE, G), *a, t), "main", *SH) 451: a, t = by(g, (38, 142), (22, 158), (10, 170)), by(g, .12, .18, .26) 452: calf = [(z, rx + G, ry + G + by(g, 0, 0, .25) * min(1.0, (5.4 - z) / 1.2)) for z, rx, ry in CALF] # the heavy's calf deepens away from the knee 453: P.solid("greave_calf", flare(GREAVE_C, calf, *a, t), "main", *SH) 454: panel = [(z, rx + G + .04, ry + G + .04) for z, rx, ry in GREAVE if z >= 2.3] 455: P.solid("greave_panel", flare(GREAVE_C, [(5.2, .52 + G + .04, .64 + G + .04)] + panel[1:], 256, 284, .08), "accent", *SH, bevel=.012) 456: for side, j, sx in (("L", SH[0], 1), ("R", SH[1], -1)): 457: bearing_at(f"shin.{side}", (1.2 * sx, GREAVE_C[1] - .7 - G - .06, 4.3), (0, -1, 0), j, .4) 458: if g == "heavy": 459: for nm, (x0, x1) in (("o", (1.86, 2.02)), ("i", (.38, .54))): 460: P.solid(f"poleyn_fan_{nm}", cylinder(.62, x0, x1, 16, axis="x", at=(-.24, 6.18)), "main", *SH, bevel=.02) 461: P.solid(f"poleyn_boss_{nm}", cylinder(.18, x0 - .04, x1 + .04, 10, axis="x", at=(-.24, 6.18)), "metal", *SH, bevel=.01) 462: 463: 464: def foot(P, J, g): 465: """A sabaton: a vamp bent over the instep and narrowing to a clipped point, split at the toe hinge, 466: over the frame's sole. A heel spinner behind: a wheel under a curved fender that leaves its lower 467: back arc bare.""" 468: FT = lr(J, "foot") 469: fit = frame_std.place_foot 470: k = by(g, -.03, 0.0, .04) 471: f = [(.72 - k, .3), (1.68 + k, .3), (1.68 + k, .7), (1.44, 1.12 + k), (.96, 1.12 + k), (.72 - k, .92)] 472: s = [(-.3, 1.12 + k), (.42, 1.04), (.9, .8), (1.0, .56), (1.0, .34), (-3.3, .3), (-3.44, .38), (-3.1, .5), (-1.56, .74 + k), (-.62, 1.1 + k)] 473: plan = [(.74 - k, 1.1), (1.66 + k, 1.1), (1.7 + k, -1.4)] + bez((1.7 + k, -1.4), (1.62, -2.6), (1.32, -3.42), 5) \ 474: + [(1.32, -3.42), (1.08, -3.42)] + bez((1.08, -3.42), (.78, -2.6), (.7 - k, -1.4), 5) + [(.7 - k, -1.4)] 475: whole = sheet(f, s, plan) 476: P.solid("sabaton_toe", fit(clip(copy(whole), y=(-60, -1.59))), "main", *FT) 477: P.solid("sabaton", fit(clip(whole, y=(-1.53, 60))), "main", *FT) 478: P.solid("sabaton_hinge", fit(cylinder(.09, .6, 1.8, 10, axis="x", at=(-1.56, .5))), "metal", *FT, bevel=.01) 479: spinner(P, J, g) 480: 481: 482: def spinner(P, J, g): 483: """The heel spinner: a wheel under a curved fender that leaves its lower back arc bare.""" 484: FT = lr(J, "foot") 485: # drawn where the fitted foot puts it and only turned with the foot, so the wheel stays round 486: turn = lambda bm: transform(bm, rot("Z", frame_std.TURN, about=(frame_std.ANKLE[0], frame_std.ANKLE[1], 0))) 487: r = by(g, .46, .42, .4) 488: y, z = 1.3, r + .02 489: P.solid("spinner_tyre", turn(cylinder(r, .92, 1.48, 20, axis="x", at=(y, z))), "joint", *FT, bevel=.01) 490: P.solid("spinner_hub", turn(cylinder(r * .5, .88, 1.52, 12, axis="x", at=(y, z))), "metal", *FT, bevel=.01) 491: arc = bez((y - r - .12, z), (y - .1, z + r * 2.3), (y + r * .7, z + r * .75), 8) + [(y + r * .7, z + r * .75)] 492: fender = arc + [(yy, zz - .1) for yy, zz in reversed(arc)] 493: P.solid("spinner_fender", turn(sheet(rect(.84, 1.56, 0, 2), fender, None)), "main", *FT, bevel=.012) 494: 495: 496: # ---- back ------------------------------------------------------------------------------------------------- 497: def backpack(P, J, g): 498: """Medium and heavy: a pack round at the back with an accent panel, two main bells, verniers, and on 499: the heavy a broad shroud with tanks. Light: the core block, the cockpit.""" 500: if g == "light": 501: return core_block(P, J) 502: B = J["backpack"] 503: k = by(g, 0, 0.0, .45) 504: hw, z0 = .94 + k, 12.4 - k * .3 505: depth = 1.1 + k * .5 506: P.solid("pack", loft([(z0, ring((0, 1.5), (hw, depth - .2), 0, 180)), (z0 + .3, ring((0, 1.5), (hw + .06, depth), 0, 180)), 507: (14.45, ring((0, 1.5), (hw + .06, depth), 0, 180)), (14.85, ring((0, 1.5), (hw - .2, depth - .35), 0, 180))]), "main", B) 508: P.solid("pack_panel", flare((0, 1.5), [(13.0, hw + .1, depth + .05), (14.3, hw + .1, depth + .05)], 60, 120, .09), "accent", B, bevel=.015) 509: bearing_at("back", (0, 1.5 + depth + .06, 13.65), (0, 1, 0), B, 1.0) 510: r = by(g, .32, .42, .48) 511: yb = 1.5 + depth * .6 512: P.solid("pack_throat", merge(*[cylinder(r * .9, z0 - .14, z0 + .02, 12, at=(sx * .48, yb)) for sx in (1, -1)]), "frame", B, bevel=.01) 513: nozzle_pair("main", (.48, yb, z0 - .1), (0, .55, -.84), r, .62 + r * .5, B, B, housing=False) 514: nozzle_pair("vernier", (.5, 1.5 + depth * .8, 14.55), (0, .96, .28), .13, .24, B, B, housing=False) 515: if g == "heavy": 516: for s, sx in (("L", 1), ("R", -1)): 517: x = sx * (hw - .1) 518: P.solid(f"pack_tank.{s}", loft([(12.5, octo(.5, .5, .18, x=x, y=1.9)), (14.3, octo(.5, .5, .18, x=x, y=1.9))]), "metal", B) 519: 520: 521: def core_block(P, J): 522: """The light's cockpit: a capsule behind the chest, round in plan, its top level with the helm, 523: held on two docking lugs either side with a dark seam all round. Its back face is the hatch, an 524: accent field. It rides its own `core` node so it ejects whole.""" 525: T = J["torso"] 526: C = empty("core", (0, 1.85, 14.1), T) 527: J["core"] = C 528: y0 = 1.18 529: rings = lambda r, k: ring((0, 1.78), (1.02 * r, .82 * r + k), 0, 180) + [(-1.02 * r, y0), (1.02 * r, y0)] 530: P.solid("core", loft([(12.1, rings(.9, 0)), (12.5, rings(1.0, 0)), (15.7, rings(1.0, 0)), (16.3, rings(.82, -.1))]), "main", C) 531: P.solid("core_hatch", flare((0, 1.78), [(12.8, 1.06, .86), (15.4, 1.06, .86)], 56, 124, .1), "accent", C, bevel=.015) 532: bearing_at("back", (0, 1.78 + .88, 14.4), (0, 1, 0), C, 1.0) 533: solid(f"{P.n}_core_handle", frame_std.box(-.2, .2, 2.62, 2.7, 15.0, 15.1), "frame", C, .01) 534: for s, sx in (("L", 1), ("R", -1)): 535: for z in (12.9, 15.3): 536: solid(f"{P.n}_core_lug{z:.0f}.{s}", frame_std.box(*sorted((.78 * sx, 1.12 * sx)), .9, 1.3, z - .2, z + .2), "frame", C, .015) 537: for i, z in enumerate((12.62, 12.82)): 538: solid(f"{P.n}_core_lamp{i}", frame_std.box(.72, .82, 2.3, 2.5, z, z + .1), "lamp_red", C) 539: P.solid("core_throat", merge(*[cylinder(.34, 11.96, 12.12, 12, at=(sx * .5, 2.0)) for sx in (1, -1)]), "frame", C, bevel=.01) 540: nozzle_pair("main", (.5, 2.0, 12.0), (0, .45, -.9), .36, .7, C, C, housing=False) 541: nozzle_pair("vernier", (.6, 2.45, 15.6), (0, .96, .28), .12, .22, C, C, housing=False) 542: 543: 544: def binder(P, J, g): 545: """Blades on the binder arms, swept back, bells under them. The light's core block has none.""" 546: if g == "light": 547: return 548: hgt = by(g, 1.2, 1.5, 1.8) 549: t = by(g, .08, .12, .16) 550: for s, sx in (("L", 1), ("R", -1)): 551: j = J["binder", s] 552: m = Matrix.Translation((.9 * sx, 2.25, 14.7)) @ rot("Y", 36 * sx) @ rot("X", -40) 553: spar = loft([(-.55, octo(.2, .26, .05)), (hgt * .5, octo(.16, .22, .04))]) 554: solid(f"{P.n}_binder_spar.{s}", transform(spar, m), "frame", j, .015) 555: xo = (.1 + t / 2) * sx 556: blade = [(-.42, -.5), (.36, -.5), (.5, hgt * .45), (.24, hgt), (-.42, hgt * .6)] 557: solid(f"{P.n}_binder_blade.{s}", transform(prism(blade, xo - t / 2, xo + t / 2, "yz"), m), "main", j, CHAMFER, panels=False) 558: bell, glow = nozzle(.2, .36) 559: down = m.to_3x3() @ Vector((0, 0, -1)) 560: at = m @ Vector((0, 0, -.5)) 561: solid(f"{P.n}_binder_bell.{s}", place(bell, at, down), "frame", j, smooth=True) 562: solid(f"{P.n}_binder_bell.{s}.glow", place(glow, at, down), "glow_thruster", j, outline=False) 563: empty(f"nozzle.binder.{s}", at + down * .36, j, dir=gltf_dir(down), radius=.2) 564: 565: 566: PARTS = {"head": head, "chest": chest, "waist": waist, "pelvis": pelvis, "shoulder": shoulder, "upperarm": upperarm, "forearm": forearm, 567: "thigh": thigh, "shin": shin, "foot": foot, "backpack": backpack, "binder": binder} 568: 569: 570: def plates(J, grade="medium", n="at"): 571: """Every atelier plate on a frame's joints. `grade` is one grade name or a dict of segment -> 572: grade with an optional "default".""" 573: pick = (lambda seg: grade) if isinstance(grade, str) else (lambda seg: grade.get(seg, grade.get("default", "medium"))) 574: P = Plates(n, CHAMFER, smooth=True) 575: for seg in SEGMENTS: 576: g = pick(seg) 577: if g: 578: PARTS[seg](P, J, g) 579: return P 580: 581: 582: # ---- stance ----------------------------------------------------------------------------------------------- 583: # The atelier's proportions (docs/study-atelier.md), as fractions of the crown height: a long greave 584: # under a short thigh, the crotch where the line mech has it, a slightly taller crown, the shoulders 585: # out like the line mech's (the flare gives the span), the feet closer together. 586: KNEE_AT = .43 587: CROTCH_AT = .54 588: CROWN = 17.2 589: SHOULDER_OUT = .25 590: SPLAY = .28 591: 592: 593: def stance(J, crown_z): 594: """bend_knees and proportion with the atelier's numbers. Run after the plates.""" 595: frame_std.bend_knees(J, splay=SPLAY) 596: frame_std.proportion(J, crown_z, knee=KNEE_AT, crotch=CROTCH_AT, crown=CROWN, shoulders=SHOULDER_OUT) 597: 598: 599: def crown_z(J): 600: """The helm's top, or the bare frame's head block, in world space.""" 601: bpy.context.view_layer.update() 602: meshes = [o for o in J["head"].children if o.type == "MESH"] 603: o = next((h for h in meshes if "head_helmet" in h.name), None) or next(h for h in meshes if "head_core" in h.name) 604: return max((o.matrix_world @ v.co).z for v in o.data.vertices)manage_task{"Action":"status","TaskId":"abb0eba5-92ad-4ab4-8738-458f4e606a27/task-79"}
input
{ "Action": "status", "TaskId": "abb0eba5-92ad-4ab4-8738-458f4e606a27/task-79" }result, 3 lines
Task: abb0eba5-92ad-4ab4-8738-458f4e606a27/task-79 Status: RUNNING Log: file://~/.gemini/antigravity-cli/brain/abb0eba5-92ad-4ab4-8738-458f4e606a27/.system_generated/tasks/task-79.log
read_file{"Path":"~/.gemini/antigravity-cli/brain/abb0eba5-92ad-4ab4-8738-458f4e606a27/.system_generated/tasks/task-79.log"}
input
{ "Path": "~/.gemini/antigravity-cli/brain/abb0eba5-92ad-4ab4-8738-458f4e606a27/.system_generated/tasks/task-79.log" }result, 8 lines
Showing lines 1-7 of 7 1: clip: /tmp/test.mp4 2: clip: /tmp/test.sheet.jpg 3: clip: 42 frames, 3.5 s of video, 38 s to make (830 ms a frame) 4: 5: real 0m39.041s 6: user 0m4.082s 7: sys 0m1.158s
resultCommand exited with code 0.
Command exited with code 0. Command output: clip: /tmp/test.mp4 clip: /tmp/test.sheet.jpg clip: 42 frames, 3.5 s of video, 38 s to make (830 ms a frame) real 0m39.041s user 0m4.082s sys 0m1.158s Log: file://~/.gemini/antigravity-cli/brain/abb0eba5-92ad-4ab4-8738-458f4e606a27/.system_generated/tasks/task-79.log