agent

+1:21
reasoning

img_0.jpeg shows a clear pattern, and img_1.jpeg and img_2.jpeg seem to repeat it, or show something related. Observing patterns visually in the images should provide a direct path to understanding.

The initial observation suggested a pattern, but further analysis reveals a significant contrast between two representations. The left image demonstrates a machine-like quality through spatial context, lighting, and segmentation. In contrast, the right image appears rigid and toy-like, lacking the nuanced details present in the first.

The refrigerator image presents a starkly artificial aesthetic, characterized by its flat surfaces, exposed scaffolding, and lack of visual detail, resembling a 3D-printed toy. Comparing this to the knight board images reveals a preference for complex, curved surfaces and asymmetrical details in the knight designs (A, B, C, D) over a more simplistic earlier version (Round 1). Closer inspection of the knight designs (A, B, C, D) suggests that even these complex forms exhibit an underlying artificiality, potentially influencing severian's stated preference.

The images reveal a consistent visual style: mannequin-like figures with a rigid, artificial aesthetic. The 'frame' underpinning the figures is evident, characterized by boxy joints and a lack of organic detail. This standardized framework extends from the arms and legs down, resulting in figures that are essentially clones from the waist down, all under flat, diffuse studio lighting. Further inspection of the codebase is necessary before drawing definitive conclusions.

  • run_command{"CommandLine":"ls -la ~/work/sortie/src/render ~/work/sortie/src/view ~/work/sortie/kit/blocks ~/work/sortie/kit/lab ~/work/sortie/kit/makers ~/work/sortie/public/assets | head -n 120","WaitMsBeforeAsync":5000,"toolSummary":"List render, view, kit subdirs and assets"}

    input

    {
      "CommandLine": "ls -la ~/work/sortie/src/render ~/work/sortie/src/view ~/work/sortie/kit/blocks ~/work/sortie/kit/lab ~/work/sortie/kit/makers ~/work/sortie/public/assets | head -n 120",
      "WaitMsBeforeAsync": 5000,
      "toolSummary": "List render, view, kit subdirs and assets"
    }

    result, 123 lines

    Command exited with code 0.
    
    Command output:
    ~/work/sortie/kit/blocks:
    total 12
    drwx------ 2 runner runner 4096 Nov 14 23:20 .
    drwx------ 5 runner runner 4096 Nov 14 23:20 ..
    -rw------- 1 runner runner    0 Nov 14 23:20 __init__.py
    -rw------- 1 runner runner  331 Nov 14 23:20 dummy.py
    
    ~/work/sortie/kit/lab:
    total 280
    drwx------ 2 runner runner  4096 Nov 14 23:20 .
    drwx------ 5 runner runner  4096 Nov 14 23:20 ..
    -rw------- 1 runner runner  9158 Nov 14 23:20 assembly.py
    -rw------- 1 runner runner  2206 Nov 14 23:20 atelier_board.py
    -rw------- 1 runner runner  1812 Nov 14 23:20 atelier_lab.py
    -rw------- 1 runner runner 22504 Nov 14 23:20 backkit.py
    -rw------- 1 runner runner 21490 Nov 14 23:20 board_heraldic.py
    -rw------- 1 runner runner 17731 Nov 14 23:20 board_plate.py
    -rw------- 1 runner runner 15740 Nov 14 23:20 board_sleek.py
    -rw------- 1 runner runner 20119 Nov 14 23:20 board_tourney.py
    -rw------- 1 runner runner 39323 Nov 14 23:20 bodykit.py
    -rw------- 1 runner runner 10357 Nov 14 23:20 chestkit.py
    -rw------- 1 runner runner 37640 Nov 14 23:20 headkit.py
    -rw------- 1 runner runner 16334 Nov 14 23:20 heads.py
    -rw------- 1 runner runner 26120 Nov 14 23:20 knightkit.py
    -rw------- 1 runner runner  2407 Nov 14 23:20 pattern_lab.py
    -rw------- 1 runner runner  1944 Nov 14 23:20 pilotlab.py
    -rw------- 1 runner runner  1662 Nov 14 23:20 sizes.py
    
    ~/work/sortie/kit/makers:
    total 92
    drwx------ 2 runner runner  4096 Nov 14 23:20 .
    drwx------ 5 runner runner  4096 Nov 14 23:20 ..
    -rw------- 1 runner runner     0 Nov 14 23:20 __init__.py
    -rw------- 1 runner runner 35108 Nov 14 23:20 atelier.py
    -rw------- 1 runner runner 36676 Nov 14 23:20 pattern.py
    -rw------- 1 runner runner 12117 Nov 14 23:20 shell.py
    
    ~/work/sortie/public/assets:
    total 173240
    drwx------ 2 runner runner     4096 Nov 14 23:20 .
    drwx------ 3 runner runner     4096 Nov 14 23:20 ..
    -rw------- 1 runner runner    97212 Nov 14 23:20 alien_acicular.glb
    -rw------- 1 runner runner   120312 Nov 14 23:20 alien_druse.glb
    -rw------- 1 runner runner   282936 Nov 14 23:20 alien_druse_mimic.glb
    -rw------- 1 runner runner   710368 Nov 14 23:20 alien_geode.glb
    -rw------- 1 runner runner  1484272 Nov 14 23:20 auto_ledger.glb
    -rw------- 1 runner runner  1179792 Nov 14 23:20 auto_tally.glb
    -rw------- 1 runner runner   852852 Nov 14 23:20 auto_tick.glb
    -rw------- 1 runner runner    25452 Nov 14 23:20 cannon.glb
    -rw------- 1 runner runner   245152 Nov 14 23:20 cockpit.glb
    -rw------- 1 runner runner  1438116 Nov 14 23:20 cockpit_light.glb
    -rw------- 1 runner runner    69016 Nov 14 23:20 drone.glb
    -rw------- 1 runner runner    55596 Nov 14 23:20 escape_pod.glb
    -rw------- 1 runner runner  1532780 Nov 14 23:20 heavy.glb
    -rw------- 1 runner runner  1596768 Nov 14 23:20 heavy_B.glb
    -rw------- 1 runner runner  1512944 Nov 14 23:20 heavy_C.glb
    -rw------- 1 runner runner  6729808 Nov 14 23:20 lab_alien.glb
    -rw------- 1 runner runner  6134544 Nov 14 23:20 lab_atelier.glb
    -rw------- 1 runner runner 14187700 Nov 14 23:20 lab_atelier_a.glb
    -rw------- 1 runner runner 10801072 Nov 14 23:20 lab_atelier_b.glb
    -rw------- 1 runner runner 11706000 Nov 14 23:20 lab_atelier_c.glb
    -rw------- 1 runner runner 11717484 Nov 14 23:20 lab_atelier_d.glb
    -rw------- 1 runner runner  6307036 Nov 14 23:20 lab_auto.glb
    -rw------- 1 runner runner  8216648 Nov 14 23:20 lab_backs.glb
    -rw------- 1 runner runner   283132 Nov 14 23:20 lab_chests.glb
    -rw------- 1 runner runner   277820 Nov 14 23:20 lab_chests2.glb
    -rw------- 1 runner runner   529028 Nov 14 23:20 lab_chests3.glb
    -rw------- 1 runner runner  6951676 Nov 14 23:20 lab_chests4.glb
    -rw------- 1 runner runner   155308 Nov 14 23:20 lab_feet.glb
    -rw------- 1 runner runner   148000 Nov 14 23:20 lab_feet2.glb
    -rw------- 1 runner runner   430680 Nov 14 23:20 lab_feet3.glb
    -rw------- 1 runner runner  6416784 Nov 14 23:20 lab_frames.glb
    -rw------- 1 runner runner   163260 Nov 14 23:20 lab_heads.glb
    -rw------- 1 runner runner   471472 Nov 14 23:20 lab_heads2.glb
    -rw------- 1 runner runner  1033232 Nov 14 23:20 lab_heads3.glb
    -rw------- 1 runner runner   714520 Nov 14 23:20 lab_heads4.glb
    -rw------- 1 runner runner   697628 Nov 14 23:20 lab_heads5.glb
    -rw------- 1 runner runner   900656 Nov 14 23:20 lab_heads6.glb
    -rw------- 1 runner runner   979832 Nov 14 23:20 lab_heads7.glb
    -rw------- 1 runner runner  1119580 Nov 14 23:20 lab_heads8.glb
    -rw------- 1 runner runner  5656964 Nov 14 23:20 lab_heavy.glb
    -rw------- 1 runner runner  6683852 Nov 14 23:20 lab_light.glb
    -rw------- 1 runner runner  6240172 Nov 14 23:20 lab_pattern.glb
    -rw------- 1 runner runner  2391752 Nov 14 23:20 lab_pilot.glb
    -rw------- 1 runner runner  8038888 Nov 14 23:20 lab_raider.glb
    -rw------- 1 runner runner  7861896 Nov 14 23:20 lab_show.glb
    -rw------- 1 runner runner  7868532 Nov 14 23:20 lab_show_v.glb
    -rw------- 1 runner runner  6919124 Nov 14 23:20 lab_sizes.glb
    -rw------- 1 runner runner  1592796 Nov 14 23:20 light.glb
    -rw------- 1 runner runner  1419452 Nov 14 23:20 light_lancer.glb
    -rw------- 1 runner runner  1477908 Nov 14 23:20 light_line.glb
    -rw------- 1 runner runner  1435856 Nov 14 23:20 pattern_m.glb
    -rw------- 1 runner runner  1671740 Nov 14 23:20 raider_boss.glb
    -rw------- 1 runner runner  1880608 Nov 14 23:20 raider_brawler.glb
    -rw------- 1 runner runner  1634808 Nov 14 23:20 raider_grunt.glb
    -rw------- 1 runner runner    45456 Nov 14 23:20 rifle.glb
    -rw------- 1 runner runner   106456 Nov 14 23:20 salvage_pod.glb
    -rw------- 1 runner runner  1303976 Nov 14 23:20 ship.glb
    -rw------- 1 runner runner   738340 Nov 14 23:20 station.glb
    -rw------- 1 runner runner  1008336 Nov 14 23:20 striker.glb
    -rw------- 1 runner runner  1325664 Nov 14 23:20 striker_a.glb
    -rw------- 1 runner runner  1210224 Nov 14 23:20 striker_b.glb
    -rw------- 1 runner runner   462204 Nov 14 23:20 wreck_field.glb
    
    ~/work/sortie/src/render:
    total 232
    drwx------ 2 runner runner  4096 Nov 14 23:20 .
    drwx------ 8 runner runner  4096 Nov 14 23:20 ..
    -rw------- 1 runner runner 18089 Nov 14 23:20 aliens.ts
    -rw------- 1 runner runner  9191 Nov 14 23:20 assets.ts
    -rw------- 1 runner runner  5077 Nov 14 23:20 debris.ts
    -rw------- 1 runner runner  6077 Nov 14 23:20 decals.ts
    -rw------- 1 runner runner 10233 Nov 14 23:20 effects.ts
    -rw------- 1 runner runner  8371 Nov 14 23:20 eject.ts
    -rw------- 1 runner runner  9771 Nov 14 23:20 enemies.ts
    -rw------- 1 runner runner  7806 Nov 14 23:20 exhaust.test.ts
    -rw------- 1 runner runner  7330 Nov 14 23:20 exhaust.ts
    -rw------- 1 runner runner  6515 Nov 14 23:20 eyes.ts
    -rw------- 1 runner runner 11208 Nov 14 23:20 look.ts
    -rw------- 1 runner runner  6851 Nov 14 23:20 materials.ts
  • read_file{"Path":"~/work/sortie/tools/outlines-lib.mjs"}

    input

    {
      "Path": "~/work/sortie/tools/outlines-lib.mjs"
    }

    result, 91 lines

    Showing lines 1-90 of 90
    1: // Outline sheets: rough black shapes at one scale, for reacting to in seconds (docs/handbook.md).
    2: // A spec is plain data, in metres, x across, z up, ground at z = 0, centre line at x = 0:
    3: //   { "title": "round 1", "outlines": [ { "note": "optional", "parts": [
    4: //       { "pts": [[x, z], ...], "mirror": true },     a polygon, and its mirror across x = 0
    5: //       { "circle": [x, z, r], "mirror": true } ],    a circle
    6: //     "side": [ ... same parts ... ] } ] }            optional side view, drawn beside the front
    7: const PILOT_M = 1.75;
    8: 
    9: function bounds(parts) {
    10:   let x = 0, z = 0;
    11:   for (const p of parts ?? []) {
    12:     if (p.circle) {
    13:       x = Math.max(x, Math.abs(p.circle[0]) + p.circle[2]);
    14:       z = Math.max(z, p.circle[1] + p.circle[2]);
    15:     } else for (const [px, pz] of p.pts) {
    16:       x = Math.max(x, Math.abs(px));
    17:       z = Math.max(z, pz);
    18:     }
    19:   }
    20:   return { halfWidth: x, height: z };
    21: }
    22: 
    23: function shape(p, tx, ty, s, flip) {
    24:   const sign = flip ? -1 : 1;
    25:   if (p.circle) {
    26:     const [x, z, r] = p.circle;
    27:     return `<circle cx="${(tx + sign * x * s).toFixed(1)}" cy="${(ty - z * s).toFixed(1)}" r="${(r * s).toFixed(1)}"/>`;
    28:   }
    29:   const pts = p.pts.map(([x, z]) => `${(tx + sign * x * s).toFixed(1)},${(ty - z * s).toFixed(1)}`).join(' ');
    30:   return `<polygon points="${pts}"/>`;
    31: }
    32: 
    33: function shapes(parts, tx, ty, s) {
    34:   const out = [];
    35:   for (const p of parts ?? []) {
    36:     out.push(shape(p, tx, ty, s, false));
    37:     if (p.mirror) out.push(shape(p, tx, ty, s, true));
    38:   }
    39:   return out.join('');
    40: }
    41: 
    42: /** A person for scale: plain enough not to read as part of any design. */
    43: function person(x, ground, s) {
    44:   const h = PILOT_M * s, w = Math.max(h * 0.28, 2);
    45:   return `<g fill="#b03a2e"><rect x="${(x - w / 2).toFixed(1)}" y="${(ground - h * 0.82).toFixed(1)}" width="${w.toFixed(1)}" height="${(h * 0.82).toFixed(1)}"/>` +
    46:     `<circle cx="${x.toFixed(1)}" cy="${(ground - h * 0.9).toFixed(1)}" r="${(h * 0.1).toFixed(1)}"/></g>`;
    47: }
    48: 
    49: /** The sheet as an SVG string, with its pixel size. Every outline is drawn at the same scale. */
    50: export function outlineSheet(spec, { cols = 6, tileHeight = 460 } = {}) {
    51:   const list = spec.outlines ?? [];
    52:   if (!list.length) throw new Error('outlines: the spec has no outlines');
    53:   let tall = 0, front = 0, side = 0;
    54:   for (const o of list) {
    55:     const f = bounds(o.parts), b = bounds(o.side);
    56:     tall = Math.max(tall, f.height, b.height);
    57:     front = Math.max(front, f.halfWidth);
    58:     side = Math.max(side, b.halfWidth);
    59:   }
    60:   if (tall <= 0 || front <= 0) throw new Error('outlines: nothing has any size');
    61:   const margin = { top: 34, bottom: 18, gap: 16 };
    62:   const s = (tileHeight - margin.top - margin.bottom) / tall;
    63:   const frontW = front * 2 * s, sideW = side * 2 * s;
    64:   const tileW = Math.ceil(frontW + (side ? sideW + margin.gap : 0) + margin.gap * 2 + 14);
    65:   const rows = Math.ceil(list.length / cols);
    66:   const head = spec.title ? 34 : 0;
    67:   const W = Math.min(cols, list.length) * tileW, H = rows * tileHeight + head;
    68:   const tiles = list.map((o, i) => {
    69:     const x0 = (i % cols) * tileW, y0 = Math.floor(i / cols) * tileHeight + head;
    70:     const ground = y0 + tileHeight - margin.bottom;
    71:     const fx = x0 + margin.gap + frontW / 2;
    72:     const sx = fx + frontW / 2 + margin.gap + sideW / 2;
    73:     const px = x0 + tileW - 9;
    74:     return `<rect x="${x0 + .5}" y="${y0 + .5}" width="${tileW - 1}" height="${tileHeight - 1}" fill="none" stroke="#d6d6d2"/>` +
    75:       `<line x1="${x0 + 6}" x2="${x0 + tileW - 6}" y1="${ground}" y2="${ground}" stroke="#a9a9a4"/>` +
    76:       `<text x="${x0 + 8}" y="${y0 + 22}" class="n">${i + 1}</text>` +
    77:       (o.note ? `<text x="${x0 + 38}" y="${y0 + 22}" class="t">${escapeXml(o.note)}</text>` : '') +
    78:       `<g fill="#111" stroke="#111" stroke-width=".8">${shapes(o.parts, fx, ground, s)}${o.side ? shapes(o.side, sx, ground, s) : ''}</g>` +
    79:       person(px, ground, s);
    80:   }).join('');
    81:   const title = spec.title ? `<text x="8" y="23" class="h">${escapeXml(spec.title)}</text>` : '';
    82:   const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${W}" height="${H}" viewBox="0 0 ${W} ${H}">` +
    83:     `<style>text{font-family:system-ui,sans-serif;fill:#333}.n{font-size:18px;font-weight:700}.t{font-size:12px}.h{font-size:16px;font-weight:600}</style>` +
    84:     `<rect width="${W}" height="${H}" fill="#f4f4f1"/>${title}${tiles}</svg>`;
    85:   return { svg, width: W, height: H, count: list.length, scale: s };
    86: }
    87: 
    88: function escapeXml(t) {
    89:   return String(t).replace(/[&<>"]/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' })[c]);
    90: }
  • read_file{"Path":"~/work/sortie/tools/clip.mjs"}

    input

    {
      "Path": "~/work/sortie/tools/clip.mjs"
    }

    result, 69 lines

    Showing lines 1-68 of 68
    1: // A review clip of one model: chase camera, orbit, turntable, range of motion, next to a pilot.
    2: //   node tools/clip.mjs <model> [--quick] [--shots chase,turn] [--fps 24] [--size 854x480] [--palette merc] [--look kit] [--out file.mp4]
    3: // --quick is for the loop: chase and turntable only, 12 fps, 640x360.
    4: // Starts its own dev server on a free port and always stops it. Frames are rendered one at a time, so
    5: // the clip is smooth however slow the machine (src/view/clip.ts). Writes the mp4 and, because a reader
    6: // that can't watch video still has to judge it, a contact sheet of frames beside it. Headless only.
    7: import { spawn, spawnSync } from 'node:child_process';
    8: import { mkdirSync } from 'node:fs';
    9: import { dirname, resolve } from 'node:path';
    10: import { chromium } from 'playwright';
    11: import { createServer } from 'vite';
    12: 
    13: const args = process.argv.slice(2);
    14: const flag = (name, fallback) => {
    15:   const i = args.indexOf(`--${name}`);
    16:   return i >= 0 ? args[i + 1] : fallback;
    17: };
    18: const name = args[0];
    19: if (!name || name.startsWith('--')) {
    20:   console.error('usage: node tools/clip.mjs <model> [--quick] [--shots chase,orbit,turn,bend,scale] [--fps 24] [--size 854x480] [--palette merc] [--look kit] [--out file.mp4]');
    21:   process.exit(2);
    22: }
    23: const quick = args.includes('--quick');
    24: const [w, h] = flag('size', quick ? '640x360' : '854x480').split('x').map(Number);
    25: const fps = Number(flag('fps', quick ? 12 : 24));
    26: const out = resolve(flag('out', `review/out/one-mech/clips/${name}.mp4`));
    27: const params = new URLSearchParams({ view: 'clip', model: name, w, h, fps, palette: flag('palette', 'merc') });
    28: for (const k of ['shots', 'look']) if (flag(k)) params.set(k, flag(k));
    29: if (quick && !flag('shots')) params.set('shots', 'chase,turn');
    30: mkdirSync(dirname(out), { recursive: true });
    31: 
    32: const started = Date.now();
    33: const server = await createServer({ server: { host: '127.0.0.1', port: 5230, strictPort: false }, logLevel: 'error' });
    34: await server.listen();
    35: const browser = await chromium.launch({ args: ['--use-angle=swiftshader', '--enable-unsafe-swiftshader', '--ignore-gpu-blocklist'] });
    36: let failed = false;
    37: try {
    38:   const page = await browser.newPage({ viewport: { width: w, height: h } });
    39:   page.setDefaultTimeout(300000);
    40:   page.on('pageerror', (e) => { failed = true; console.error('[pageerror]', e.message); });
    41:   page.on('console', (m) => { if (m.type() === 'error') console.error('[console]', m.text().slice(0, 300)); });
    42:   await page.goto(`${server.resolvedUrls.local[0]}?${params}`);
    43:   await page.waitForFunction(() => window.__ready === true);
    44:   const frames = await page.evaluate(() => window.__clip.frames);
    45:   const loaded = Date.now();
    46:   const ffmpeg = spawn('ffmpeg', ['-loglevel', 'error', '-y', '-f', 'image2pipe', '-c:v', 'mjpeg', '-framerate', String(fps), '-i', '-',
    47:     '-c:v', 'libx264', '-crf', '20', '-pix_fmt', 'yuv420p', '-movflags', '+faststart', out], { stdio: ['pipe', 'inherit', 'inherit'] });
    48:   const ended = new Promise((ok) => ffmpeg.on('close', ok));
    49:   for (let i = 0; i < frames; i++) {
    50:     const url = await page.evaluate((n) => window.__clip.render(n), i);
    51:     const jpeg = Buffer.from(url.slice(url.indexOf(',') + 1), 'base64');
    52:     if (!ffmpeg.stdin.write(jpeg)) await new Promise((ok) => ffmpeg.stdin.once('drain', ok));
    53:   }
    54:   ffmpeg.stdin.end();
    55:   const code = await ended;
    56:   if (code !== 0) throw new Error(`ffmpeg exited ${code}`);
    57:   const every = Math.max(1, Math.floor(frames / 12));
    58:   const sheet = out.replace(/\.mp4$/, '.sheet.jpg');
    59:   spawnSync('ffmpeg', ['-loglevel', 'error', '-y', '-i', out, '-vf', `select=not(mod(n\\,${every})),scale=480:-1,tile=4x3`, '-frames:v', '1', '-q:v', '4', sheet], { stdio: 'inherit' });
    60:   const secs = (Date.now() - started) / 1000;
    61:   console.log(`clip: ${out}`);
    62:   console.log(`clip: ${sheet}`);
    63:   console.log(`clip: ${frames} frames, ${(frames / fps).toFixed(1)} s of video, ${secs.toFixed(0)} s to make (${((Date.now() - loaded) / frames).toFixed(0)} ms a frame)`);
    64: } finally {
    65:   await browser.close();
    66:   await server.close();
    67: }
    68: process.exit(failed ? 1 : 0);
  • read_file{"Path":"~/work/sortie/kit/block.py"}

    input

    {
      "Path": "~/work/sortie/kit/block.py"
    }

    result, 113 lines

    Showing lines 1-112 of 112
    1: """Block models: plain boxes on the 22 joint rig, for judging mass and motion before any plate exists.
    2: 
    3: A block model is one file, kit/blocks/<name>.py, with a build() that takes this module's Blocks class.
    4: It builds in seconds, into a gitignored public/assets/block_<name>.glb:
    5: 
    6:     npm run kit -- block_dummy
    7:     npm run clip -- block_dummy
    8: 
    9: Geometry is authored in world rest pose coordinates in metres, models facing -Y, Z up, left is +X, as
    10: in the rest of the kit. Roles are the usual ones (main, accent, frame, joint). Nothing here is a design
    11: rule: no maker, frame or grade carries over unless a block file asks for it.
    12: """
    13: import importlib
    14: 
    15: import bpy
    16: from mathutils import Vector
    17: 
    18: from lib import loft, merge, mirror_x, octo, solid
    19: from mech import joints as striker_joints, nozzle_pair, pair
    20: 
    21: SIDED = {"shoulder", "upperarm", "forearm", "hand", "grip", "thigh", "shin", "foot", "binder"}
    22: BEVEL = .03
    23: 
    24: 
    25: class Blocks:
    26:     """The rig plus block primitives. `joints` overrides rest positions: {"thigh": (1.1, 0, 9.5)} moves
    27:     both thighs (give the left, +X, the right mirrors), {"pelvis": (0, 0, 9.8)} moves one node. Other
    28:     joints stay where the striker has them, in world coordinates, so moving one moves nothing else."""
    29: 
    30:     def __init__(self, joints=None, height=17.6):
    31:         J = striker_joints()
    32:         self.nodes = {o.name: o for o in J.values()}
    33:         self.n = 0
    34:         J["frame"]["frame"] = "block"
    35:         J["frame"]["height"] = height
    36:         place = {name: o.matrix_world.translation.copy() for name, o in self.nodes.items()}
    37:         for key, at in (joints or {}).items():
    38:             if key in SIDED:
    39:                 place[f"{key}.L"] = Vector(at)
    40:                 place[f"{key}.R"] = Vector((-at[0], at[1], at[2]))
    41:             elif key in place:
    42:                 place[key] = Vector(at)
    43:             else:
    44:                 raise KeyError(f"block: no joint {key}")
    45:         for name, o in self.nodes.items():  # striker_joints() makes parents first
    46:             if o.parent is not None:
    47:                 o.location = o.parent.matrix_world.inverted() @ place[name]
    48:             bpy.context.view_layer.update()
    49: 
    50:     def at(self, name):
    51:         return self.nodes[name].matrix_world.translation.copy()
    52: 
    53:     def _put(self, joint, bm, role, mirror):
    54:         self.n += 1
    55:         name = f"block{self.n}_{joint}"
    56:         if joint in SIDED:
    57:             pair(name, bm, role, self.nodes[f"{joint}.L"], self.nodes[f"{joint}.R"], bevel=BEVEL, panels=False)
    58:         elif mirror:
    59:             solid(name, merge(bm, mirror_x(bm)), role, self.nodes[joint], bevel=BEVEL, panels=False)
    60:         else:
    61:             solid(name, bm, role, self.nodes[joint], bevel=BEVEL, panels=False)
    62: 
    63:     def box(self, joint, x, y, z, role="main", mirror=False):
    64:         """A box from x, y, z ranges (lo, hi). A sided joint (thigh, shin, ...) takes the left's numbers
    65:         and mirrors to the right. `mirror` does the same for a box on a centre joint."""
    66:         r = [(x[0], y[0]), (x[1], y[0]), (x[1], y[1]), (x[0], y[1])]
    67:         self._put(joint, loft([(z[0], r), (z[1], r)]), role, mirror)
    68: 
    69:     def taper(self, joint, rings, role="main", mirror=False, chamfer=.15):
    70:         """A lofted block through rings (z, width, depth, x, y), bottom to top."""
    71:         self._put(joint, loft([(z, octo(w, d, chamfer, x=x, y=y)) for z, w, d, x, y in rings]), role, mirror)
    72: 
    73:     def bone(self, joint, a, b, w, d, role="main", chamfer=.1):
    74:         """A block from joint a to joint b, both named for the left side: bone("thigh", "thigh.L", "shin.L", 1, 1)."""
    75:         pa, pb = self.at(a), self.at(b)
    76:         lo, hi = (pa, pb) if pa.z < pb.z else (pb, pa)
    77:         self.taper(joint, [(lo.z, w, d, lo.x, lo.y), (hi.z, w, d, hi.x, hi.y)], role, chamfer=chamfer)
    78: 
    79:     def nozzles(self, joint, at, direction, r=.45, length=.9, kind="main"):
    80:         """A nozzle pair that fires plumes in the game. `kind`: main, binder or calf."""
    81:         if joint in SIDED:
    82:             jl, jr = self.nodes[f"{joint}.L"], self.nodes[f"{joint}.R"]
    83:         else:
    84:             jl = jr = self.nodes[joint]
    85:         nozzle_pair(kind, at, direction, r, length, jl, jr, housing=False)
    86: 
    87:     def mannequin(self):
    88:         """A neutral box on every bone, sized from the joints alone. For testing tools, not a design."""
    89:         for joint, a, b, w, d in (("thigh", "thigh.L", "shin.L", 1.0, 1.0), ("shin", "shin.L", "foot.L", 1.0, 1.0),
    90:                                   ("upperarm", "upperarm.L", "forearm.L", .7, .7), ("forearm", "forearm.L", "hand.L", .7, .7)):
    91:             self.bone(joint, a, b, w, d)
    92:         foot = self.at("foot.L")
    93:         self.box("foot", (foot.x - .5, foot.x + .5), (foot.y - 1.2, foot.y + .6), (0, foot.z))
    94:         hand = self.at("hand.L")
    95:         self.box("hand", (hand.x - .3, hand.x + .3), (hand.y - .3, hand.y + .3), (hand.z - .8, hand.z))
    96:         pelvis, torso, neck, head = self.at("pelvis"), self.at("torso"), self.at("neck"), self.at("head")
    97:         self.box("pelvis", (-1.3, 1.3), (-.8, .8), (pelvis.z - .8, pelvis.z + .4))
    98:         self.box("waist", (-.8, .8), (-.6, .6), (pelvis.z + .4, torso.z))
    99:         shoulder = self.at("shoulder.L")
    100:         self.box("torso", (-shoulder.x, shoulder.x), (-1, 1), (torso.z, neck.z))
    101:         self.box("shoulder", (shoulder.x, shoulder.x + .9), (-.6, .6), (shoulder.z - .6, shoulder.z + .4))
    102:         self.box("neck", (-.3, .3), (-.3, .3), (neck.z, head.z))
    103:         self.box("head", (-.5, .5), (-.6, .6), (head.z, head.z + 1.1))
    104:         pack = self.at("backpack")
    105:         self.box("backpack", (-.9, .9), (pack.y - .5, pack.y + .5), (pack.z - 1, pack.z + 1))
    106: 
    107: 
    108: def build_block(name):
    109:     """block_<name> from kit/blocks/<name>.py."""
    110:     module = importlib.import_module(f"blocks.{name.removeprefix('block_')}")
    111:     importlib.reload(module)
    112:     module.build(Blocks)
  • read_file{"Path":"~/work/sortie/kit/blocks/dummy.py"}

    input

    {
      "Path": "~/work/sortie/kit/blocks/dummy.py"
    }

    result, 10 lines

    Showing lines 1-9 of 9
    1: """Test fixture for the block tools: an automatic box on every bone, sized from the default joints.
    2: Not a design. Delete nothing here, copy it to start a real block file."""
    3: 
    4: 
    5: def build(Blocks):
    6:     b = Blocks()
    7:     b.mannequin()
    8:     pack = b.at("backpack")
    9:     b.nozzles("backpack", (.5, pack.y + .4, pack.z - .9), (0, .45, -.9))