A mech game prototype, pushed by Fable 5.2

agent

+19:49

The page is up at http://[redacted: tailnet ip][redacted: private review link]/fable52-sortie/ and the lead (projects-86) has the summary. The page and clip return 200 from [redacted: private review link], but I couldn't reach the [redacted: private review link] address from this machine, so that URL is untested from your side.

  • My read: every mech so far was judged standing still, from the front, on grey, while the game shows it flying, from behind, in the dark. I'd sketch and judge there from the first minute.
  • Where I disagree with the reflection:
    • Sketch in 3D blocks instead of flat outlines, since both build in about 2 seconds.
    • Bring a sheet before asking the question.
    • Test light before surface.
    • Keep a yardstick in every sheet.
    • Move the joints per sketch, because every maker so far shared one skeleton.
  • First session: a moving sheet at minute 0, you cross out, I redraw inside 15 minutes, three sheets at most. Then two survivors get their own pose and a pilot for scale, and one gets plates.
  • The visual: one moving sketch sheet, a 7 second loop of eight tiles. Six are new block bodies with one idea each (needle, yoke, coat, cross, bell, hunch). The other two are yardsticks: the old skeleton in boxes and the striker. Each tile shows the mech from behind in flight with the game's plumes, then a full turn.

It is blocks only, a sheet to cross out and not a design. I judged it from frames, so motion is yours to judge. My own cuts would be 3, which still reads as a box on legs, and the twin stacks on 6, which read as ears.

Blank file to finished sheet took 16 minutes, 9 of them the final software render on a busy machine. No tests were run.

The work is one commit on branch fable52, 3e36102, not pushed: the six sketch files and their helper under kit/blocks/, plus tools/sketch-sheet.sh. Main and the other worktrees are untouched.

Files are in [redacted: private path]/fable52-sortie/:

  • index.html
  • sheet.mp4
  • sheet.jpg

I left the tracker alone: the brief says not to use tracker for this experiment, and that covers both tracker log and tracker skip.

The hook is asking about my one commit, 3e36102 on fable52. If you want the reminder cleared without a log entry, tracker skip mech-game does it. Say the word and I'll run it.

Holding here. The lead confirmed the page, clip and poster all load, and that the [redacted: private review link] address serves the same folder, so the owner's link is good.

Nothing else is running or queued. The one loose end is the tracker reminder for commit 3e36102, which I've left untouched per the brief.

  • SendMessage{"to":"projects-86","summary":"Ack: starting refined mech on outline 0","message":"Ack, starting now: one refined mech of my own on outline 0 (the striker's skeleton), shown from behind in flight then a full turn with S beside it, added to the same page as a second section with step timings. Same rules as before. I'll send the link when it's done.","type":"message","recipient":"projects-86","recipient_kind":"name","content":"Ack, starting now: one refined mech of my own on …"}

    input

    {
      "to": "projects-86",
      "summary": "Ack: starting refined mech on outline 0",
      "message": "Ack, starting now: one refined mech of my own on outline 0 (the striker's skeleton), shown from behind in flight then a full turn with S beside it, added to the same page as a second section with step timings. Same rules as before. I'll send the link when it's done.",
      "type": "message",
      "recipient": "projects-86",
      "recipient_kind": "name",
      "content": "Ack, starting now: one refined mech of my own on …"
    }

    result, 1 line

    {"success":true,"message":"“Ack: starting refined mech on outline 0” → projects-86 (another Claude session on this machine; in that session's inbox, not yet read by its Claude — a [Cross-session delivery notice] follows if that session holds it (usually a different permission mode) or refuses it)","msg_id":"563cb3a7-35c4-430f-a95c-ac97b8ce3ee6"}
  • Bashtools/log.sh "r2 start: refined mech on outline 0" && wc -l kit/mech.py kit/lib.py tools/shoot.mjs && cat tools/shoot.mjs && sed -n 1,37p kit/lib.py && sed -n 200,250p kit/lib.py && sed -n 272,395p kit/lib.py && sed -n 420,470p kit/lib.py

    command

    tools/log.sh "r2 start: refined mech on outline 0" && wc -l kit/mech.py kit/lib.py tools/shoot.mjs && cat tools/shoot.mjs && sed -n 1,37p kit/lib.py && sed -n 200,250p kit/lib.py && sed -n 272,395p kit/lib.py && sed -n 420,470p kit/lib.py

    result, 283 lines

    19:04:25  r2 start: refined mech on outline 0
      400 kit/mech.py
      437 kit/lib.py
       48 tools/shoot.mjs
      885 total
    // Screenshots of the running dev server for review.
    //   node tools/shoot.mjs out/dir name=/?view=striker name2=/?view=ship ...
    // Waits for window.__ready, then a few frames. Needs `npm run dev` on :5199.
    // SORTIE_GPU=1 uses the GPU (see below).
    import { chromium } from 'playwright';
    import { mkdirSync } from 'node:fs';
    import { join } from 'node:path';
    
    const [out, ...shots] = process.argv.slice(2);
    const base = process.env.SORTIE_URL ?? 'http://localhost:5199';
    const W = Number(process.env.W ?? 1280), H = Number(process.env.H ?? 720);
    mkdirSync(out, { recursive: true });
    // SORTIE_GPU=1 renders on the GPU through a headed window on the WSLg display. WSLg ignores the
    // off-screen position, so the window shows on that machine's Windows desktop: on the workstation only
    // when nobody minds, [redacted: server name].
    // Headless Chromium only gets SwiftShader, which is slow and loads the CPU.
    const gpu = process.env.SORTIE_GPU === '1';
    const browser = await chromium.launch(gpu
      ? { headless: false, args: ['--use-angle=gl', '--ignore-gpu-blocklist', '--window-position=-4000,0'],
          env: { ...process.env, DISPLAY: ':0', WAYLAND_DISPLAY: 'wayland-0', XDG_RUNTIME_DIR: '/mnt/wslg/runtime-dir',
          // Mesa may fall back to llvmpipe unless told to use its D3D12 driver [redacted: server name]
          GALLIUM_DRIVER: 'd3d12', LD_LIBRARY_PATH: '/usr/lib/wsl/lib' } }
      : { args: ['--use-angle=swiftshader', '--enable-unsafe-swiftshader', '--ignore-gpu-blocklist'] });
    const page = await browser.newPage({ viewport: { width: W, height: H } });
    // SHOOT_TIMEOUT (ms) for page loads and screenshots: software rendering under load needs more than the default
    page.setDefaultTimeout(Number(process.env.SHOOT_TIMEOUT ?? 30000));
    let failed = 0;
    page.on('console', (m) => { if (m.type() === 'error' || m.type() === 'warning') console.log(`[${m.type()}]`, m.text().slice(0, 300)); });
    page.on('pageerror', (e) => console.log('[pageerror]', e.message));
    for (const s of shots) {
      const i = s.indexOf('=');
      const name = s.slice(0, i), url = s.slice(i + 1);
      const t = Date.now();
      // one slow or broken shot is reported and skipped, the rest of the batch still runs
      try {
        await page.goto(base + url);
        await page.waitForFunction(() => window.__ready === true, null, { timeout: 300000 });
        const frames = Number(new URL(base + url).searchParams.get('frames') ?? 1);
        await page.evaluate((n) => new Promise((r) => { let k = 0; const f = () => (++k >= n ? r() : requestAnimationFrame(f)); requestAnimationFrame(f); }), frames);
        await page.screenshot({ path: join(out, `${name}.png`) });
        console.log(`${name}: ${Date.now() - t} ms`);
      } catch (e) {
        failed++;
        console.log(`${name}: FAILED ${e.message.split('\n')[0]}`);
      }
    }
    await browser.close();
    process.exitCode = failed ? 1 : 0;
    """Modelling helpers shared by every kit script.
    
    Blender units are metres, Z is up, and models face -Y (Blender's front view). The glTF exporter turns
    that into three.js's Y up with models facing +Z.
    
    Parts are solids built from a few primitives:
      loft      cross-sections stacked along an axis (most armour, limbs, hulls)
      prism     a 2D outline pushed through a depth
      two_view  a front outline and a side outline intersected, the classic hard-surface blockout
    Every solid gets a material role (main, accent, frame, glow_eye, ...). The game maps roles to toon
    materials, so one model can wear any faction's paint.
    """
    import math
    
    import bmesh
    import bpy
    from mathutils import Matrix, Vector
    
    # Preview colours only, for anyone opening a .blend. The game ignores them.
    PREVIEW = {
        "main": (0.86, 0.87, 0.9), "accent": (0.12, 0.3, 0.55), "trim": (0.85, 0.55, 0.12),
        "frame": (0.2, 0.21, 0.24), "joint": (0.12, 0.12, 0.14), "visor": (0.05, 0.06, 0.08),
        "glow_eye": (0.3, 1.0, 0.9), "glow_core": (0.3, 1.0, 0.9), "glow_thruster": (0.6, 0.78, 1.0),
        "glow_exhaust": (0.31, 0.56, 1.0),
        "metal": (0.55, 0.57, 0.6), "hull": (0.72, 0.73, 0.75), "hull_dark": (0.32, 0.33, 0.36),
        "deck": (0.25, 0.26, 0.28), "hazard": (0.9, 0.75, 0.1), "light": (1.0, 0.97, 0.9),
        "screen": (0.2, 0.8, 0.75), "glass": (0.1, 0.2, 0.25), "lamp_red": (1.0, 0.2, 0.15),
        "lamp_green": (0.3, 1.0, 0.4), "suit": (0.14, 0.19, 0.36), "glow_hot": (0.92, 1.0, 0.98),
        # raider salvage (palette.ts): donor paint, primer, rust, hand paint
        "donor_a": (0.78, 0.76, 0.72), "donor_b": (0.24, 0.34, 0.43), "donor_c": (0.36, 0.38, 0.26), "primer": (0.54, 0.55, 0.52),
        "rust": (0.42, 0.23, 0.13), "handpaint": (0.93, 0.89, 0.8), "warpaint": (0.76, 0.23, 0.15),
        # markings: pattern codes, service text, unit codes (a decal layer in geometry)
        "stencil": (0.13, 0.14, 0.16),
        "crystal": (0.8, 0.81, 0.84), "crystal_lit": (0.55, 0.45, 0.78), "glow_violet": (0.66, 0.48, 1.0),
    }
    
    
            me.shade_smooth()
            me.set_sharp_from_angle(angle=math.radians(35))
        if not outline:
            o["outline"] = False
        if parent is not None:
            attach(o, parent)
        return o
    
    
    def panel_lines(o, min_area=1.1, width=0.05, depth=0.016):
        """Recess every large face slightly inside a thin border: reads as panel seams on armour."""
        bm = bmesh.new()
        bm.from_mesh(o.data)
        faces = [f for f in bm.faces if f.calc_area() > min_area]
        if faces:
            bmesh.ops.inset_individual(bm, faces=faces, thickness=width, depth=-depth, use_even_offset=True)
        bm.to_mesh(o.data)
        bm.free()
        return o
    
    
    def bake(o):
        dg = bpy.context.evaluated_depsgraph_get()
        me = bpy.data.meshes.new_from_object(o.evaluated_get(dg))
        old = o.data
        o.modifiers.clear()
        o.data = me
        me.name = old.name
        bpy.data.meshes.remove(old)
        return o
    
    
    def boolean(target, cutter_bm, op="DIFFERENCE", role=None):
        """Cut (or intersect/union) a solid object with a bmesh volume. With a role, the faces the cutter
        leaves behind (the inside of a cavity) take that material."""
        me = bpy.data.meshes.new("_cut")
        cutter_bm.to_mesh(me)
        cutter_bm.free()
        if role is not None:
            me.materials.append(material(role))
        cutter = link(bpy.data.objects.new("_cut", me))
        bpy.context.view_layer.update()
        cutter.matrix_world = target.matrix_world.copy()
        mod = target.modifiers.new("bool", "BOOLEAN")
        mod.operation = op
        mod.object = cutter
        mod.solver = "EXACT"
        if role is not None:
            mod.material_mode = "TRANSFER"
        bake(target)
        bpy.data.objects.remove(cutter, do_unlink=True)
    def clip(bm, x=(-60, 60), y=(-60, 60), z=(-60, 60)):
        """The part of a solid inside an axis-aligned box. Cutting one envelope into several boxes with
        gaps between them gives separate shells over the same form."""
        me = bpy.data.meshes.new("_clip")
        bm.to_mesh(me)
        bm.free()
        o = link(bpy.data.objects.new("_clip", me))
        cut = loft([(z[0], [(x[0], y[0]), (x[1], y[0]), (x[1], y[1]), (x[0], y[1])]),
                    (z[1], [(x[0], y[0]), (x[1], y[0]), (x[1], y[1]), (x[0], y[1])])])
        boolean(o, cut, "INTERSECT")
        out = bmesh.new()
        out.from_mesh(o.data)
        data = o.data
        bpy.data.objects.remove(o, do_unlink=True)
        bpy.data.meshes.remove(data)
        return out
    
    
    def copy(bm):
        me = bpy.data.meshes.new("_copy")
        bm.to_mesh(me)
        out = bmesh.new()
        out.from_mesh(me)
        bpy.data.meshes.remove(me)
        return out
    
    
    def _keep_side(bm, co, no, below):
        """Keep the part of a solid below (or above) a plane and cap the opening."""
        geom = bm.verts[:] + bm.edges[:] + bm.faces[:]
        res = bmesh.ops.bisect_plane(bm, geom=geom, plane_co=co, plane_no=no, clear_outer=below, clear_inner=not below)
        edges = [e for e in res["geom_cut"] if isinstance(e, bmesh.types.BMEdge)]
        if edges:
            bmesh.ops.holes_fill(bm, edges=edges, sides=0)
        bmesh.ops.recalc_face_normals(bm, faces=bm.faces)
        return bm
    
    
    def halves(bm, co, no, gap=.04):
        """Split a solid along a plane into two capped pieces with a gap between them: a panel seam
        with real depth, so the dark frame beneath shows through."""
        co, no = Vector(co), Vector(no).normalized()
        a = _keep_side(copy(bm), co - no * gap / 2, no, below=True)
        b = _keep_side(bm, co + no * gap / 2, no, below=False)
        return a, b
    
    
    def panels(bm, cuts, gap=.04):
        """Cut a solid by several planes [(point, normal), ...] into panels with seams between them."""
        pieces = [bm]
        for co, no in cuts:
            out = []
            for p in pieces:
                for h in halves(p, co, no, gap):
                    if len(h.faces) >= 4:
                        out.append(h)
                    else:
                        h.free()
            pieces = out
        return pieces
    
    
    def fold(objs, t, half, y0, y1):
        """Fold the front of a part into a shallow V: in front of y0 (fully in front of y1) every vertex
        moves forward (-Y) by t * (half - |x|), so the centre line becomes a ridge and both sides angle
        back. Meshes are cut on the centre line first so flat plates fold instead of tilting. Works on
        mesh coordinates, which are the authored ones."""
        for ob in objs:
            bm = bmesh.new()
            bm.from_mesh(ob.data)
            if bm.verts and min(v.co.y for v in bm.verts) < y0:
                geom = bm.verts[:] + bm.edges[:] + bm.faces[:]
                bmesh.ops.bisect_plane(bm, geom=geom, plane_co=(0, 0, 0), plane_no=(1, 0, 0))
                for v in bm.verts:
                    ax = abs(v.co.x)
                    if v.co.y < y0 and ax < half:
                        w = min(1.0, (y0 - v.co.y) / (y0 - y1))
                        v.co.y -= t * (half - ax) * w * w * (3 - 2 * w)
                bm.to_mesh(ob.data)
            bm.free()
    
    
    def piston(p0, p1, r=.12, n=8):
        """A hydraulic piston from p0 to p1: a body over the first 60%, a thinner rod the rest, end eyes."""
        p0, p1 = Vector(p0), Vector(p1)
        axis = p1 - p0
        m = Matrix.Translation(p0) @ Vector((0, 0, 1)).rotation_difference(axis.normalized()).to_matrix().to_4x4()
        L = axis.length
        body = loft([(0, circle(r, n)), (L * .6, circle(r, n))])
        rod = loft([(L * .55, circle(r * .45, n)), (L, circle(r * .45, n))])
        eyes = merge(loft([(-r * .4, circle(r * .7, n)), (r * .4, circle(r * .7, n))]),
                     loft([(L - r * .4, circle(r * .6, n)), (L + r * .4, circle(r * .6, n))]))
        return transform(merge(body, rod, eyes), m)
    
    
    def subd(bm, levels=2, sharp=45, crease=1.0):
        """Smooth a low-poly cage with Catmull-Clark subdivision. Edges whose faces meet at more than
        `sharp` degrees are creased, so they stay crisp while everything else rounds off: helmets and
        shells that are soft where they should be and hard where they shouldn't."""
        me = bpy.data.meshes.new("_subd")
        bm.to_mesh(me)
        bm.free()
        attr = me.attributes.get("crease_edge") or me.attributes.new("crease_edge", "FLOAT", "EDGE")
        probe = bmesh.new()
        probe.from_mesh(me)
        probe.edges.ensure_lookup_table()
        lim = math.radians(sharp)
        for e in probe.edges:
            f = e.link_faces
            if len(f) == 2 and f[0].normal.angle(f[1].normal, 0) > lim:
                attr.data[e.index].value = crease
        probe.free()
        o = link(bpy.data.objects.new("_subd", me))
        mod = o.modifiers.new("subd", "SUBSURF")
        mod.levels = mod.render_levels = levels
        bake(o)
        out = bmesh.new()
        out.from_mesh(o.data)
        data = o.data
        bpy.data.objects.remove(o, do_unlink=True)
        bpy.data.meshes.remove(data)
        return out
    
    
        return bm, glow
    
    
    def slats(x0, x1, z0, z1, y, n, depth=0.12, gap=0.35):
        """Horizontal vent slats on a plane facing -Y at depth y."""
        out = []
        h = (z1 - z0) / n
        for i in range(n):
            zb = z0 + i * h
            out.append(prism([(x0, zb), (x1, zb), (x1, zb + h * (1 - gap)), (x0, zb + h * (1 - gap))],
                             y - depth, y + 0.05, "xz"))
        return merge(*out)
    
    
    def export(path, extras=True):
        bpy.ops.export_scene.gltf(filepath=path, export_format="GLB", export_apply=True, export_yup=True,
                                  export_extras=extras, export_cameras=False, export_lights=False,
                                  export_materials="EXPORT", export_normals=True, export_texcoords=False)
  • Bashsed -n 128,400p kit/mech.py

    command

    sed -n 128,400p kit/mech.py

    result, 273 lines

    def build_waist(J):
        W = J["waist"]
        solid("abdomen", loft([(10.9, octo(1.6, 1.4, .35)), (11.95, octo(1.85, 1.55, .38))]), "joint", W, 0.03)
        # three stacked plates in front, each a little wider and further forward than the one below
        for i, (z0, z1, hw, y) in enumerate(((10.98, 11.34, .64, -.84), (11.28, 11.64, .72, -.88), (11.58, 11.96, .8, -.92))):
            solid(f"abs{i}", two_view([(-hw, z0), (hw, z0), (hw + .06, z1), (-hw - .06, z1)],
                                      [(y + .02, z0), (y + .24, z0), (y + .24, z1), (y - .02, z1)],
                                      top=[(-hw - .1, y + .3), (hw + .1, y + .3), (hw + .1, y + .1), (0, y - .06), (-hw - .1, y + .1)]),
                  "frame", W, 0.02)
        pair("abs_side", two_view([(.72, 11.0), (.96, 11.05), (1.02, 11.92), (.78, 11.92)],
                                  [(-.5, 11.0), (.5, 11.0), (.56, 11.92), (-.56, 11.92)]), "frame", W, W, bevel=0.02)
    
    
    def build_torso(J):
        T = J["torso"]
        # a dark structural core; the armour is separate plates over it
        solid("chest", loft([(11.9, octo(1.9, 1.6, .4, y=.05)), (12.6, octo(2.4, 2.05, .45)), (13.9, octo(3.0, 2.45, .55, y=-.05)),
                             (14.9, octo(2.8, 2.25, .5)), (15.3, octo(1.8, 1.55, .4))]), "frame", T, BEVEL)
        # central hatch: a ridged block down the chest front that carries the reactor lens
        solid("hatch", two_view([(-.55, 12.75), (.55, 12.75), (.6, 14.5), (.4, 14.78), (-.4, 14.78), (-.6, 14.5)],
                                [(-1.62, 12.75), (-1.2, 12.75), (-1.3, 14.78), (-1.66, 14.62), (-1.8, 13.8)],
                                top=[(-.7, -1.0), (.7, -1.0), (.7, -1.55), (0, -1.84), (-.7, -1.55)]), "main", T, .03)
        pair("chest_plate", two_view([(.58, 14.82), (1.18, 14.88), (1.55, 14.62), (1.78, 14.28), (1.55, 13.85), (.6, 14.08)],
                                     [(-1.64, 13.6), (-1.1, 13.6), (-1.26, 14.88), (-1.5, 14.88), (-1.72, 13.85)]),
             "accent", T, T, bevel=BEVEL)
        rib = two_view([(.6, 12.7), (.9, 12.6), (1.6, 13.2), (1.62, 13.54), (.6, 13.88)],
                       [(-1.49, 12.5), (-.95, 12.5), (-1.1, 13.92), (-1.35, 13.92), (-1.57, 13.55)])
        pair_pieces("rib_plate", seam(rib, (.6, 13.22), (1.62, 13.05)), "accent", T, T, bevel=0.03)
        pair("chest_strip", two_view([(.6, 14.84), (1.18, 14.9), (1.57, 14.64), (1.8, 14.28), (1.64, 14.2), (1.42, 14.5), (1.1, 14.7),
                                      (.6, 14.64)],
                                     [(-1.72, 13.9), (-1.22, 13.9), (-1.36, 14.96), (-1.6, 14.96), (-1.8, 14.2)]), "main", T, T, bevel=0.02)
        pair("side_plate", two_view([(1.42, 12.9), (1.62, 12.9), (1.68, 14.4), (1.48, 14.6)],
                                    [(-.95, 12.9), (.9, 12.9), (.95, 14.4), (-1.05, 14.45)]), "main", T, T, bevel=0.03)
        solid("belly", two_view([(-.95, 11.92), (.95, 11.92), (1.22, 12.62), (-1.22, 12.62)],
                                [(-1.34, 11.9), (-.98, 11.9), (-1.08, 12.66), (-1.4, 12.66)]), "main", T, BEVEL)
        solid("belly_vent", slats(-.6, .6, 12.02, 12.48, -1.38, 3, depth=.08), "frame", T)
        # the reactor lens in the chest
        solid("lens_socket", prism(circle(.44, 12, 0, 13.62), -1.92, -1.5, "xz"), "frame", T, 0.03)
        solid("lens", prism(circle(.33, 12, 0, 13.62), -1.97, -1.9, "xz"), "sensor", T, smooth=True)
        solid("lens_core", prism(circle(.11, 8, 0, 13.62), -1.99, -1.95, "xz"), "glow_core", T)
        # collar: thin folded plates (front and side) with room around the neck
        pair("collar", two_view([(.55, 14.72), (1.46, 14.76), (1.55, 15.3), (1.1, 15.55), (.62, 15.45)],
                                [(-1.0, 14.7), (-.84, 14.7), (-.68, 15.55), (-.84, 15.55)]), "main", T, T, bevel=0.025)
        pair("collar_side", two_view([(1.36, 14.7), (1.52, 14.7), (1.42, 15.5), (1.26, 15.5)],
                                     [(-.9, 14.7), (.7, 14.7), (.6, 15.5), (-.7, 15.5)]), "main", T, T, bevel=0.025)
        pair("collar_vent", slats(.72, 1.26, 14.86, 15.2, -1.0, 3, depth=.06), "frame", T, T)
        solid("neck_guard", two_view([(-.55, 15.2), (.55, 15.2), (.5, 15.86), (-.5, 15.86)],
                                     [(.25, 15.2), (.72, 15.2), (.64, 15.86), (.36, 15.86)]), "main", T, .02)
        solid("back_plate", two_view([(-.95, 12.35), (.95, 12.35), (1.62, 14.92), (-1.62, 14.92)],
                                     [(1.14, 12.35), (1.46, 12.35), (1.52, 14.92), (1.24, 14.92)]), "accent", T, BEVEL)
    
    
    def build_head(J):
        N, H = J["neck"], J["head"]
        solid("neck_core", cylinder(.36, 15.25, 16.0, 10), "joint", N, smooth=True)
        solid("neck_ring", loft([(15.5, octo(.95, .9, .2)), (15.68, octo(.86, .82, .18))]), "frame", N, .015)
        # cranium: the top plate, tapered toward the back in plan
        solid("cranium", two_view([(-.62, 16.66), (.62, 16.66), (.58, 17.05), (.36, 17.28), (-.36, 17.28), (-.58, 17.05)],
                                  [(-.86, 16.7), (-.5, 17.2), (.25, 17.3), (.72, 17.0), (.78, 16.66)],
                                  top=[(-.4, -.88), (.4, -.88), (.62, -.4), (.55, .6), (0, .86), (-.55, .6), (-.62, -.4)]), "main", H, .03)
        solid("skull", loft([(15.95, octo(.9, 1.15, .25, y=.05)), (16.7, octo(1.1, 1.4, .3, y=.0))]), "frame", H, .02)
        # side plates frame the face and run back past the ears
        pair("helmet_side", two_view([(.48, 15.98), (.7, 16.28), (.77, 16.9), (.62, 17.04), (.55, 16.5), (.42, 16.06)],
                                     [(-.72, 15.98), (.62, 15.98), (.74, 16.6), (.5, 17.04), (-.56, 17.0), (-.82, 16.52)]), "main", H, H, bevel=.025)
        # sensor band under a broad, slightly peaked brow hood
        solid("visor", two_view([(-.6, 16.48), (.6, 16.48), (.6, 16.64), (-.6, 16.64)],
                                [(-.97, 16.46), (-.62, 16.46), (-.62, 16.66), (-.95, 16.66)]), "visor", H, 0.01)
        solid("sensor_band", two_view([(-.5, 16.535), (.5, 16.535), (.5, 16.585), (-.5, 16.585)],
                                      [(-.99, 16.5), (-.93, 16.5), (-.93, 16.62), (-.99, 16.62)]), "glow_eye", H)
        solid("brow_hood", two_view([(-.68, 16.62), (.68, 16.62), (.62, 16.8), (.18, 16.88), (-.18, 16.88), (-.62, 16.8)],
                                    [(-1.07, 16.62), (-.55, 16.62), (-.55, 16.88), (-.95, 16.86)],
                                    top=[(-.7, -.5), (.7, -.5), (.7, -.92), (0, -1.1), (-.7, -.92)]), "main", H, 0.02)
        # lower face: a dark recessed mask with vertical vents, two faceted plates over it
        solid("mask", two_view([(-.3, 15.9), (.3, 15.9), (.42, 16.45), (-.42, 16.45)],
                               [(-.72, 15.9), (-.5, 15.9), (-.55, 16.46), (-.8, 16.46)]), "frame", H, 0.015)
        vents = [prism([(x - .025, 15.98), (x + .025, 15.98), (x + .025, 16.3), (x - .025, 16.3)], -.8, -.7, "xz") for x in (-.1, 0, .1)]
        solid("mask_vents", merge(*vents), "joint", H)
        pair("mask_plate", two_view([(.12, 15.92), (.36, 16.0), (.44, 16.42), (.16, 16.42)],
                                    [(-.84, 15.95), (-.6, 15.95), (-.62, 16.44), (-.88, 16.44)]), "main", H, H, bevel=0.015)
        # ear sensors: blocks with a lens on the outer face
        pair("ear", two_view([(.7, 16.3), (.86, 16.33), (.86, 16.66), (.7, 16.7)],
                             [(-.25, 16.3), (.22, 16.3), (.28, 16.66), (-.2, 16.7)]), "accent", H, H, bevel=.02)
        pair("ear_lens", cylinder(.085, .85, .9, 12, axis="x", at=(-.01, 16.48)), "sensor", H, H, smooth=True)
        solid("helmet_rear", two_view([(-.55, 16.08), (.55, 16.08), (.6, 16.7), (-.6, 16.7)],
                                      [(.42, 16.04), (.8, 16.2), (.82, 16.7), (.52, 16.76)]), "main", H, .02)
        solid("rear_fin", prism([(.45, 16.95), (.92, 16.86), (1.0, 17.0), (.62, 17.18)], -.05, .05, "yz"), "frame", H, .01)
        solid("crest", two_view([(-.1, 16.9), (.1, 16.9), (.04, 17.62), (-.04, 17.62)],
                                [(-.62, 16.98), (-.34, 17.25), (.48, 17.60), (.67, 17.54), (.15, 17.12), (-.32, 16.94)]), "trim", H, 0.01)
    
    
    def build_arms(J):
        pair("shoulder_block", loft([(1.45, octo(1.5, 1.4, .35, y=14.55)), (2.62, octo(1.45, 1.35, .35, y=14.55))], axis="x"),
             "frame", *lr(J, "shoulder"), bevel=BEVEL)
        # the shoulder shell: a folded plate (top and outer drop) standing off the block
        # shoulder shell: a swept roof and a separate outer blade, tapered in plan, open underneath
        plan = [(1.85, -.65), (3.25, -1.05), (4.3, .10), (4.1, .75), (3.2, 1.1), (1.85, .60)]
        side = [(-1.3, 14.2), (1.3, 14.2), (1.3, 15.95), (-1.3, 15.95)]
        cap = [(-.90, 15.35), (.30, 15.65), (.95, 15.20), (.70, 14.55), (-.65, 14.65)]
        roof = two_view([(1.90, 15.16), (3.38, 15.87), (3.72, 15.61), (3.45, 15.15), (2.12, 14.87)],
                        [(-1.25, 14.75), (.4, 15.95), (1.15, 15.4), (.9, 14.8), (-.9, 14.75)], top=plan)
        pair_pieces("shell", seam(roof, (2.78, 14.6), (2.62, 16.2), gap=.05), "accent", *lr(J, "shoulder"), bevel=0.03)
        pair("shell_under", two_view([(2.1, 14.74), (3.3, 15.06), (3.36, 14.86), (2.2, 14.58)], cap, top=plan),
             "frame", *lr(J, "shoulder"), bevel=0.02)
        pair("trunnion", cylinder(.325, 2.25, 2.95, 12, axis="x", at=(0, 14.55)), "joint", *lr(J, "shoulder"), smooth=True)
        for k, y in (("f", -.45), ("r", .45)):
            pair(f"fork_{k}", two_view([(2.2, 14.1), (2.9, 14.2), (2.9, 14.95), (2.2, 15.0)],
                                       [(y - .08, 14.1), (y + .08, 14.1), (y + .08, 15.0), (y - .08, 15.0)]), "frame",
                 *lr(J, "shoulder"), bevel=0.02)
        pair("shell_blade", two_view([(3.62, 15.84), (4.2, 15.65), (3.98, 14.65), (3.72, 14.5), (3.55, 15.08)], side, top=plan),
             "accent", *lr(J, "shoulder"), bevel=0.04)
        pair("shell_edge", two_view([(2.0, 14.86), (3.55, 15.06), (3.55, 15.18), (1.95, 14.98)], side,
                                    top=[(1.85, -.74), (3.25, -1.14), (3.42, -.9), (1.9, -.52)]),
             "main", *lr(J, "shoulder"), bevel=0.012)
        pair("shell_fin", prism([(-.6, 15.5), (1.0, 15.55), (.8, 16.05), (.05, 15.95)], 2.9, 3.05, "yz"), "main",
             *lr(J, "shoulder"), bevel=0.02)
        pair("upperarm_core", loft([(12.2, octo(.85, .9, .22, x=2.5)), (14.2, octo(.9, .95, .24, x=2.48))]), "joint",
             *lr(J, "upperarm"), bevel=0.03)
        # front and rear shells with channels down the sides that show the core
        cuff = loft([(12.5, octo(.85, .95, .22, x=2.53)), (13.6, octo(1.1, 1.13, .28, x=2.54))])
        cuff_b = copy(cuff)
        pair("upperarm_front", clip(cuff, y=(-1, -.08)), "main", *lr(J, "upperarm"), bevel=0.03)
        pair("upperarm_rear", clip(cuff_b, y=(.08, 1)), "main", *lr(J, "upperarm"), bevel=0.03)
        pair("upperarm_band", loft([(13.62, octo(1.16, 1.18, .28, x=2.54)), (13.84, octo(1.16, 1.18, .28, x=2.54))]), "accent",
             *lr(J, "upperarm"), bevel=0.02)
        pair("elbow", cylinder(.48, 2.0, 3.0, 12, axis="x", at=(0, 11.95)), "joint", *lr(J, "upperarm"), smooth=True)
        # a longer forearm, its armour split down its length into outer and inner halves over a dark core
        pair("forearm_core", loft([(9.62, octo(.6, .7, .15, x=2.5)), (11.95, octo(.8, .9, .2, x=2.5))]), "frame",
             *lr(J, "forearm"), bevel=0.02)
        arm_side = [(-.45, 9.65), (.45, 9.65), (.65, 11.4), (.55, 12.1), (-.55, 12.1), (-.65, 11.4)]
        out = two_view([(2.56, 11.86), (2.91, 12.08), (3.22, 11.43), (3.03, 10.45), (2.80, 9.68), (2.56, 9.78)], arm_side,
                       top=[(2.5, -.7), (3.0, -.7), (3.26, 0), (3.0, .7), (2.5, .7)])
        pair_pieces("forearm_out", seam(out, (2.56, 11.45), (3.18, 11.22)), "main", *lr(J, "forearm"), bevel=0.03)
        pair("elbow_actuator", piston((2.5, .62, 12.35), (2.5, .56, 11.55), r=.09), "joint", *lr(J, "forearm"), smooth=True)
        pair("forearm_in", two_view([(2.125, 9.65), (2.44, 9.65), (2.44, 12.0), (2.0, 12.0), (1.95, 11.4)], arm_side),
             "main", *lr(J, "forearm"), bevel=0.04)
        pair("forearm_plate", two_view([(2.98, 10.3), (3.12, 10.3), (3.26, 11.3), (3.12, 11.3)],
                                       [(-.5, 10.25), (.5, 10.25), (.6, 11.35), (-.6, 11.35)]), "accent", *lr(J, "forearm"), bevel=0.02)
        pair("elbow_guard", two_view([(2.1, 11.5), (3.0, 11.5), (3.0, 12.2), (2.55, 12.45), (2.1, 12.2)],
                                     [(.45, 11.45), (.8, 11.55), (1.0, 11.95), (.8, 12.35), (.45, 12.4)]), "main",
             *lr(J, "forearm"), bevel=0.03)
        pair("wrist_guard", loft([(9.6, octo(.98, 1.04, .22, x=2.52)), (9.8, octo(1.02, 1.08, .24, x=2.52))]), "accent",
             *lr(J, "forearm"), bevel=0.02)
        pair("wrist", cylinder(.28, 9.4, 9.75, 10, at=(2.5, 0)), "joint", *lr(J, "hand"), smooth=True)
        pair("palm", loft([(8.9, octo(.5, .82, .1, x=2.52)), (9.5, octo(.46, .8, .1, x=2.52))]), "frame", *lr(J, "hand"), bevel=0.02)
        pair("fingers", loft([(8.75, octo(.42, .82, .13, x=2.27)), (9.35, octo(.44, .82, .13, x=2.27))]), "frame",
             *lr(J, "hand"), bevel=0.025)
        pair("thumb", loft([(9.02, octo(.24, .24, .06, x=2.32, y=-.5)), (9.4, octo(.26, .26, .06, x=2.38, y=-.46))]), "frame",
             *lr(J, "hand"), bevel=0.02)
        pair("hand_guard", two_view([(2.72, 9.0), (2.86, 9.05), (2.86, 9.55), (2.72, 9.55)],
                                    [(-.4, 9.0), (.4, 9.0), (.42, 9.55), (-.42, 9.55)]), "main", *lr(J, "hand"), bevel=0.015)
    
    
    def build_legs(J):
        pair("hip_ball", cylinder(.5, .55, 1.6, 12, axis="x", at=(0, 10.55)), "joint", *lr(J, "thigh"), smooth=True)
        pair("thigh_core", loft([(6.7, octo(.8, .95, .22, x=1.2)), (9.0, octo(1.3, 1.45, .34, x=1.18)),
                                 (10.25, octo(1.15, 1.3, .3, x=1.15))]), "frame", *lr(J, "thigh"), bevel=BEVEL)
        # thigh shells taper to the knee, with dark channels between them
        tf = two_view([(.72, 9.95), (1.62, 9.95), (1.95, 9.32), (1.72, 8.58), (1.53, 7.36), (.91, 7.36), (.63, 8.40), (.49, 9.24)],
                      [(-.96, 7.3), (-.55, 7.3), (-.55, 9.95), (-.86, 9.95), (-1.02, 8.6)],
                      top=[(.4, -.5), (2.0, -.5), (2.0, -.8), (1.22, -1.12), (.4, -.8)])
        pair_pieces("thigh_front", seam(tf, (.64, 8.72), (1.79, 8.94)), "main", *lr(J, "thigh"), bevel=0.04)
        pair("thigh_panel", two_view([(1.0, 7.72), (1.36, 7.72), (1.4, 7.8), (1.4, 8.3), (1.34, 8.37), (1.02, 8.37), (.96, 8.3), (.96, 7.8)],
                                     [(-1.04, 7.65), (-.94, 7.65), (-.94, 8.42), (-1.0, 8.42)]), "frame", *lr(J, "thigh"), bevel=0.01)
        pair("thigh_outer", two_view([(1.66, 7.45), (1.8, 7.5), (2.12, 9.3), (1.96, 9.75)],
                                     [(-.42, 7.45), (.5, 7.45), (.62, 9.6), (-.5, 9.6)]), "main", *lr(J, "thigh"), bevel=0.03)
        pair("thigh_rear", two_view([(.82, 7.45), (1.58, 7.45), (1.86, 9.4), (.56, 9.4)],
                                    [(.36, 7.45), (.55, 7.45), (.84, 9.4), (.62, 9.4)]), "main", *lr(J, "thigh"), bevel=0.03)
    
        pair("knee_joint", cylinder(.5, .65, 1.75, 12, axis="x", at=(0, 6.1)), "joint", *lr(J, "shin"), smooth=True)
        pair("knee_disc", cylinder(.48, 1.78, 1.98, 16, axis="x", at=(.1, 6.15)), "accent", *lr(J, "shin"), smooth=True)
        pair("knee_lens", cylinder(.3, 1.98, 2.04, 16, axis="x", at=(.1, 6.15)), "sensor", *lr(J, "shin"), smooth=True)
        pair("kneecap", two_view([(.75, 5.85), (1.65, 5.85), (1.72, 6.5), (1.2, 6.95), (.68, 6.5)],
                                 [(-1.15, 5.85), (-.6, 5.85), (-.55, 6.7), (-.82, 6.95), (-1.15, 6.3)],
                                 top=[(.6, -.4), (1.8, -.4), (1.8, -.85), (1.2, -1.2), (.6, -.85)]), "main",
             *lr(J, "shin"), bevel=0.04)
        pair("shin_core", loft([(1.75, octo(.85, 1.0, .22, x=1.2, y=.1)), (5.8, octo(1.0, 1.15, .26, x=1.2))]), "frame",
             *lr(J, "shin"), bevel=0.03)
        # one envelope (narrow ankle, calf bulge high and back) cut into front, outer, inner and rear shells
        env = loft([(1.85, octo(1.1, 1.3, .3, x=1.2, y=.05)), (3.0, octo(1.35, 1.6, .38, x=1.2, y=.15)),
                    (4.3, octo(1.65, 2.0, .45, x=1.2, y=.3)), (5.6, octo(1.2, 1.45, .32, x=1.2, y=.05))])
        parts = {"shin_front": dict(y=(-2, -.2)), "shin_outer": dict(x=(1.5, 3), y=(-.08, .62)),
                 "shin_inner": dict(x=(-1, .9), y=(-.08, .62)), "shin_rear": dict(y=(.74, 3))}
        for name, box in parts.items():
            pair(name, clip(copy(env), **box), "main", *lr(J, "shin"), bevel=0.03)
        env.free()
        sp = two_view([(.80, 5.42), (1.49, 5.42), (1.70, 4.55), (1.57, 3.40), (1.43, 2.08), (.96, 2.08), (.77, 3.45), (.65, 4.52)],
                      [(-.8, 2.05), (-.62, 2.05), (-.68, 5.44), (-.86, 5.44), (-.92, 4.3)],
                      top=[(.6, -.5), (1.75, -.5), (1.75, -.66), (1.17, -.98), (.6, -.66)])
        pair_pieces("shin_plate", seam(sp, (.75, 3.60), (1.59, 3.25), gap=.06), "main", *lr(J, "shin"), bevel=0.03)
        for k, x in (("i", .86), ("o", 1.54)):
            pair(f"knee_rail_{k}", loft([(6.45, octo(.18, .25, .04, x=x, y=.18)), (7.4, octo(.18, .25, .04, x=x, y=.18))]), "frame",
                 *lr(J, "shin"), bevel=0.015)
        pair("knee_actuator", piston((1.2, .62, 7.25), (1.2, .74, 5.55), r=.1), "joint", *lr(J, "shin"), smooth=True)
        pair("calf_blister", two_view([(.78, 4.25), (1.62, 4.25), (1.62, 5.05), (.78, 5.05)],
                                      [(.85, 4.3), (1.58, 4.55), (1.5, 5.05), (.85, 5.05)]), "main", *lr(J, "shin"), bevel=0.04)
        pair("achilles", piston((1.2, .72, 2.4), (1.2, .86, 1.75), r=.07), "joint", *lr(J, "shin"), smooth=True)
        pair("shin_side", two_view([(1.9, 2.8), (2.02, 2.85), (2.1, 4.4), (1.98, 4.45)],
                                   [(-.3, 2.8), (.6, 2.8), (.75, 4.4), (-.2, 4.4)]), "accent", *lr(J, "shin"), bevel=0.02)
        pair("calf_vent", slats(.95, 1.45, 2.4, 3.1, 1.0, 3, depth=.08), "frame", *lr(J, "shin"))
        nozzle_pair("calf", (1.2, 1.38, 4.4), (0, .5, -.85), .3, .5, *lr(J, "shin"), housing=False)
    
    
        pair("ankle", cylinder(.42, .75, 1.65, 12, axis="x", at=(.1, 1.55)), "joint", *lr(J, "foot"), smooth=True)
        foot_plan = [(.95, -2.3), (1.45, -2.3), (1.7, -2.05), (1.85, -1.0), (1.80, 1.2), (.60, 1.2), (.55, -1.0), (.7, -2.05)]
        # the spat: a ridged guard over the front of the ankle, riding on the foot
        pair("ankle_spat", two_view([(.62, 1.05), (1.78, 1.05), (1.7, 2.02), (1.2, 2.24), (.7, 2.02)],
                                    [(-.98, 1.05), (-.5, 1.05), (-.45, 2.0), (-.7, 2.24), (-1.02, 1.6)],
                                    top=[(.5, -.3), (1.9, -.3), (1.9, -.8), (1.2, -1.06), (.5, -.8)]), "main", *lr(J, "foot"), bevel=.03)
        pair("instep", two_view([(.55, .15), (1.85, .15), (1.8, .9), (1.5, 1.12), (.9, 1.12), (.6, .9)],
                                [(-.9, .15), (.9, .15), (.85, 1.0), (.2, 1.2), (-.85, 1.1)], top=foot_plan), "main", *lr(J, "foot"), bevel=.03)
        pair("toe_base", two_view([(.58, .12), (1.82, .12), (1.78, .78), (.62, .78)],
                                  [(-1.55, .12), (-.98, .12), (-.95, 1.0), (-1.5, .86)], top=foot_plan), "main", *lr(J, "foot"), bevel=.03)
        pair("toe", two_view([(.58, .1), (1.82, .1), (1.78, .74), (.62, .74)],
                             [(-2.3, .1), (-1.62, .1), (-1.6, .84), (-2.0, .7), (-2.3, .3)], top=foot_plan), "trim", *lr(J, "foot"), bevel=.04)
        pair("heel", two_view([(.62, .1), (1.8, .1), (1.76, .98), (.66, .98)],
                              [(.86, .1), (1.62, .1), (1.66, .5), (1.36, .98), (.86, 1.08)]), "trim", *lr(J, "foot"), bevel=.04)
        pair("ankle_guard", two_view([(1.8, .35), (1.96, .4), (1.96, 1.2), (1.8, 1.26)],
                                     [(-.62, .35), (.72, .35), (.62, 1.2), (-.5, 1.2)]), "accent", *lr(J, "foot"), bevel=.02)
        for k, (y0, y1) in (("front", (-2.15, -.95)), ("back", (-.85, 1.1))):
            pad = [(x, min(max(y, y0), y1)) for x, y in [(.84, -2.15), (1.56, -2.15), (1.84, -1.0), (1.7, 1.08), (.7, 1.08), (.56, -1.0)]]
            pair(f"sole_{k}", prism(pad, 0.0, 0.14, "xy"), "joint", *lr(J, "foot"), bevel=.02)
    
    
    def build_backpack(J):
        B = J["backpack"]
        solid("back_mount", loft([(1.2, octo(1.8, 2.2, .4, y=13.8)), (1.95, octo(1.7, 2.1, .4, y=13.8))], axis="y"), "frame", B, BEVEL)
        solid("reactor", loft([(1.9, circle(.85, 12, 0, 13.9)), (2.85, circle(.5, 12, 0, 13.9))], axis="y"), "main", B, smooth=True)
        solid("reactor_ring", loft([(2.0, circle(.95, 12, 0, 13.9)), (2.2, circle(.95, 12, 0, 13.9))], axis="y"), "accent", B,
              smooth=True)
        solid("reactor_tip", loft([(2.82, circle(.54, 12, 0, 13.9)), (3.0, circle(.46, 12, 0, 13.9))], axis="y"), "frame", B,
              smooth=True)
        solid("reactor_glow", loft([(2.92, circle(.22, 12, 0, 13.9)), (2.95, circle(.22, 12, 0, 13.9))], axis="y"), "glow_core", B)
        for s, sx in (("L", 1), ("R", -1)):
            m = Matrix.Translation((.9 * sx, 2.25, 14.7)) @ rot("Y", 32 * sx) @ rot("X", -28)
            pivot = Vector((.9 * sx, 2.25, 14.7))
            solid(f"binder_hinge.{s}", cylinder(.225, pivot.x - .25, pivot.x + .25, 12, axis="x", at=(pivot.y, pivot.z)), "joint",
                  J["binder", s], smooth=True)
            for k, dy in (("a", -.2), ("b", .2)):
                solid(f"binder_fork{k}.{s}", two_view([(pivot.x - .28, 14.35), (pivot.x + .28, 14.35), (pivot.x + .28, 14.95), (pivot.x - .28, 14.95)],
                                                     [(2.0 + dy - .06, 14.35), (2.0 + dy + .06, 14.35), (2.25 + dy + .06, 14.95), (2.25 + dy - .06, 14.95)]),
                      "frame", B, bevel=0.015)
            # a dark spar between two thin blades
            spar = loft([(-.7, octo(.22, .3, .06)), (2.3, octo(.16, .24, .04))])
            solid(f"binder_spar.{s}", transform(spar, m), "frame", J["binder", s], bevel=0.015)
            for k, bx in (("a", .12), ("b", -.12)):
                blade = prism([(-.38, -.6), (.36, -.5), (.24, 2.1), (-.16, 2.25)], bx - .06, bx + .06, "yz")
                solid(f"binder_blade{k}.{s}", transform(blade, m), "main", J["binder", s], bevel=0.02)
            tip = loft([(1.9, octo(.32, .44, .08)), (2.6, octo(.2, .3, .05))])
            solid(f"binder_tip.{s}", transform(tip, m), "accent", J["binder", s], bevel=0.015)
            bell, glow = nozzle(.3, .55)
            down = m.to_3x3() @ Vector((0, 0, -1))
            at = m @ Vector((0, 0, -.7))
            solid(f"binder_nozzle.{s}", place(bell, at, down), "frame", J["binder", s], smooth=True)
            solid(f"binder_nozzle.{s}.glow", place(glow, at, down), "glow_thruster", J["binder", s])
            empty(f"nozzle.binder.{s}", at + down * .55, J["binder", s], dir=gltf_dir(down), radius=.3)
            hilt = transform(cylinder(.14, 0, 1.15, 8), Matrix.Translation((.62 * sx, 2.05, 14.85)) @ rot("X", -30))
            solid(f"saber_hilt.{s}", hilt, "frame", B, smooth=True)
            cap = transform(cylinder(.17, 1.0, 1.2, 8), Matrix.Translation((.62 * sx, 2.05, 14.85)) @ rot("X", -30))
            solid(f"saber_cap.{s}", cap, "trim", B, smooth=True)
        nozzle_pair("main", (.55, 2.05, 12.65), (0, .45, -.9), .42, .8, B, B)
    
    
    def build_striker():
        J = joints()
        build_pelvis(J)
        build_waist(J)
        build_torso(J)
        build_head(J)
        J["neck"].location.z -= .24  # the head sits down between the collar plates
        build_arms(J)
        build_legs(J)
        build_backpack(J)
        return J["frame"]
  • Bashsed -n 60,200p src/view/viewer.ts && sed -n 36,66p src/render/assets.ts && cat src/render/look.ts | head -60

    command

    sed -n 60,200p src/view/viewer.ts && sed -n 36,66p src/render/assets.ts && cat src/render/look.ts | head -60

    result, 174 lines

      async function frame(palette: PaletteName, x: number, mech: ModelName = 'striker') {
        const root = await model(mech, palette);
        root.position.x = x;
        scene.add(root);
        if (mech === 'striker') applyDecals(root, STRIKER_DECALS);
        treatEyes(root, (q.get('eye') ?? 'spill') as EyeMode);
        const rig = new MechRig(root);
        rig.apply(POSES[pose] ?? POSES.stand);
        if (weapon) {
          rig.hold(await model(weapon, palette));
          // weapons are striker sized: scale to the frame's height
          const h = root.getObjectByName('frame')?.userData.height as number | undefined;
          if (h) rig.held!.scale.setScalar(h / 17.6);
        }
        return root;
      }
    
      if (name === 'lineup') {
        await frame('merc', -6);
        await frame('automaton', 6);
        target.set(0, 9, 0);
      } else if (name === 'striker') {
        await frame((q.get('palette') ?? 'merc') as PaletteName, 0);
        target.set(0, 9, 0);
      } else if (FRAMES.includes(name)) {
        const root = await frame((q.get('palette') ?? 'merc') as PaletteName, 0, name);
        new THREE.Box3().setFromObject(root).getCenter(target);
      } else {
        const root = await model(name, (q.get('palette') ?? 'merc') as PaletteName);
        treatEyes(root, (q.get('eye') ?? 'spill') as EyeMode, q.has('t') ? Number(q.get('t')) : null);
        scene.add(root);
        // ?only=slot2 shows one variant of a lab lineup
        const only = q.get('only');
        if (only) root.traverse((o) => { if (/^slot\d+$/.test(o.name) && o.name !== only) o.visible = false; });
        // ?view=ship&bays=light,heavy&frame=light fits the bays and the shuttle clamps
        if (name === 'ship') {
          const ids = (s: string | null, n: number) => (s?.split(',') ?? []).concat(Array(n).fill('standard')).slice(0, n) as FrameClassId[];
          fitShip(root, ids(q.get('bays'), 2), ids(q.get('frame'), 1)[0]);
        }
        // ?bearings=1 puts a test emblem on every bearing anchor (bearing.*), in the palette's trim colour
        if (q.has('bearings')) applyDecals(root, bearingDecals(root, PALETTES[(q.get('palette') ?? 'merc') as PaletteName].trim.color));
        const box = new THREE.Box3().setFromObject(root);
        box.getCenter(target);
      }
      // ?sil=1: flat black forms on a white ground, for judging silhouettes without paint or stencils
      if (q.has('sil')) {
        const black = new THREE.MeshBasicMaterial({ color: 0x000000 });
        scene.traverse((o) => {
          const m = o as THREE.Mesh;
          if (m.isMesh) m.material = black;
          else if ((o as THREE.Sprite).isSprite || (o as THREE.Points).isPoints) o.visible = false;
        });
        scene.background = new THREE.Color('#ffffff');
        // the low tier drops the edge detail, bloom and grade passes, which would draw over the forms
        pipe.setQuality({ tier: 'low' });
      }
      const dist = Number(q.get('dist') ?? 36);
      const yaw = THREE.MathUtils.degToRad(Number(q.get('yaw') ?? 30));
      const pitch = THREE.MathUtils.degToRad(Number(q.get('pitch') ?? 8));
      if (q.has('ty')) target.y = Number(q.get('ty'));
      if (q.has('tx')) target.x = Number(q.get('tx'));
      if (q.has('tz')) target.z = Number(q.get('tz'));
      camera.position.set(Math.sin(yaw) * Math.cos(pitch), Math.sin(pitch), Math.cos(yaw) * Math.cos(pitch)).multiplyScalar(dist).add(target);
      followSun(sun, target);
      if (name !== 'striker' && name !== 'lineup' && !FRAMES.includes(name)) {
        const c = sun.shadow.camera;
        c.left = c.bottom = -dist;
        c.right = c.top = dist;
        c.far = dist * 20;
        c.updateProjectionMatrix();
      }
      camera.lookAt(target);
      const controls = new OrbitControls(camera, canvas);
      controls.target.copy(target);
      controls.update();
      window.addEventListener('resize', () => pipe.resize());
      const loop = () => {
        pipe.render();
        requestAnimationFrame(loop);
      };
      loop();
      (window as unknown as { __ready: boolean }).__ready = true;
    }
      return out.buffer;
    }
    
    /** Models loading now and loaded so far, for a loading indicator. */
    export const loading = { pending: 0, done: 0, listeners: new Set<() => void>() };
    function track<T>(p: Promise<T>): Promise<T> {
      loading.pending++;
      const tell = () => {
        for (const f of loading.listeners) f();
      };
      tell();
      const end = () => {
        loading.pending--;
        loading.done++;
        tell();
      };
      p.then(end, end);
      return p;
    }
    
    function source(name: ModelName, merge = true): Promise<THREE.Object3D> {
      const key = merge ? name : `${name}:parts`;
      let p = sources.get(key);
      if (!p) {
        const url = (ok: boolean) => `${import.meta.env.BASE_URL}assets/${name}.${ok ? EXT : `q.${EXT}`}`;
        p = track(meshopt.then((ok) => fetchGlb(url(ok))).then((glb) => parseModel(glb, merge)));
        sources.set(key, p);
      }
      return p;
    }
    
    import * as THREE from 'three';
    
    // The rendering style: how much edge wear, recess grime, ink lining, paint variation and film grain.
    // Two candidates under review: a weathered "field" machine and a clean "kit" (a painted model kit).
    
    export interface Look {
      name: 'field' | 'kit' | 'service' | 'sketch';
      /** Convex edges lightened (worn paint catching light), 0..1. */
      ridge: number;
      /** Recesses and seams darkened (grime), 0..1. */
      valley: number;
      /** Dark lining at creases, seams and silhouettes, 0..1. */
      ink: number;
      /** Paint variation across surfaces (albedo and roughness noise), 0..1. */
      grime: number;
      /** Film grain and vignette strength, 0..1. */
      grain: number;
      vignette: number;
      /** Paint finish: roughness for armour paint and whether it has a clear coat. */
      paintRough: number;
      gloss: boolean;
      /** Edges chip to bare metal in a broken pattern (field) instead of a clean highlight (kit). */
      chipped: boolean;
      /** How far paint colours are pulled toward grey (weathered field paint). */
      desaturate: number;
      /** Soft fill from the environment, as a multiplier: low for hard field light, high for a studio look. */
      fill: number;
      /** Cel-banded lighting, pencil hatching in shadow, and a paper tone (the sketch look). */
      toon?: boolean;
      hatch?: number;
      paper?: number;
    }
    
    export const LOOKS: Record<Look['name'], Look> = {
      field: { name: 'field', ridge: 0.85, valley: 0.7, ink: 0.15, grime: 1, grain: 0.045, vignette: 0.35, paintRough: 0.66, gloss: false,
        chipped: true, desaturate: 0.28, fill: 0.5 },
      kit: { name: 'kit', ridge: 0.22, valley: 0.2, ink: 0.95, grime: 0, grain: 0, vignette: 0.12, paintRough: 0.32, gloss: true,
        chipped: false, desaturate: 0, fill: 1.15 },
      // between field and kit: kit's lining at two-thirds, field's wear at a lighter touch, semi-matte
      service: { name: 'service', ridge: 0.5, valley: 0.45, ink: 0.6, grime: 0.5, grain: 0.025, vignette: 0.25, paintRough: 0.48, gloss: false,
        chipped: true, desaturate: 0.12, fill: 0.85 },
      sketch: { name: 'sketch', ridge: 0.1, valley: 0.25, ink: 1, grime: 0, grain: 0.02, vignette: 0.2, paintRough: 0.55, gloss: false,
        chipped: false, desaturate: 0.12, fill: 0.85, toon: true, hatch: 1, paper: 1 },
    };
    
    let current: Look = LOOKS.field;
    export const look = () => current;
    export function setLook(name: string | null) {
      current = LOOKS[(name as Look['name']) ?? 'field'] ?? LOOKS.field;
      return current;
    }
    
    /** Screen-space surface detail from the normal/depth pre-[redacted: scan false positive] wear, grime, ink. */
    export const DetailShader = {
      uniforms: {
        tDiffuse: { value: null },
        tNormal: { value: null },
        tDepth: { value: null },
        px: { value: new THREE.Vector2(1, 1) },
        near: { value: 0.5 },
  • Bashcat vite.config.ts | head -30; (ss -ltnp 2>/dev/null | grep -E ":52[0-9][0-9]|:5199" | head)

    command

    cat vite.config.ts | head -30; (ss -ltnp 2>/dev/null | grep -E ":52[0-9][0-9]|:5199" | head)

    result, 9 lines

    import { defineConfig } from 'vite';
    
    export default defineConfig({
      // relative paths so the build runs from any folder (an artifact page, a static host)
      base: './',
      server: { port: 5199 },
      test: { environment: 'node', include: ['src/**/*.test.ts', 'tools/**/*.test.mjs'] },
    } as never);
    LISTEN 0      4096                 [redacted: tailnet ip]%tailscale0:52548      0.0.0.0:*
  • Bashexec node node_modules/vite/bin/vite.js --host 127.0.0.1 --port 5261 --strictPort --logLevel error

    command

    exec node node_modules/vite/bin/vite.js --host 127.0.0.1 --port 5261 --strictPort --logLevel error

    result, 1 line

    Command running in background with ID: b3p6jjp70. Output is being written to: [redacted: private path]/tasks/b3p6jjp70.output. You will be notified when it completes — do not poll that file or sleep while waiting. Read the file only if the user asks for progress, or if you need a line it prints before you can go on, such as a server's ready line or port.
  • Bashuntil curl -s -o /dev/null --max-time 2 http://127.0.0.1:5261/; do sleep 1; done; mkdir -p review/out/fable52/r2 && SORTIE_URL=http://127.0.0.1:5261 W=800 H=1000 SHOOT_TIMEOUT=120000 node tools/shoot.mjs review/out/fable52/r2/s "back=/?view=striker&yaw=205&pitch=10&dist=44" "front=/?view=striker&yaw=28&pitch=6&dist=44" 2>&1 | tail -3 && cd review/out/fable52/r2/s && ffmpeg -loglevel error -y -i back.png -i front.png -filter_complex hstack -q:v 3 s.jpg && ls

    command

    until curl -s -o /dev/null --max-time 2 http://127.0.0.1:5261/; do sleep 1; done; mkdir -p review/out/fable52/r2 && SORTIE_URL=http://127.0.0.1:5261 W=800 H=1000 SHOOT_TIMEOUT=120000 node tools/shoot.mjs review/out/fable52/r2/s "back=/?view=striker&yaw=205&pitch=10&dist=44" "front=/?view=striker&yaw=28&pitch=6&dist=44" 2>&1 | tail -3 && cd review/out/fable52/r2/s && ffmpeg -loglevel error -y -i back.png -i front.png -filter_complex hstack -q:v 3 s.jpg && ls

    result, 6 lines

    [error] Failed to load resource: the server responded with a status of 403 (Forbidden)
    [error] Failed to load resource: the server responded with a status of 403 (Forbidden)
    front: 26284 ms
    back.png
    front.png
    s.jpg

agent

+32:39

Starting the owner's new ask: a refined mech of my own on outline 0. First I'm looking closely at the striker so I know the level to match.

  • Read~/Projects/sortie-wt/fable52/review/out/fable52/r2/s/s.jpgno result

    input

    {
      "file_path": "~/Projects/sortie-wt/fable52/review/out/fable52/r2/s/s.jpg"
    }