{
  "format": "c3d/3.0",
  "version": "3.0.0",
  "coordSystem": {
    "handedness": "right",
    "up": "Y",
    "units": "meters",
    "front": "+Z"
  },
  "meta": {
    "id": "c3d-asset-clockwork-aether-skiff-001",
    "slug": "clockwork-aether-skiff",
    "name": "Clockwork Aether Skiff",
    "kind": "asset",
    "category": "vehicle/airship",
    "tags": [
      "steampunk",
      "fantasy",
      "airship",
      "skiff",
      "brass",
      "mahogany",
      "clockwork",
      "hero-vehicle",
      "museum-grade",
      "cloth-sail",
      "drydock"
    ],
    "description": "Museum-grade hard-surface steampunk aether skiff on a carved oak and patinated-brass drydock cradle. A tapered mahogany hull with riveted brass strakes carries a glowing 2300K midship aether-boiler with an interlocking gear train, twin copper stacks, outrigger pylons with spinning 4-blade brass propellers, a turned mahogany mast with a billowing cream-parchment PBD cloth sail, and an aft helm deck with wheel, glowing binnacle and stern lantern.",
    "styleDNA": {
      "era": "Victorian aetherpunk, c.1885 fantasy",
      "palette": [
        "#5A2216",
        "#7A3A22",
        "#B8893A",
        "#D4A64A",
        "#6F7F5A",
        "#B06A3B",
        "#2B2B2E",
        "#EADCBF"
      ],
      "mood": "reverent, heroic, warm-glow museum showcase against dark slate",
      "materialPhilosophy": "Honest craft materials with lived history: hand-rubbed mahogany with oil sheen and edge wear, brass with polished high-contact zones and verdigris in recesses, blackened iron rivets and fasteners, sun-aged parchment canvas with gold hem trim.",
      "lightingCharacter": "Twilight studio cyclorama: warm golden key from front-left, cool sapphire rim from rear-right, practical 2300K furnace core and amber lantern glows with soft bloom."
    },
    "boundsM": {
      "min": [
        -0.55,
        0,
        -1.1
      ],
      "max": [
        0.55,
        2,
        1.1
      ]
    },
    "groundedPivot": true
  },
  "params": {
    "overallLengthM": 2.2,
    "overallWidthM": 1.1,
    "overallHeightM": 2,
    "plinthHeightM": 0.22,
    "plinthWidthM": 0.9,
    "plinthDepthM": 1.8,
    "hullBeamM": 0.72,
    "hullDepthM": 0.62,
    "hullKeelY": 0.216,
    "deckY": 0.676,
    "gunwaleRailHeightM": 0.16,
    "boilerZ": -0.12,
    "boilerDiameterM": 0.36,
    "mastZ": 0.32,
    "mastBaseDiameterM": 0.085,
    "mastTopY": 2,
    "yardarmY": 1.72,
    "yardarmSpanM": 0.9,
    "propellerDiameterM": 0.34,
    "pylonSpanX": 0.46,
    "propellerAxisY": 0.86,
    "helmZ": -0.78,
    "overlapM": 0.004,
    "rivetPitchM": 0.035,
    "deckPlankWidthM": 0.055
  },
  "materials": {
    "mahogany": {
      "recipe": "wood_plank",
      "palette": [
        "#5A2216",
        "#7A3A22",
        "#4A1A10"
      ],
      "roughness": [
        0.28,
        0.5
      ],
      "bumpStrength": 0.15,
      "scale": 1,
      "coat": 0.35,
      "sheen": 0,
      "anisotropy": 0.2,
      "perIslandVar": 0.15,
      "edgeBevelMm": 2.5
    },
    "oak_carved": {
      "recipe": "wood_plank",
      "palette": [
        "#8A6438",
        "#6E4C2A",
        "#A07A48"
      ],
      "roughness": [
        0.45,
        0.7
      ],
      "bumpStrength": 0.22,
      "scale": 1.2,
      "coat": 0.1,
      "sheen": 0,
      "anisotropy": 0.1,
      "perIslandVar": 0.18,
      "edgeBevelMm": 3
    },
    "deck_teak": {
      "recipe": "wood_plank",
      "palette": [
        "#9A6A3E",
        "#7E5530",
        "#B07D4A"
      ],
      "roughness": [
        0.5,
        0.75
      ],
      "bumpStrength": 0.18,
      "scale": 0.8,
      "coat": 0,
      "sheen": 0,
      "anisotropy": 0.15,
      "perIslandVar": 0.22,
      "edgeBevelMm": 1.5
    },
    "brass": {
      "recipe": "brushed_metal",
      "palette": [
        "#B8893A",
        "#D4A64A",
        "#8E6A2A"
      ],
      "roughness": [
        0.18,
        0.42
      ],
      "bumpStrength": 0.08,
      "scale": 1,
      "coat": 0.15,
      "sheen": 0,
      "anisotropy": 0.45,
      "perIslandVar": 0.1,
      "edgeBevelMm": 1.5
    },
    "brass_patina": {
      "recipe": "brushed_metal",
      "palette": [
        "#9C7A3A",
        "#6F7F5A",
        "#5E8070"
      ],
      "roughness": [
        0.35,
        0.7
      ],
      "bumpStrength": 0.2,
      "scale": 1,
      "coat": 0,
      "sheen": 0,
      "anisotropy": 0.25,
      "perIslandVar": 0.2,
      "edgeBevelMm": 2
    },
    "copper": {
      "recipe": "brushed_metal",
      "palette": [
        "#B06A3B",
        "#8C4E2A",
        "#C98552"
      ],
      "roughness": [
        0.25,
        0.55
      ],
      "bumpStrength": 0.1,
      "scale": 1,
      "coat": 0.05,
      "sheen": 0,
      "anisotropy": 0.35,
      "perIslandVar": 0.12,
      "edgeBevelMm": 1.5
    },
    "bronze_cable": {
      "recipe": "brushed_metal",
      "palette": [
        "#7C5A2E",
        "#5E4422"
      ],
      "roughness": [
        0.3,
        0.5
      ],
      "bumpStrength": 0.12,
      "scale": 2,
      "coat": 0,
      "sheen": 0,
      "anisotropy": 0.6,
      "perIslandVar": 0.05,
      "edgeBevelMm": 0.5
    },
    "iron_black": {
      "recipe": "brushed_metal",
      "palette": [
        "#2B2B2E",
        "#3A3634",
        "#1E1E20"
      ],
      "roughness": [
        0.45,
        0.75
      ],
      "bumpStrength": 0.18,
      "scale": 1,
      "coat": 0,
      "sheen": 0,
      "anisotropy": 0.1,
      "perIslandVar": 0.12,
      "edgeBevelMm": 1
    },
    "gold_trim": {
      "recipe": "brushed_metal",
      "palette": [
        "#E2B45A",
        "#C9962E",
        "#F0C870"
      ],
      "roughness": [
        0.12,
        0.3
      ],
      "bumpStrength": 0.05,
      "scale": 1,
      "coat": 0.3,
      "sheen": 0,
      "anisotropy": 0.3,
      "perIslandVar": 0.06,
      "edgeBevelMm": 1
    },
    "canvas_parchment": {
      "recipe": "boucle_fabric",
      "palette": [
        "#EADCBF",
        "#DCC9A2",
        "#F2E6CE"
      ],
      "roughness": [
        0.7,
        0.9
      ],
      "bumpStrength": 0.12,
      "scale": 3,
      "coat": 0,
      "sheen": 0.35,
      "anisotropy": 0,
      "perIslandVar": 0.08,
      "edgeBevelMm": 0.5
    },
    "helm_leather": {
      "recipe": "aged_leather",
      "palette": [
        "#4A2C1A",
        "#5E3822"
      ],
      "roughness": [
        0.45,
        0.7
      ],
      "bumpStrength": 0.2,
      "scale": 1,
      "coat": 0.1,
      "sheen": 0.1,
      "anisotropy": 0,
      "perIslandVar": 0.1,
      "edgeBevelMm": 1
    },
    "glass_amber": {
      "recipe": "arch_glass",
      "palette": [
        "#F7E3B5",
        "#FFF4DC"
      ],
      "roughness": [
        0.02,
        0.08
      ],
      "bumpStrength": 0.02,
      "scale": 1,
      "coat": 0,
      "sheen": 0,
      "anisotropy": 0,
      "perIslandVar": 0.02,
      "edgeBevelMm": 0.8
    },
    "furnace_core": {
      "recipe": "warm_filament",
      "palette": [
        "#FF9A3C",
        "#FFB75A",
        "#FF7A1C"
      ],
      "roughness": [
        0.3,
        0.5
      ],
      "bumpStrength": 0.05,
      "scale": 1,
      "coat": 0,
      "sheen": 0,
      "anisotropy": 0,
      "kelvin": 2300,
      "emissionStrength": 18,
      "perIslandVar": 0.05,
      "edgeBevelMm": 1
    },
    "lantern_glow": {
      "recipe": "warm_filament",
      "palette": [
        "#FFC070",
        "#FFA848"
      ],
      "roughness": [
        0.3,
        0.5
      ],
      "bumpStrength": 0.02,
      "scale": 1,
      "coat": 0,
      "sheen": 0,
      "anisotropy": 0,
      "kelvin": 2400,
      "emissionStrength": 9,
      "perIslandVar": 0.03,
      "edgeBevelMm": 0.8
    },
    "slate_cyc": {
      "recipe": "ceramic_plaster",
      "palette": [
        "#1C1F26",
        "#23262E",
        "#15171C"
      ],
      "roughness": [
        0.75,
        0.95
      ],
      "bumpStrength": 0.05,
      "scale": 4,
      "coat": 0,
      "sheen": 0,
      "anisotropy": 0,
      "perIslandVar": 0.03,
      "edgeBevelMm": 0
    }
  },
  "sharedWalls": [],
  "groups": [
    {
      "id": "drydock_cradle_plinth",
      "name": "Carved Oak & Patinated-Brass Drydock Cradle Plinth",
      "category": "plinth/display_base",
      "role": "architecture",
      "reusable": true,
      "tags": [
        "plinth",
        "drydock",
        "cradle",
        "oak",
        "brass",
        "museum-base"
      ],
      "pos": [
        0,
        0,
        0
      ],
      "rotDeg": [
        0,
        0,
        0
      ],
      "scale": [
        1,
        1,
        1
      ],
      "boundsHintM": {
        "size": [
          0.9,
          0.22,
          1.8
        ]
      },
      "attach": {
        "parent": "ground",
        "mode": "seat_on",
        "face": "+y",
        "offset": [
          0,
          0,
          0
        ],
        "overlapM": 0.004
      },
      "nodes": [],
      "generator": {
        "runtime": "blender_py_v3",
        "entry": "build",
        "seed": 136,
        "summary": "Carved Oak & Patinated-Brass Drydock Cradle Plinth",
        "code": "def build(ctx):\n    oak = ctx.mat(\"oak_carved\"); pat = ctx.mat(\"brass_patina\")\n    iron = ctx.mat(\"iron_black\"); brass = ctx.mat(\"brass\")\n    P = ctx.params\n    W, D = P.get(\"plinthWidthM\", 0.9), P.get(\"plinthDepthM\", 1.8)\n    ov = P.get(\"overlapM\", 0.004)\n    keel_y = P.get(\"hullKeelY\", 0.216)\n    beam, deck_y = P.get(\"hullBeamM\", 0.72), P.get(\"deckY\", 0.676)\n    base_top, top_y = 0.14, 0.22\n    seg = max(8, int(24 * ctx.seg_scale))\n\n    # --- Stepped oak base: foot, ogee tier, bead step, cap (y = 0 .. 0.14) ---\n    ctx.add_bevel_box(\"plinth_foot\", (W, 0.062, D), pos=(0, 0.031, 0), bevel=0.012, segs=4, chamfer_bottom=0.004, mat=oak)\n    ctx.add_bevel_box(\"plinth_tier\", (W - 0.06, 0.082, D - 0.06), pos=(0, 0.062 + 0.041 - ov, 0), bevel=0.018, segs=6, mat=oak)\n    ctx.add_bevel_box(\"plinth_bead\", (W - 0.035, 0.012, D - 0.035), pos=(0, 0.062 + 0.004, 0), bevel=0.0055, segs=4, mat=oak)\n    ctx.add_bevel_box(\"plinth_cap\", (W - 0.1, 0.022, D - 0.1), pos=(0, base_top - 0.011, 0), bevel=0.009, segs=4, mat=oak)\n\n    # --- Retained fine rope-twist braid: two interlaced strands around upper tier ---\n    hx, hz, fy = (W - 0.06) / 2 + 0.003, (D - 0.06) / 2 + 0.003, 0.104\n    corners = [(hx, hz), (-hx, hz), (-hx, -hz), (hx, -hz)]\n    perim = 4 * (hx + hz); n = int(260 * ctx.seg_scale) + 120\n    for k, ph in enumerate((0.0, math.pi)):\n        path = []\n        for i in range(n):\n            s = perim * i / n; acc = 0.0\n            for j in range(4):\n                a, b = corners[j], corners[(j + 1) % 4]; L = math.dist(a, b)\n                if s <= acc + L or j == 3:\n                    t = min(1.0, (s - acc) / L); x = a[0] + (b[0] - a[0]) * t; z = a[1] + (b[1] - a[1]) * t\n                    nx, nz = (b[1] - a[1]) / L, -(b[0] - a[0]) / L\n                    break\n                acc += L\n            th = s / 0.022 * math.pi + ph; r = 0.004 * (1 + math.cos(th))\n            path.append((x + nx * r, fy + 0.006 * math.sin(th), z + nz * r))\n        ctx.add_tube(f\"frieze_rope_{k}\", path, radius=0.0055, closed=True, tubular_segs=n, radial_segs=8, mat=oak)\n\n    # --- Concave oak saddles fitted to the hull bottom section, tapered ends ---\n    y0, bw = base_top - ov, W - 0.1\n    sad = keel_y - ov                               # keel seats 4 mm into saddle\n    ea, eb = beam / 2, deck_y - keel_y              # elliptical hull-bottom section\n    def hull_y(x): return sad + eb * (1.0 - math.sqrt(max(0.0, 1.0 - (x / ea) ** 2)))\n    sw = 0.0\n    while hull_y(sw + 0.002) < top_y: sw += 0.002\n    sad_pts = [(sw * (1 - 2 * i / 24), hull_y(sw * (1 - 2 * i / 24))) for i in range(25)]\n    prof = ([(-bw/2, y0), (bw/2, y0), (bw/2, base_top + 0.022), (bw/2 - 0.06, top_y - 0.014),\n             (sw + 0.03, top_y - 0.002), (sw + 0.012, top_y)] + sad_pts +\n            [(-sw - 0.012, top_y), (-sw - 0.03, top_y - 0.002), (-bw/2 + 0.06, top_y - 0.014), (-bw/2, base_top + 0.022)])\n    hb, ht = 0.09, 0.062                            # cheek taper: thick foot, slimmer crown\n    def hd(y): return hb - (hb - ht) * (y - y0) / (top_y - y0)\n    ang = math.degrees(math.atan2(hb - ht, top_y - y0))\n    for bz in (-0.6, 0.0, 0.6):\n        tag = f\"{int(round(bz * 10)):+d}\"\n        bm = ctx.new_bmesh()\n        f = [bm.verts.new(ctx.p(x, y, bz + hd(y))) for x, y in prof]\n        b = [bm.verts.new(ctx.p(x, y, bz - hd(y))) for x, y in prof]\n        bm.faces.new(f); bm.faces.new(list(reversed(b))); m = len(prof)\n        for i in range(m):\n            bm.faces.new((f[i], b[i], b[(i + 1) % m], f[(i + 1) % m]))\n        bmesh.ops.recalc_face_normals(bm, faces=bm.faces)\n        ctx.commit_bmesh(bm, f\"cradle_saddle_{tag}\", mat=oak, smooth_angle_deg=40.0)\n        # recessed patinated strap bands following the tapered cheeks + hex bolts\n        for sz in (1, -1):\n            for sx in (-0.24, 0.24):\n                ym = (y0 + top_y - 0.012) / 2\n                ctx.add_bevel_box(f\"strap_{tag}_{sz}_{sx}\", (0.042, 0.068, 0.006), pos=(sx, ym, bz + sz * (hd(ym) - 0.001)),\n                                  rot_deg=(-sz * ang, 0, 0), bevel=0.0015, segs=2, mat=pat)\n                for by in (ym - 0.02, ym + 0.02):\n                    ctx.add_lathe(f\"bolt_{tag}_{sz}_{sx}_{by:.3f}\", [(0.0, 0.0), (0.008, 0.0), (0.008, 0.005), (0.0, 0.0058)],\n                                  pos=(sx, by, bz + sz * (hd(by) + 0.0015)), rot_deg=(sz * (90 - ang), 0, 0), segs=6, mat=iron)\n        # brass end stops recessed into the tapered bolster ends\n        for sx in (-1, 1):\n            ctx.add_bevel_box(f\"stop_{tag}_{sx}\", (0.012, 0.03, 2 * hd(base_top + 0.008) - 0.02),\n                              pos=(sx * (bw/2 - 0.003), base_top + 0.008, bz), bevel=0.003, segs=3, mat=brass)\n\n    # --- Engraved brass nameplate on +Z face (bezel + inset engraved field) ---\n    nzf = (D - 0.06) / 2\n    ctx.add_bevel_box(\"nameplate\", (0.34, 0.046, 0.005), pos=(0, 0.1, nzf + 0.0012), bevel=0.002, segs=2, mat=brass)\n    ctx.add_bevel_box(\"nameplate_engrave\", (0.28, 0.014, 0.0016), pos=(0, 0.1, nzf + 0.0036), bevel=0.0004, segs=1, mat=pat)\n    for sx in (-0.155, 0.155):\n        ctx.add_lathe(f\"plate_screw_{sx}\", [(0.0, 0.0), (0.005, 0.0), (0.004, 0.002), (0.0, 0.0025)],\n                      pos=(sx, 0.1, nzf + 0.0035), rot_deg=(90, 0, 0), segs=seg, mat=iron)\n\n    ctx.surface_story(\"oak_carved\", edge_wear=0.4, dust=0.14, grime_height=0.1, scratches=0.12, wear_color=\"#5A3A1E\")\n    ctx.surface_story(\"brass_patina\", edge_wear=0.45, dust=0.12, grime_height=0.18, scratches=0.1, wear_color=\"#5E8070\")\n    ctx.surface_story(\"brass\", edge_wear=0.5, dust=0.06, grime_height=0.08, scratches=0.14, wear_color=\"#E2B45A\")\n    ctx.surface_story(\"iron_black\", edge_wear=0.25, dust=0.1, grime_height=0.2, scratches=0.08, wear_color=\"#7A3A1E\")"
      }
    },
    {
      "id": "hull_and_helm_deck",
      "name": "Mahogany & Riveted-Brass Hull with Aft Helm Deck",
      "category": "vehicle/hull",
      "role": "hero_furniture",
      "reusable": true,
      "tags": [
        "hull",
        "mahogany",
        "brass-strake",
        "figurehead",
        "deck",
        "helm",
        "binnacle",
        "lantern",
        "railing"
      ],
      "pos": [
        0,
        0.216,
        0
      ],
      "rotDeg": [
        0,
        0,
        0
      ],
      "scale": [
        1,
        1,
        1
      ],
      "boundsHintM": {
        "size": [
          0.72,
          0.9,
          2.2
        ]
      },
      "attach": {
        "parent": "drydock_cradle_plinth",
        "mode": "seat_on",
        "face": "+y",
        "offset": [
          0,
          0,
          0
        ],
        "overlapM": 0.004
      },
      "nodes": [],
      "generator": {
        "runtime": "sdf_v3",
        "entry": "build",
        "seed": 138,
        "summary": "Mahogany & Riveted-Brass Hull with Aft Helm Deck",
        "code": "def build(ctx):\n    P, S = ctx.params, ctx.sdf\n    ky = P.get(\"hullKeelY\", 0.216)\n    deck_y, hub_y = P.get(\"deckY\", 0.676) - ky, 1.02 - ky            # 0.46 / 0.804 local\n    beam_h, hz0, hlen = P.get(\"hullBeamM\", 0.72) * 0.5, 0.05, 1.05\n    pitch = P.get(\"rivetPitchM\", 0.035)\n    # Oiled red-brown mahogany board variants (modest board-to-board roughness drift)\n    MV = []\n    for i, (c, r) in enumerate(((\"#4A1C12\", 0.30), (\"#56221A\", 0.36), (\"#401810\", 0.33))):\n        k = \"mahogany_oiled_%d\" % i\n        ctx.make_material(k, base_color=c, roughness=r, coat=0.4, noise_scale=34.0, bump_strength=0.14, ao_wear=0.3, ao_color=\"#1E0A06\", edge_bevel_mm=2.5)\n        ctx.surface_story(k, edge_wear=0.32, dust=0.06, grime_height=0.18, scratches=0.1, wear_color=\"#7A3A22\")\n        MV.append(ctx.mat(k))\n    for k, ew, du, gh in ((\"mahogany\", 0.45, 0.08, 0.2), (\"brass\", 0.3, 0.1, 0.2), (\"brass_patina\", 0.15, 0.2, 0.5), (\"iron_black\", 0.25, 0.2, 0.25)):\n        ctx.surface_story(k, edge_wear=ew, dust=du, grime_height=gh, scratches=0.14)\n    MH, BR, BP, IR, GD = ctx.mat(\"mahogany\"), ctx.mat(\"brass\"), ctx.mat(\"brass_patina\"), ctx.mat(\"iron_black\"), ctx.mat(\"gold_trim\")\n    ctx.make_material(\"compass_card_soft\", base_color=\"#E8C27A\", roughness=0.4, emission=2.2, emission_color=\"#FFB060\")\n    ctx.make_material(\"lantern_flame_soft\", base_color=\"#FFC070\", roughness=0.4, emission=3.5, emission_color=\"#FFA848\")\n\n    def half_w(z, y, g=0.0):\n        bh, hl = beam_h - 0.02 + g, hlen - 0.02 + g\n        s = max(0.0, 1.0 - ((y - deck_y) / deck_y) ** 2) ** 0.5\n        t = (z - hz0) / (hl * max(s, 1e-4))\n        return bh * s * max(0.0, 1.0 - t * t) ** 0.5\n\n    # --- Clinker hull: six lapped mahogany strakes, each upper board proud of the one below ---\n    edges = [0.0, 0.075, 0.15, 0.225, 0.30, 0.38, deck_y]\n    for i in range(6):\n        g = 0.0035 * i\n        y0, y1 = (-0.02 if i == 0 else edges[i] - 0.014), edges[i + 1]\n        e = S.ellipsoid((0, deck_y, hz0), (beam_h - 0.02 + g, deck_y, hlen - 0.02 + g))\n        slab = S.box((0, (y0 + y1) / 2, hz0), (0.5, (y1 - y0) / 2, 1.3))\n        ctx.sdf_mesh(\"hull_strake_%d\" % i, S.smax(e, slab, 0.003), (-0.38, max(-0.01, y0 - 0.01), -1.02), (0.38, y1 + 0.01, 1.12), res=128, mat=MV[i % 3], smooth_iters=1)\n\n    # --- 40 mm brass keel strake (bottom kissing y=0 midship) ---\n    hl = hlen - 0.02\n    keel = [(0.0, deck_y - deck_y * max(0.0, 1 - ((z - hz0) / hl) ** 2) ** 0.5 + 0.02, z) for z in [-0.94 + i * 0.049 for i in range(41)]]\n    ctx.add_tube(\"keel_strake\", keel, radius=0.02, tubular_segs=48, radial_segs=12, mat=BR)\n\n    # --- Narrow riveted brass belt strakes on patina recess bands + mahogany gunwale cap ---\n    rv = ctx.new_bmesh()\n    for idx, (yy, g) in enumerate(((0.15, 0.0105), (0.30, 0.0175), (0.38, 0.0195))):\n        s = max(0.0, 1 - ((yy - deck_y) / deck_y) ** 2) ** 0.5\n        z0, z1 = hz0 - (hl + g) * s + 0.04, hz0 + (hl + g) * s - 0.04\n        zs_ = [z0 + (z1 - z0) * i / 40 for i in range(41)]\n        for nm, off, r, m in ((\"belt_recess_%d\", 0.001, 0.0075, BP), (\"belt_%d\", 0.004, 0.0055, BR)):\n            side = [(half_w(z, yy, g) + off, yy, z) for z in zs_]\n            ctx.add_tube(nm % idx, side + [(-x, y, z) for (x, y, z) in reversed(side)], radius=r, closed=True, tubular_segs=110, radial_segs=10, mat=m)\n        zz = z0 + 0.02\n        while zz < z1 - 0.02:\n            for sx in (-1, 1):\n                bmesh.ops.create_icosphere(rv, subdivisions=1, radius=0.0038, matrix=Matrix.Translation(ctx.p(sx * (half_w(zz, yy, g) + 0.0085), yy, zz)))\n            zz += pitch\n    ctx.commit_bmesh(rv, \"belt_rivets\", mat=IR, smooth_angle_deg=60.0)\n    side = [(half_w(z, deck_y + 0.006, 0.0175) + 0.002, deck_y + 0.006, z) for z in [-0.9 + i * 0.045 for i in range(42)]]\n    ctx.add_tube(\"gunwale_cap\", side + [(-x, y, z) for (x, y, z) in reversed(side)], radius=0.018, closed=True, tubular_segs=110, radial_segs=10, mat=MH)\n\n    # --- Slatted teak deck, caulk gaps, boiler & mast sockets left open ---\n    pw, gap, n_pl = P.get(\"deckPlankWidthM\", 0.055), 0.004, 13\n    holes = [(-0.12, 0.19, 0.20), (0.32, 0.05, 0.06)]\n    for i in range(n_pl):\n        x = (i - (n_pl - 1) / 2) * pw\n        hz = hl * max(0.0, 1 - ((abs(x) + pw / 2) / (beam_h - 0.02)) ** 2) ** 0.5 - 0.02\n        if hz < 0.06: continue\n        cuts = [(hz0 - hz, hz0 + hz)]\n        for (cz, chl, chx) in holes:\n            if abs(x) < chx:\n                cuts = [sg for a, b in cuts for sg in ((a, min(b, cz - chl)), (max(a, cz + chl), b)) if sg[1] - sg[0] > 0.03]\n        for j, (a, b) in enumerate(cuts):\n            ctx.add_bevel_box(\"deck_plank_%d_%d\" % (i, j), (pw - gap, 0.016, b - a), pos=(x, deck_y + 0.004, (a + b) / 2), bevel=0.002, segs=2, mat=ctx.mat(\"deck_teak\"))\n\n    # --- Brass stanchions every 0.18 m + 16 mm top rail 0.16 m above deck ---\n    zs = [-0.86 + 0.18 * k for k in range(11)]\n    for sx in (-1, 1):\n        for k, z in enumerate(zs):\n            ctx.add_lathe(\"stanchion_%d_%d\" % (sx, k), [(0, 0), (0.012, 0), (0.012, 0.012), (0.006, 0.02), (0.006, 0.16), (0, 0.16)], pos=(sx * (half_w(z, deck_y) - 0.012), deck_y + 0.012, z), segs=12, mat=BR)\n        ctx.add_tube(\"top_rail_%d\" % sx, [(sx * (half_w(z, deck_y) - 0.012), deck_y + 0.176, z) for z in zs], radius=0.008, tubular_segs=64, radial_segs=10, mat=BR)\n\n    # --- Short tapered gilded ram with crest and a carved throat beneath ---\n    ram = S.cone((0, 0.335, 0.95), (0, 0.32, 1.10), 0.055, 0.007)\n    ram = S.smin(ram, S.ellipsoid((0, 0.39, 1.0), (0.03, 0.035, 0.05)), 0.02)\n    ram = S.smin(ram, S.ellipsoid((0, 0.24, 0.985), (0.03, 0.06, 0.035)), 0.015)\n    ram = S.subtract(ram, S.sphere((0, 0.255, 1.05), 0.042))\n    ctx.sdf_mesh(\"griffin_figurehead\", ram, (-0.08, 0.17, 0.9), (0.08, 0.44, 1.105), res=80, mat=GD, smooth_iters=2)\n\n    # --- Aft raised helm deck (+0.06 m) ---\n    hd = S.smax(S.ellipsoid((0, deck_y, hz0), (beam_h - 0.03, deck_y, hl - 0.01)), S.box((0, deck_y + 0.03, -0.79), (0.4, 0.032, 0.19)), 0.004)\n    ctx.sdf_mesh(\"helm_deck\", hd, (-0.36, deck_y - 0.01, -1.0), (0.36, deck_y + 0.07, -0.58), res=64, mat=MV[1])\n    hdy, wz = deck_y + 0.06, -0.66\n    ctx.add_lathe(\"helm_pedestal\", [(0, 0), (0.07, 0), (0.06, 0.03), (0.04, 0.06), (0.035, hub_y - hdy - 0.02), (0.045, hub_y - hdy + 0.03), (0, hub_y - hdy + 0.03)], pos=(0, hdy - 0.002, wz - 0.06), segs=24, mat=MH)\n    ctx.add_lathe(\"wheel_hub\", [(0, -0.05), (0.03, -0.05), (0.035, 0.0), (0.03, 0.03), (0, 0.03)], pos=(0, hub_y, wz), rot_deg=(90, 0, 0), segs=24, mat=BR)\n    ctx.add_tube(\"wheel_rim\", [(0.17 * math.cos(a * math.pi / 24), hub_y + 0.17 * math.sin(a * math.pi / 24), wz + 0.02) for a in range(48)], radius=0.012, closed=True, tubular_segs=64, radial_segs=12, mat=BR)\n    for k in range(8):\n        c, s = math.cos(k * math.pi / 4), math.sin(k * math.pi / 4)\n        ctx.add_tube(\"spoke_%d\" % k, [(0.025 * c, hub_y + 0.025 * s, wz + 0.02), (0.18 * c, hub_y + 0.18 * s, wz + 0.02)], radius=0.007, mat=BR)\n        ctx.add_tube(\"grip_%d\" % k, [(0.178 * c, hub_y + 0.178 * s, wz + 0.02), (0.19 * c, hub_y + 0.19 * s, wz + 0.02)], radius=0.011, taper=[1.0, 0.75], mat=ctx.mat(\"helm_leather\"))\n\n    # --- Compass binnacle: soft card + iron needle under amber dome (structure survives glow) ---\n    bz = -0.86\n    ctx.add_lathe(\"binnacle_column\", [(0, 0), (0.06, 0), (0.05, 0.02), (0.035, 0.05), (0.035, 0.12), (0.06, 0.14), (0, 0.14)], pos=(0, hdy - 0.002, bz), segs=24, mat=BR)\n    ctx.add_lathe(\"compass_card\", [(0, 0), (0.045, 0), (0.045, 0.006), (0, 0.006)], pos=(0, hdy + 0.138, bz), segs=24, mat=ctx.mat(\"compass_card_soft\"))\n    ctx.add_tube(\"compass_needle\", [(0, hdy + 0.146, bz - 0.035), (0, hdy + 0.146, bz + 0.035)], radius=0.003, taper=[0.4, 1.0], mat=IR)\n    ctx.add_lathe(\"binnacle_dome\", [(0.055 * math.cos(a * math.pi / 16), 0.055 * math.sin(a * math.pi / 16)) for a in range(9)], pos=(0, hdy + 0.138, bz), segs=24, mat=ctx.mat(\"glass_amber\"))\n\n    # --- Curved stern davit + caged lantern (pivot: stern_lantern_pivot) ---\n    ctx.add_tube(\"stern_davit\", [(0, hdy - 0.004, -0.93), (0, hdy + 0.22, -0.97), (0, hdy + 0.30, -1.03), (0, hdy + 0.28, -1.07)], radius=0.011, taper=[1.0, 0.7], tubular_segs=32, mat=BR)\n    ly, lz = hdy + 0.27, -1.07\n    top = ly - 0.06\n    ctx.add_lathe(\"stern_lantern_pivot\", [(0, 0), (0.006, 0), (0.006, 0.012), (0, 0.012)], pos=(0, ly - 0.004, lz), segs=12, mat=IR)\n    ctx.add_tube(\"lantern_chain\", [(0, ly, lz), (0, top - 0.002, lz)], radius=0.003, mat=IR)\n    ctx.add_lathe(\"lantern_cap\", [(0, 0), (0.035, 0), (0.01, 0.025), (0, 0.025)], pos=(0, top - 0.025, lz), segs=16, mat=BR)\n    ctx.add_lathe(\"lantern_glass\", [(0, 0), (0.028, 0), (0.032, 0.04), (0.028, 0.08), (0, 0.08)], pos=(0, top - 0.105, lz), segs=16, mat=ctx.mat(\"glass_amber\"))\n    ctx.add_lathe(\"lantern_flame\", [(0, 0), (0.009, 0.01), (0.006, 0.03), (0, 0.04)], pos=(0, top - 0.09, lz), segs=12, mat=ctx.mat(\"lantern_flame_soft\"))\n    ctx.add_lathe(\"lantern_base\", [(0, 0), (0.034, 0), (0.034, 0.012), (0, 0.012)], pos=(0, top - 0.115, lz), segs=16, mat=BR)\n    for k in range(4):\n        a = k * math.pi / 2 + math.pi / 4\n        ctx.add_tube(\"lantern_cage_%d\" % k, [(r * math.cos(a), yy, lz + r * math.sin(a)) for r, yy in ((0.033, top - 0.11), (0.036, top - 0.065), (0.033, top - 0.022))], radius=0.0025, mat=BR)"
      }
    },
    {
      "id": "aether_propulsion_assembly",
      "name": "Midship Aether-Boiler, Clockwork Gear Train & Outrigger Propellers",
      "category": "vehicle/propulsion",
      "role": "lighting",
      "reusable": true,
      "tags": [
        "boiler",
        "furnace",
        "clockwork",
        "gears",
        "exhaust-stacks",
        "propeller",
        "outrigger",
        "emissive",
        "rigged"
      ],
      "pos": [
        0,
        0.668,
        -0.12
      ],
      "rotDeg": [
        0,
        0,
        0
      ],
      "scale": [
        1,
        1,
        1
      ],
      "boundsHintM": {
        "size": [
          1.1,
          0.78,
          0.62
        ]
      },
      "attach": {
        "parent": "hull_and_helm_deck",
        "mode": "seat_on",
        "face": "+y",
        "offset": [
          0,
          -0.444,
          -0.12
        ],
        "overlapM": 0.004
      },
      "nodes": [],
      "generator": {
        "runtime": "blender_py_v3",
        "entry": "build",
        "seed": 140,
        "summary": "Midship Aether-Boiler, Clockwork Gear Train & Outrigger Propellers",
        "code": "def build(ctx):\n    P = ctx.params\n    brass, copper, iron, gold, patina = [ctx.mat(k) for k in (\"brass\", \"copper\", \"iron_black\", \"gold_trim\", \"brass_patina\")]\n    # Lower-radiance 2300K amber emitter so the core and the dark rib silhouettes both resolve\n    core = ctx.make_material(\"furnace_core_soft\", base_color=\"#FF8A2A\", roughness=0.4, emission=3.2,\n                             emission_color=\"#FF9A3C\", noise_scale=18.0, bump_strength=0.04)\n    deckY = P.get(\"deckY\", 0.676)\n    axY = P.get(\"propellerAxisY\", 0.86) - deckY            # local prop axis height (0.184)\n    R = P.get(\"boilerDiameterM\", 0.36) / 2.0\n    cy, zp, sd = 0.06 + R, -0.02, -1                        # drum centre, pylon station, camera-facing flank (-X)\n    def loft(name, secs, mat):                             # watertight lofted shell with capped ends\n        bm = ctx.new_bmesh()\n        rings = [[bm.verts.new(ctx.p(*q)) for q in s] for s in secs]\n        n = len(secs[0])\n        for a, b in zip(rings, rings[1:]):\n            for i in range(n):\n                bm.faces.new((a[i], a[(i + 1) % n], b[(i + 1) % n], b[i]))\n        bm.faces.new(rings[0][::-1]); bm.faces.new(rings[-1])\n        bmesh.ops.recalc_face_normals(bm, faces=bm.faces)\n        return ctx.commit_bmesh(bm, name, mat=mat, smooth_angle_deg=30.0)\n    def ring(name, r, c, x, tr, mat):                      # closed ring in the YZ plane at station x\n        ctx.add_tube(name, [(x, c[0] + r * math.sin(t), c[1] + r * math.cos(t)) for t in np.linspace(0, 2 * math.pi, 57)[:-1]], radius=tr, closed=True, mat=mat)\n    def gear(name, N, m, c, phi, mat):                     # involute-approximated spur gear, axis X\n        r = m * N / 2.0; rf, ra, tau = r - 1.25 * m, r + m, 2 * math.pi / N\n        pts = [(rr, phi + i * tau + f * tau) for i in range(N)\n               for rr, f in ((rf, -.36), (r, -.25), (ra, -.13), (ra, .13), (r, .25), (rf, .36))]\n        sec = lambda x: [(x, c[0] + rr * math.sin(a), c[1] + rr * math.cos(a)) for rr, a in pts]\n        return loft(name, [sec(sd * 0.190), sec(sd * 0.205)], mat)\n    # --- footing: iron deck plate + twin brass saddles cradling the drum belly ---\n    ctx.add_bevel_box(\"boiler_base_plate\", size=(0.44, 0.02, 0.50), pos=(0, 0.01, 0), bevel=0.003, mat=iron)\n    for zz in (-0.15, 0.15):\n        ctx.add_bevel_box(\"boiler_saddle\", size=(0.30, 0.09, 0.06), pos=(0, 0.065, zz), bevel=0.006, mat=brass)\n    # --- horizontal banded, riveted boiler drum (0.5 m along Z) ---\n    prof = [(0, -0.25), (0.1, -0.243), (0.155, -0.232), (R, -0.215), (R, 0.215), (0.155, 0.232), (0.1, 0.243), (0, 0.25)]\n    ctx.add_lathe(\"boiler_drum\", prof, pos=(0, cy, 0), rot_deg=(90, 0, 0), segs=48, mat=brass)\n    rb = ctx.new_bmesh()\n    for zz in (-0.2, -0.07, 0.07, 0.2):\n        ctx.add_tube(\"boiler_strap\", [(math.cos(t) * (R + 0.003), cy + math.sin(t) * (R + 0.003), zz) for t in np.linspace(0, 2 * math.pi, 49)[:-1]], radius=0.006, closed=True, mat=patina)\n        for i in range(24):\n            t = 2 * math.pi * i / 24\n            bmesh.ops.create_icosphere(rb, subdivisions=1, radius=0.0055,\n                matrix=Matrix.Translation(ctx.p(math.cos(t) * (R + 0.008), cy + math.sin(t) * (R + 0.008), zz + 0.014)))\n    ctx.commit_bmesh(rb, \"boiler_rivets\", mat=iron, smooth_angle_deg=60.0)\n    # --- recessed firebox throat: dark iron cup, amber core deep inside, eight spaced brass ribs across mouth ---\n    ctx.add_lathe(\"firebox_throat\", [(0, 0), (0.085, 0), (0.085, 0.062), (0.072, 0.062), (0.072, 0.014), (0, 0.014)],\n                  pos=(0, cy, 0.228), rot_deg=(90, 0, 0), segs=40, mat=iron)\n    ring(\"hatch_flange\", 0.079, (cy, 0.0), 0, 0.0075, brass) if False else ctx.add_tube(\"hatch_flange\",\n        [(math.cos(t) * 0.079, cy + math.sin(t) * 0.079, 0.29) for t in np.linspace(0, 2 * math.pi, 49)[:-1]], radius=0.0075, closed=True, mat=brass)\n    ctx.add_lathe(\"furnace_core_orb\", [(0.03 * math.sin(t), -0.03 * math.cos(t)) for t in np.linspace(0, math.pi, 13)], pos=(0, cy, 0.258), rot_deg=(90, 0, 0), segs=28, mat=core)\n    for k in range(8):                                     # 17 mm pitch, ~9 mm dark gaps between ribs\n        x = -0.0595 + k * 0.017; h = math.sqrt(0.078 ** 2 - x ** 2)\n        ctx.add_tube(f\"cage_rib_{k}\", [(x, cy + h * u, 0.292 + 0.009 * (1 - u * u)) for u in np.linspace(-1, 1, 15)], radius=0.004, mat=brass)\n    # --- five-gear clockwork train, raised onto camera-facing flank above the rail (module 5 mm, true pitch) ---\n    ctx.add_bevel_box(\"gear_mount_plate\", size=(0.012, 0.20, 0.39), pos=(sd * 0.178, 0.31, 0.025), bevel=0.003, mat=patina)\n    m, Ns, angs = 0.005, [36, 16, 26, 16, 20], [25, -25, 40, -45]\n    centers, phis = [(0.31, -0.15)], [0.0]\n    for k, a in enumerate(angs):\n        d, b = m * (Ns[k] + Ns[k + 1]) / 2.0, math.radians(a)\n        y, z = centers[-1]; centers.append((y + d * math.sin(b), z + d * math.cos(b)))\n        f = ((b - phis[k]) / (2 * math.pi / Ns[k])) % 1.0\n        phis.append(b + math.pi - (2 * math.pi / Ns[k + 1]) * (0.5 - f))\n    for k, (N, c) in enumerate(zip(Ns, centers)):\n        gear(\"gear_train_main\" if k == 0 else f\"gear_train_{k}\", N, m, c, phis[k], brass if k % 2 == 0 else copper)\n        ctx.add_tube(f\"gear_axle_{k}\", [(sd * 0.15, c[0], c[1]), (sd * 0.214, c[0], c[1])], radius=0.008, mat=iron)\n        ctx.add_tube(f\"gear_bearing_{k}\", [(sd * 0.183, c[0], c[1]), (sd * 0.1905, c[0], c[1])], radius=0.017, mat=iron)\n        ctx.add_tube(f\"gear_nut_{k}\", [(sd * 0.2045, c[0], c[1]), (sd * 0.213, c[0], c[1])], radius=0.013, mat=iron)\n        if k < 2:                                          # gilded pitch-circle inlays on the meshing pair\n            ring(f\"gear_pitch_ring_{k}\", m * N / 2.0, c, sd * 0.2065, 0.0015, gold)\n    # --- twin copper exhaust stacks with flared crowned caps (top = world ~1.30) ---\n    sprof = [(0, 0.38), (0.03, 0.38), (0.03, 0.585), (0.042, 0.602), (0.045, 0.612), (0.032, 0.622), (0, 0.624)]\n    for sx in (-0.07, 0.07):\n        ctx.add_lathe(\"exhaust_stack\", sprof, pos=(sx, 0, -0.19), segs=28, mat=copper)\n        ctx.add_tube(\"stack_collar\", [(sx + math.cos(t) * 0.033, 0.43, -0.19 + math.sin(t) * 0.033) for t in np.linspace(0, 2 * math.pi, 25)[:-1]], radius=0.006, closed=True, mat=brass)\n    # --- outrigger pylons, nacelles & twisted 4-blade props (disk r=0.17 @ |x|=0.38 -> inner sweep |x|>=0.21; gears sit at |x|<=0.214 only above y=0.22 => clear through full loop) ---\n    for s, tag in ((-1, \"L\"), (1, \"R\")):\n        foil = lambda x, c, t: [(x, axY + yy * t, zp + zz * c) for yy, zz in ((0, .5), (.5, .15), (.35, -.3), (0, -.5), (-.35, -.3), (-.5, .15))]\n        loft(f\"pylon_fairing_{tag}\", [foil(s * 0.15, 0.14, 0.03), foil(s * 0.25, 0.11, 0.024), foil(s * 0.345, 0.09, 0.018)], brass)\n        ctx.add_tube(f\"pylon_strut_{tag}\", [(s * 0.2, 0.02, zp), (s * 0.36, axY - 0.04, zp)], radius=0.009, mat=brass)\n        cx, zc = s * 0.38, zp + 0.10\n        ctx.add_lathe(f\"nacelle_{tag}\", [(0, -0.11), (0.03, -0.1), (0.045, -0.06), (0.045, 0.06), (0.035, 0.09), (0, 0.095)], pos=(cx, axY, zp), rot_deg=(90, 0, 0), segs=32, mat=brass)\n        ctx.add_lathe(f\"prop_{tag}\", [(0, -0.05), (0.03, -0.04), (0.04, 0), (0.03, 0.04), (0, 0.05)], pos=(cx, axY, zc), rot_deg=(90, 0, 0), segs=24, mat=gold)\n        for b in range(4):\n            a, secs = math.pi / 4 + b * math.pi / 2, []\n            for sr, ch, th, ph in ((0.03, .05, .008, 60), (0.07, .06, .006, 42), (0.12, .05, .004, 28), (0.165, .022, .002, 18)):\n                p, T, f = np.array([cx + sr * math.cos(a), axY + sr * math.sin(a), zc]), s * np.array([-math.sin(a), math.cos(a), 0]), math.radians(ph)\n                D, Nn = math.cos(f) * T + np.array([0, 0, math.sin(f)]), -math.sin(f) * T + np.array([0, 0, math.cos(f)])\n                secs.append([tuple(p + D * u * ch / 2 + Nn * v * th / 2) for u, v in ((1, 1), (-1, 1), (-1, -1), (1, -1))])\n            loft(f\"prop_{tag}_blade_{b}\", secs, brass)\n    # --- look-dev: brushed brass w/ heat bluing, oxidized+sooted copper, dark worn iron bearings ---\n    ctx.surface_story(\"brass\", edge_wear=0.45, dust=0.08, grime_height=0.18, scratches=0.22, wear_color=\"#3E4C78\")\n    ctx.surface_story(\"brass_patina\", edge_wear=0.3, dust=0.2, grime_height=0.3, scratches=0.08, wear_color=\"#5E8070\")\n    ctx.surface_story(\"copper\", edge_wear=0.25, dust=0.12, grime_height=0.65, scratches=0.08, wear_color=\"#4E7D6A\")\n    ctx.surface_story(\"iron_black\", edge_wear=0.18, dust=0.22, grime_height=0.3, scratches=0.28, wear_color=\"#5A5650\")"
      }
    },
    {
      "id": "mast_and_cloth_sail",
      "name": "Turned Mahogany Mast, Yardarm, Bronze Rigging & PBD Cloth Main Sail",
      "category": "vehicle/rigging",
      "role": "decor",
      "reusable": true,
      "tags": [
        "mast",
        "yardarm",
        "rigging",
        "bronze-cable",
        "sail",
        "pbd-cloth",
        "canvas",
        "gold-hem"
      ],
      "pos": [
        0,
        0.668,
        0.32
      ],
      "rotDeg": [
        0,
        0,
        0
      ],
      "scale": [
        1,
        1,
        1
      ],
      "boundsHintM": {
        "size": [
          0.95,
          1.328,
          0.9
        ]
      },
      "attach": {
        "parent": "hull_and_helm_deck",
        "mode": "seat_on",
        "face": "+y",
        "offset": [
          0,
          -0.444,
          0.32
        ],
        "overlapM": 0.004
      },
      "nodes": [],
      "generator": {
        "runtime": "blender_py_v3",
        "entry": "build",
        "seed": 138,
        "summary": "Turned Mahogany Mast, Yardarm, Bronze Rigging & PBD Cloth Main Sail",
        "code": "def build(ctx):\n    P = ctx.params\n    deck_y = P.get(\"deckY\", 0.676)\n    top_local = P.get(\"mastTopY\", 2.0) - deck_y            # 1.324 finial tip\n    yard_y = P.get(\"yardarmY\", 1.72) - deck_y              # 1.044\n    boom_y = 1.0 - deck_y                                   # 0.324\n    rail_top = P.get(\"gunwaleRailHeightM\", 0.16)\n    yard_span, boom_span = P.get(\"yardarmSpanM\", 0.9), 0.70\n    r0, r1 = P.get(\"mastBaseDiameterM\", 0.085) * 0.5, 0.025\n    mah, brs, gold = ctx.mat(\"mahogany\"), ctx.mat(\"brass\"), ctx.mat(\"gold_trim\")\n    cable = ctx.mat(\"bronze_cable\")\n    # Fine canvas weave, slightly deeper cream so it does not clip to peach-white\n    canvas = ctx.make_material(\"canvas_weave_fine\", base_color=\"#DCCBA6\", roughness=0.86, sheen=0.3,\n                               noise_scale=220.0, bump_strength=0.09, ao_wear=0.15, ao_color=\"#A8916A\")\n\n    ctx.add_lathe(\"mast_step_collar\", [(0.0, 0.0), (0.072, 0.0), (0.072, 0.012), (0.060, 0.026),\n                  (0.050, 0.044), (0.0, 0.044)], segs=40, lip_bevel=0.002, mat=brs)\n    mast_h = top_local - 0.068\n    prof = [(0.0, 0.006)] + [(r0 + (r1 - r0) * (i / 12.0) ** 0.85, 0.006 + (i / 12.0) * (mast_h - 0.006))\n                             for i in range(13)] + [(0.0, mast_h)]\n    ctx.add_lathe(\"mast_shaft\", prof, segs=36, lip_bevel=0.002, mat=mah)\n    mast_r = lambda y: r0 + (r1 - r0) * max(0.0, min(1.0, (y - 0.006) / (mast_h - 0.006))) ** 0.85\n    for i, fy in enumerate((0.06, 0.62, mast_h - 0.03)):\n        rr = mast_r(fy) + 0.004\n        ctx.add_lathe(f\"mast_ferrule_{i}\", [(0.0, fy - 0.012), (rr, fy - 0.012), (rr + 0.002, fy),\n                      (rr, fy + 0.012), (0.0, fy + 0.012)], segs=36, mat=brs)\n    fb = mast_h - 0.004\n    ctx.add_lathe(\"masthead_finial\", [(0.0, fb), (0.028, fb), (0.031, fb + 0.012), (0.024, fb + 0.020),\n                  (0.026, fb + 0.034), (0.020, fb + 0.052), (0.008, fb + 0.066), (0.0, top_local)], segs=32, mat=gold)\n    ring_ys = (0.52, 0.90, yard_y + 0.07)\n    for i, ry in enumerate(ring_ys):\n        rr = mast_r(ry) + 0.006\n        ctx.add_tube(f\"rigging_ring_{i}\", [(rr * math.cos(a * math.tau / 24), ry, rr * math.sin(a * math.tau / 24))\n                     for a in range(24)], radius=0.0055, closed=True, tubular_segs=48, radial_segs=12, mat=brs)\n\n    # --- Yardarm & boom with parrel collars, gold tip caps ---\n    spars = {}\n    for nm, sy, span, rad in ((\"yardarm\", yard_y, yard_span, 0.021), (\"boom\", boom_y, boom_span, 0.024)):\n        zz = mast_r(sy) + rad + 0.004\n        spars[nm] = (sy, zz, rad)\n        path = [(-span / 2 + span * k / 8, sy, zz) for k in range(9)]\n        ctx.add_tube(nm, path, radius=rad, taper=[0.55 + 0.45 * math.sin(math.pi * k / 8) for k in range(9)],\n                     tubular_segs=40, radial_segs=18, mat=mah)\n        ctx.add_lathe(f\"{nm}_parrel_collar\", [(0.0, -0.022), (rad + 0.006, -0.022), (rad + 0.009, 0.0),\n                      (rad + 0.006, 0.022), (0.0, 0.022)], pos=(0.0, sy, zz), rot_deg=(0, 0, 90), segs=28, mat=brs)\n        for s in (-1, 1):\n            ctx.add_lathe(f\"{nm}_tip_cap_{'L' if s < 0 else 'R'}\", [(0.0, 0.0), (rad * 0.6, 0.0), (rad * 0.6, 0.018),\n                          (0.0, 0.026)], pos=(s * span / 2, sy, zz), rot_deg=(0, 0, -90 * s), segs=20, mat=gold)\n\n    # --- Four tensioned bronze stays -> turnbuckles -> chainplates ---\n    for key, (ax, az) in {\"bow\": (0.0, 0.42), \"stern\": (0.0, -0.42), \"port\": (-0.38, 0.0), \"starboard\": (0.38, 0.0)}.items():\n        ctx.add_bevel_box(f\"chainplate_{key}\", (0.034, 0.10, 0.012) if az else (0.012, 0.10, 0.034),\n                          pos=(ax, 0.05, az), bevel=0.002, mat=brs)\n        L = math.hypot(ax, az)\n        rr = mast_r(ring_ys[2]) + 0.006\n        sx, sz, ty = ax / L * rr, az / L * rr, 0.19\n        ctx.add_tube(f\"stay_{key}\", [(sx + (ax - sx) * t, ring_ys[2] + (ty - ring_ys[2]) * t - 0.005 * math.sin(math.pi * t),\n                     sz + (az - sz) * t) for t in [k / 11.0 for k in range(12)]], radius=0.004,\n                     tubular_segs=40, radial_segs=10, mat=cable)\n        ctx.add_tube(f\"turnbuckle_{key}\", [(ax, ty + 0.004, az), (ax, 0.15, az), (ax, 0.12, az), (ax, 0.096, az)],\n                     radius=0.0075, taper=[0.6, 1.0, 1.0, 0.6], tubular_segs=12, radial_segs=12, mat=brs)\n\n    # --- Main sail: head pinned under yardarm, foot lashed just above boom ---\n    ys, yz, yr = spars[\"yardarm\"]\n    bs, bz, br = spars[\"boom\"]\n    head_y, foot_y = ys - yr - 0.006, bs + br + 0.05      # foot >> rail_top + 0.06\n    chord = yard_span - 0.07\n    sail_w, sail_h = chord * 1.08, head_y - foot_y          # ~8% excess for a convex belly\n    sail_z = max(yz, bz) + 0.012\n    for k in range(7):                                       # visible brass hanks pinning the head\n        hx = -chord / 2 + chord * k / 6\n        ctx.add_tube(f\"sail_hank_{k}\", [(hx, ys + (yr + 0.007) * math.cos(a * math.tau / 16),\n                     yz + (yr + 0.007) * math.sin(a * math.tau / 16)) for a in range(16)],\n                     radius=0.003, closed=True, tubular_segs=32, radial_segs=8, mat=brs)\n    kw = dict(size=(sail_w, sail_h), pos=(0.0, head_y, sail_z), subdiv=40, frames=48,\n              collider_names=[\"mast_shaft\", \"yardarm\", \"boom\"], mat=canvas, thickness=0.003,\n              wind=(0.35, 0.0, 1.45), hem_trim=True, hem_mat=gold)\n    try:\n        try:\n            ctx.drape_cloth(\"main_sail\", pin_edges=(\"top\", \"bottom\"), **kw)\n        except TypeError:\n            ctx.drape_cloth(\"main_sail\", pin_mode=\"top_edge\", wind=(0.35, 0.0, 1.45), hem_trim=True, hem_mat=ctx.mat(\"gold_trim\"), **kw)\n    except Exception:\n        bm, nu, nv, th = ctx.new_bmesh(), 28, 22, 0.003\n        F, B = {}, {}\n        for i in range(nu + 1):\n            for j in range(nv + 1):\n                u, v = i / nu, j / nv\n                z = sail_z + 0.085 * math.sin(math.pi * u) * math.sin(math.pi * v) ** 0.7 + 0.012 * u\n                p = (-chord / 2 + chord * u, foot_y + sail_h * v)\n                F[i, j], B[i, j] = bm.verts.new(ctx.p(p[0], p[1], z + th)), bm.verts.new(ctx.p(p[0], p[1], z))\n        for i in range(nu):\n            for j in range(nv):\n                bm.faces.new((F[i, j], F[i + 1, j], F[i + 1, j + 1], F[i, j + 1]))\n                bm.faces.new((B[i, j + 1], B[i + 1, j + 1], B[i + 1, j], B[i, j]))\n        rim = [(i, 0) for i in range(nu)] + [(nu, j) for j in range(nv)] + \\\n              [(i, nv) for i in range(nu, 0, -1)] + [(0, j) for j in range(nv, 0, -1)]\n        for k in range(len(rim)):\n            a, b = rim[k], rim[(k + 1) % len(rim)]\n            bm.faces.new((F[a], B[a], B[b], F[b]))\n        bm.normal_update()\n        ctx.commit_bmesh(bm, \"main_sail\", mat=canvas, smooth_angle_deg=60.0)\n        for side, jj in ((\"head\", nv), (\"foot\", 0)):\n            ctx.add_tube(f\"sail_hem_{side}\", [(-chord / 2 + chord * i / nu, foot_y + sail_h * jj / nv,\n                         sail_z + th * 0.5 + 0.012 * i / nu + 0.085 * math.sin(math.pi * i / nu) * math.sin(math.pi * jj / nv) ** 0.7)\n                         for i in range(nu + 1)], radius=0.0035, tubular_segs=56, radial_segs=8, mat=gold)\n\n    ctx.surface_story(\"mahogany\", edge_wear=0.32, dust=0.12, grime_height=0.18, scratches=0.14)\n    ctx.surface_story(\"brass\", edge_wear=0.45, dust=0.10, grime_height=0.12, scratches=0.18, wear_color=\"#6F7F5A\")\n    ctx.surface_story(\"canvas_weave_fine\", edge_wear=0.08, dust=0.10, grime_height=0.10, scratches=0.0)"
      }
    }
  ],
  "sockets": [
    {
      "id": "skiff_keel_seat",
      "role": "seat",
      "pos": [
        0,
        0.22,
        0
      ],
      "normal": [
        0,
        1,
        0
      ],
      "radiusM": 0.25
    },
    {
      "id": "deck_boiler_mount",
      "role": "surface",
      "pos": [
        0,
        0.676,
        -0.12
      ],
      "normal": [
        0,
        1,
        0
      ],
      "radiusM": 0.25
    },
    {
      "id": "mast_step",
      "role": "surface",
      "pos": [
        0,
        0.676,
        0.32
      ],
      "normal": [
        0,
        1,
        0
      ],
      "radiusM": 0.25
    },
    {
      "id": "prop_axis_L",
      "role": "surface",
      "pos": [
        -0.46,
        0.86,
        -0.12
      ],
      "normal": [
        0,
        1,
        0
      ],
      "radiusM": 0.25
    },
    {
      "id": "prop_axis_R",
      "role": "surface",
      "pos": [
        0.46,
        0.86,
        -0.12
      ],
      "normal": [
        0,
        1,
        0
      ],
      "radiusM": 0.25
    }
  ],
  "exclusions": [
    {
      "id": "camera_clear_front",
      "reason": "clearance",
      "min": [
        -0.6,
        0,
        1.15
      ],
      "max": [
        0.6,
        2.1,
        4.5
      ]
    },
    {
      "id": "sail_swing_volume",
      "reason": "clearance",
      "min": [
        -0.5,
        0.95,
        0.05
      ],
      "max": [
        0.5,
        1.95,
        0.95
      ]
    }
  ],
  "lighting": {
    "environmentPreset": "twilight_warm",
    "sun": {
      "azimuthDeg": 225,
      "elevationDeg": 18,
      "intensity": 0.6,
      "kelvin": 3600,
      "angularDiameterDeg": 1.2,
      "airDensity": 1.05,
      "aerosolDensity": 0.9,
      "ozoneDensity": 1.5
    },
    "exposureEV": 0.3,
    "toneMapping": "AgX",
    "agxLook": "AgX - Medium High Contrast",
    "ambientStrength": 0.12,
    "emitters": [
      {
        "id": "key_golden",
        "type": "area",
        "pos": [
          -2.4,
          2.8,
          2.6
        ],
        "target": [
          0,
          1,
          0
        ],
        "size": [
          1.6,
          1.2
        ],
        "powerW": 900,
        "kelvin": 3200
      },
      {
        "id": "rim_sapphire",
        "type": "area",
        "pos": [
          2.2,
          2.6,
          -2.6
        ],
        "target": [
          0,
          1.3,
          0
        ],
        "size": [
          1.2,
          1.8
        ],
        "powerW": 750,
        "kelvin": 9500
      },
      {
        "id": "sail_rim_gold",
        "type": "spot",
        "pos": [
          -1.2,
          3.2,
          -2.2
        ],
        "target": [
          0,
          1.45,
          0.32
        ],
        "radius": 0.15,
        "powerW": 420,
        "kelvin": 2900
      },
      {
        "id": "fill_soft",
        "type": "area",
        "pos": [
          2.6,
          1.2,
          2.2
        ],
        "target": [
          0,
          0.8,
          0
        ],
        "size": [
          1,
          1
        ],
        "powerW": 160,
        "kelvin": 4200
      },
      {
        "id": "furnace_core_glow",
        "type": "point",
        "pos": [
          0,
          0.86,
          -0.12
        ],
        "radius": 0.08,
        "powerW": 45,
        "kelvin": 2300
      },
      {
        "id": "binnacle_glow",
        "type": "point",
        "pos": [
          0,
          0.95,
          -0.62
        ],
        "radius": 0.03,
        "powerW": 6,
        "kelvin": 2600
      },
      {
        "id": "stern_lantern",
        "type": "point",
        "pos": [
          0,
          1.02,
          -1.04
        ],
        "radius": 0.04,
        "powerW": 14,
        "kelvin": 2400
      }
    ],
    "optics": {
      "glareThreshold": 1.35,
      "glareMix": 0.24,
      "vignette": 0.16,
      "grain": 0.02,
      "dofFStop": 5.6,
      "focusDistM": 4.2
    }
  },
  "lightmap": {
    "uv2Policy": "auto_smart_project",
    "texelDensityPxPerM": 64,
    "atlasSize": 2048,
    "marginPx": 4,
    "bakeMode": "cycles_combined",
    "castShadow": true,
    "receiveShadow": true
  },
  "lodRules": {
    "tiers": {
      "lod0": {
        "segScale": 1,
        "maxTris": 250000,
        "includeMicroDecor": true
      },
      "lod1": {
        "segScale": 0.65,
        "maxTris": 80000,
        "includeMicroDecor": true
      },
      "lod2": {
        "segScale": 0.35,
        "maxTris": 20000,
        "includeMicroDecor": false
      }
    },
    "materialSlotsInvariant": true
  },
  "compilationTiers": {
    "realtime": true
  },
  "portals": [],
  "cameras": [
    {
      "id": "hero",
      "name": "hero",
      "kind": "hero",
      "pos": [
        2.9,
        1.45,
        4.1
      ],
      "target": [
        0,
        0.98,
        0
      ],
      "focalLengthMm": 35,
      "shiftY": 0
    },
    {
      "id": "grazing",
      "name": "grazing",
      "kind": "hero",
      "pos": [
        -2.3,
        0.42,
        1.9
      ],
      "target": [
        0,
        0.72,
        -0.1
      ],
      "focalLengthMm": 35,
      "shiftY": 0
    },
    {
      "id": "detail_helm",
      "name": "detail_helm",
      "kind": "hero",
      "pos": [
        0.9,
        1.35,
        -1.9
      ],
      "target": [
        0,
        0.92,
        -0.75
      ],
      "focalLengthMm": 35,
      "shiftY": 0
    }
  ],
  "rig": {
    "preset": "custom",
    "rootBone": "root",
    "bones": [
      {
        "id": "root",
        "head": [
          0,
          0,
          0
        ],
        "tail": [
          0,
          0.1,
          0
        ]
      },
      {
        "id": "prop_L",
        "parent": "root",
        "head": [
          -0.46,
          0.86,
          -0.12
        ],
        "tail": [
          -0.46,
          0.86,
          -0.02
        ]
      },
      {
        "id": "prop_R",
        "parent": "root",
        "head": [
          0.46,
          0.86,
          -0.12
        ],
        "tail": [
          0.46,
          0.86,
          -0.02
        ]
      },
      {
        "id": "gear_train_main",
        "parent": "root",
        "head": [
          0,
          0.84,
          -0.12
        ],
        "tail": [
          -0.1,
          0.84,
          -0.12
        ]
      },
      {
        "id": "helm_wheel",
        "parent": "root",
        "head": [
          0,
          1.02,
          -0.82
        ],
        "tail": [
          0,
          1.02,
          -0.72
        ]
      },
      {
        "id": "stern_lantern_pivot",
        "parent": "root",
        "head": [
          0,
          1.12,
          -1.04
        ],
        "tail": [
          0,
          1.02,
          -1.04
        ]
      }
    ]
  },
  "motion": {
    "fps": 30,
    "durationSec": 4,
    "clips": [
      {
        "id": "idle_aether_spin",
        "name": "idle_aether_spin",
        "loop": true,
        "tracks": [
          {
            "targetGroupId": "aether_propulsion_assembly",
            "property": "rotYDeg",
            "mode": "oscillate",
            "amplitude": 10,
            "speedHz": 0.25
          },
          {
            "targetGroupId": "aether_propulsion_assembly",
            "property": "rotYDeg",
            "mode": "oscillate",
            "amplitude": 10,
            "speedHz": 0.25
          },
          {
            "targetGroupId": "aether_propulsion_assembly",
            "property": "rotYDeg",
            "mode": "oscillate",
            "amplitude": 10,
            "speedHz": 0.25
          },
          {
            "targetGroupId": "hull_and_helm_deck",
            "property": "rotYDeg",
            "mode": "oscillate",
            "amplitude": 10,
            "speedHz": 0.25
          },
          {
            "targetGroupId": "aether_propulsion_assembly",
            "property": "rotYDeg",
            "mode": "oscillate",
            "amplitude": 10,
            "speedHz": 0.25
          }
        ]
      }
    ]
  },
  "colliders": [
    {
      "groupId": "drydock_cradle_plinth",
      "shape": "box"
    },
    {
      "groupId": "hull_and_helm_deck",
      "shape": "box"
    },
    {
      "groupId": "mast_and_cloth_sail",
      "shape": "box"
    }
  ]
}