diff --git a/models.lock.json b/models.lock.json index 3663745..d9a496f 100644 --- a/models.lock.json +++ b/models.lock.json @@ -67,7 +67,7 @@ "address": "@medieval-kit/wooden-barrel", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.217Z", + "installedAt": "2026-08-23T04:20:17.528Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-barrel\\model.ts", @@ -82,7 +82,7 @@ "address": "@medieval-kit/core", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.197Z", + "installedAt": "2026-08-23T04:20:17.509Z", "files": [ { "path": "src\\models\\medieval-kit\\core\\geometry.ts", @@ -129,7 +129,7 @@ "address": "@medieval-kit/wooden-crate", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.221Z", + "installedAt": "2026-08-23T04:20:17.533Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-crate\\model.ts", @@ -144,7 +144,7 @@ "address": "@medieval-kit/kit", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.227Z", + "installedAt": "2026-08-23T04:20:17.539Z", "files": [], "dependencies": [] }, @@ -152,7 +152,7 @@ "address": "@medieval-kit/iron-anvil", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.206Z", + "installedAt": "2026-08-23T04:20:17.517Z", "files": [ { "path": "src\\models\\medieval-kit\\iron-anvil\\model.ts", @@ -167,7 +167,7 @@ "address": "@medieval-kit/wooden-bucket", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.219Z", + "installedAt": "2026-08-23T04:20:17.530Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-bucket\\model.ts", @@ -182,7 +182,7 @@ "address": "@medieval-kit/wooden-fence", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.222Z", + "installedAt": "2026-08-23T04:20:17.534Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-fence\\model.ts", @@ -197,7 +197,7 @@ "address": "@medieval-kit/wooden-hoe", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.223Z", + "installedAt": "2026-08-23T04:20:17.535Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-hoe\\model.ts", @@ -212,7 +212,7 @@ "address": "@medieval-kit/wooden-ladder", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.224Z", + "installedAt": "2026-08-23T04:20:17.536Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-ladder\\model.ts", @@ -227,11 +227,11 @@ "address": "@medieval-kit/wooden-pitchfork", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.226Z", + "installedAt": "2026-08-23T04:20:17.537Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-pitchfork\\model.ts", - "sourceHash": "50b1bff210c59f3fc25a985d635fcbdd4b4001a0409700c7b79eb8237133e746" + "sourceHash": "a919c9da1b99d935be854751ba24134411561bcdb344e589fcf2f2e249113eab" } ], "dependencies": [ @@ -242,11 +242,11 @@ "address": "@medieval-kit/wooden-shovel", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.227Z", + "installedAt": "2026-08-23T04:20:17.538Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-shovel\\model.ts", - "sourceHash": "74bb893776b9e664a77e07945980e1ee16ae2a3277b6425b25d1ac2fa0424205" + "sourceHash": "b735415c9bb00977628e7681faaab80c89f9d144e737a760c1eed26b21045383" } ], "dependencies": [ @@ -257,7 +257,7 @@ "address": "@medieval-kit/wooden-stool", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.227Z", + "installedAt": "2026-08-23T04:20:17.539Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-stool\\model.ts", @@ -272,7 +272,7 @@ "address": "@medieval-kit/cart-wheel", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.201Z", + "installedAt": "2026-08-23T04:20:17.512Z", "files": [ { "path": "src\\models\\medieval-kit\\cart-wheel\\model.ts", @@ -287,7 +287,7 @@ "address": "@medieval-kit/log-pile", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.210Z", + "installedAt": "2026-08-23T04:20:17.521Z", "files": [ { "path": "src\\models\\medieval-kit\\log-pile\\model.ts", @@ -302,7 +302,7 @@ "address": "@medieval-kit/trestle-table", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.215Z", + "installedAt": "2026-08-23T04:20:17.526Z", "files": [ { "path": "src\\models\\medieval-kit\\trestle-table\\model.ts", @@ -317,7 +317,7 @@ "address": "@medieval-kit/wooden-chest", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.221Z", + "installedAt": "2026-08-23T04:20:17.531Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-chest\\model.ts", @@ -332,7 +332,7 @@ "address": "@medieval-kit/hay-bale", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.205Z", + "installedAt": "2026-08-23T04:20:17.516Z", "files": [ { "path": "src\\models\\medieval-kit\\hay-bale\\model.ts", @@ -347,7 +347,7 @@ "address": "@medieval-kit/pitch-torch", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.212Z", + "installedAt": "2026-08-23T04:20:17.523Z", "files": [ { "path": "src\\models\\medieval-kit\\pitch-torch\\model.ts", @@ -362,7 +362,7 @@ "address": "@medieval-kit/wooden-bench", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.218Z", + "installedAt": "2026-08-23T04:20:17.529Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-bench\\model.ts", @@ -377,7 +377,7 @@ "address": "@medieval-kit/linen-sack", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.209Z", + "installedAt": "2026-08-23T04:20:17.520Z", "files": [ { "path": "src\\models\\medieval-kit\\linen-sack\\model.ts", @@ -392,7 +392,7 @@ "address": "@medieval-kit/oak-tankard", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.211Z", + "installedAt": "2026-08-23T04:20:17.522Z", "files": [ { "path": "src\\models\\medieval-kit\\oak-tankard\\model.ts", @@ -407,7 +407,7 @@ "address": "@medieval-kit/straw-broom", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.213Z", + "installedAt": "2026-08-23T04:20:17.524Z", "files": [ { "path": "src\\models\\medieval-kit\\straw-broom\\model.ts", @@ -422,7 +422,7 @@ "address": "@medieval-kit/bronze-bell", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.200Z", + "installedAt": "2026-08-23T04:20:17.511Z", "files": [ { "path": "src\\models\\medieval-kit\\bronze-bell\\model.ts", @@ -437,7 +437,7 @@ "address": "@medieval-kit/iron-lantern", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.207Z", + "installedAt": "2026-08-23T04:20:17.518Z", "files": [ { "path": "src\\models\\medieval-kit\\iron-lantern\\model.ts", @@ -452,7 +452,7 @@ "address": "@medieval-kit/tavern-sign", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.214Z", + "installedAt": "2026-08-23T04:20:17.525Z", "files": [ { "path": "src\\models\\medieval-kit\\tavern-sign\\model.ts", @@ -467,7 +467,7 @@ "address": "@medieval-kit/coin-pouch", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.202Z", + "installedAt": "2026-08-23T04:20:17.513Z", "files": [ { "path": "src\\models\\medieval-kit\\coin-pouch\\model.ts", @@ -482,7 +482,7 @@ "address": "@medieval-kit/glass-phial", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.204Z", + "installedAt": "2026-08-23T04:20:17.514Z", "files": [ { "path": "src\\models\\medieval-kit\\glass-phial\\model.ts", @@ -497,7 +497,7 @@ "address": "@medieval-kit/leather-book", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.208Z", + "installedAt": "2026-08-23T04:20:17.519Z", "files": [ { "path": "src\\models\\medieval-kit\\leather-book\\model.ts", @@ -512,7 +512,7 @@ "address": "@medieval-kit/wicker-basket", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T04:12:22.216Z", + "installedAt": "2026-08-23T04:20:17.527Z", "files": [ { "path": "src\\models\\medieval-kit\\wicker-basket\\model.ts", diff --git a/my-registry/meta.ts b/my-registry/meta.ts index ec87467..3748199 100644 --- a/my-registry/meta.ts +++ b/my-registry/meta.ts @@ -512,7 +512,7 @@ export const MODEL_META: Readonly> = { bladeAngle: { type: 'number', label: 'Blade angle', min: 0, max: 25, step: 1, unit: 'degrees' }, seed: { type: 'number', label: 'Variation seed', min: 1, max: 64, step: 1 }, }, - materialSlots: ['oak', 'iron', 'steel'], + materialSlots: ['oak', 'iron'], parts: ['shaft', 'socket', 'blade'], }, 'wooden-pitchfork': { @@ -529,10 +529,10 @@ export const MODEL_META: Readonly> = { }, tineCount: { type: 'number', label: 'Tine count', min: 2, max: 6, step: 1 }, spread: { type: 'number', label: 'Tine spread', min: 0, max: 0.4, step: 0.01 }, - tineLength: { type: 'number', label: 'Tine length', min: 0.1, max: 0.32, step: 0.01 }, + tineLength: { type: 'number', label: 'Tine length', min: 0.1, max: 0.42, step: 0.01 }, seed: { type: 'number', label: 'Variation seed', min: 1, max: 64, step: 1 }, }, - materialSlots: ['oak', 'iron', 'steel'], + materialSlots: ['oak', 'iron'], parts: ['shaft', 'socket', 'tines'], }, } diff --git a/my-registry/models/wooden-pitchfork/model.ts b/my-registry/models/wooden-pitchfork/model.ts index d403ec8..127511c 100644 --- a/my-registry/models/wooden-pitchfork/model.ts +++ b/my-registry/models/wooden-pitchfork/model.ts @@ -9,13 +9,13 @@ * point, and none of them sits at exactly the same angle as its neighbour. All * three were fixed here. */ -import { type BufferGeometry } from 'three' +import { Color, type BufferGeometry } from 'three' import { chamferedBoxGeometry, createKitModel, + createTinter, ironTint, - steelTint, jitter, bendGeometry, latheGeometry, @@ -40,20 +40,28 @@ export interface WoodenPitchforkConfig { export const woodenPitchforkDefaults: WoodenPitchforkConfig = { length: 1.5, shaftRadius: 0.021, - tineCount: 3, - spread: 0.2, - tineLength: 0.24, + // Four tines and longer ones. Three is a garden fork; a hay fork has four + // or five, and the tines are the working length of the tool -- at 0.24 on a + // 1.5 m shaft they were 16% of it against roughly 22% in the reference, and + // read as stubs rather than as something you could lift a forkful with. + // Tines run close to parallel, splaying only a little. Fanned out like a + // claw they read as a garden cultivator; a hay fork's tines stay together + // so a forkful stays on them. + tineCount: 4, + spread: 0.15, + tineLength: 0.34, seed: 37, } export type WoodenPitchforkParts = 'shaft' | 'socket' | 'tines' export function createModel(overrides: Partial = {}) { - return createKitModel({ + return createKitModel({ id: 'wooden-pitchfork', defaults: woodenPitchforkDefaults, - slots: ['oak', 'iron', 'steel'], + slots: ['oak', 'iron'], build: ({ config, random }) => { + const tint = createTinter(random) const tineSpan = config.length * config.tineLength const shaftLength = config.length - tineSpan * 0.86 const shaft = toolShaft({ length: shaftLength, radius: config.shaftRadius, random }) @@ -95,9 +103,13 @@ export function createModel(overrides: Partial = {}) { { y: tineSpan * 0.9, radius: radius * 0.42 }, { y: tineSpan, radius: radius * 0.12 }, // pointed but not zero ] - const tine = latheGeometry(profile, 6, [0, 0, 0], steelTint(random, -0.05), { + // Oak, not steel. The model is called wooden-pitchfork and the + // reference is exactly that: a hay fork was cut and steamed from wood, + // because iron tines are heavy at the end of a long shaft and hay does + // not need an edge. The socket stays iron -- that is the ferrule. + const tine = latheGeometry(profile, 6, [0, 0, 0], new Color(tint('oak', -0.03)), { capTop: false, - colourTop: steelTint(random, 0.05), + colourTop: new Color(tint('oakEnd', 0.06)), }) // Curve: a straight tine looks like a technical drawing. A real pitchfork // tine is bent forward — so it does not drop the straw it has lifted. @@ -114,7 +126,7 @@ export function createModel(overrides: Partial = {}) { return { shaft: { slot: 'oak', geometry: shaft.geometry }, socket: { slot: 'iron', geometry: socket }, - tines: { slot: 'steel', geometry: mergeColoured(pieces) }, + tines: { slot: 'oak', geometry: mergeColoured(pieces) }, } }, }, overrides) diff --git a/my-registry/models/wooden-shovel/model.ts b/my-registry/models/wooden-shovel/model.ts index e4ef76d..9121bb5 100644 --- a/my-registry/models/wooden-shovel/model.ts +++ b/my-registry/models/wooden-shovel/model.ts @@ -18,15 +18,16 @@ * the tip. A foot tread at the back — on a real shovel the top edge of the * blade is folded over, to press down on with the foot. */ -import { type BufferGeometry } from 'three' +import { Color, type BufferGeometry } from 'three' import { chamferedBoxGeometry, createKitModel, + createTinter, dishedSheetGeometry, ironTint, - steelTint, mergeColoured, + prismGeometry, toolShaft, toolSocket, type SheetLevel, @@ -59,15 +60,38 @@ export const woodenShovelDefaults: WoodenShovelConfig = { export type WoodenShovelParts = 'shaft' | 'socket' | 'blade' export function createModel(overrides: Partial = {}) { - return createKitModel({ + return createKitModel({ id: 'wooden-shovel', defaults: woodenShovelDefaults, - slots: ['oak', 'iron', 'steel'], + slots: ['oak', 'iron'], build: ({ config, random }) => { + const tint = createTinter(random) const span = config.length * config.bladeLength const shaftLength = config.length - span * 0.82 const shaft = toolShaft({ length: shaftLength, radius: config.shaftRadius, random }) + // --- T-handle -------------------------------------------------------- + // The reference has one and this did not: the shaft simply ended in a + // swelled knob. A digging spade is worked with both hands and the lower + // one goes round a crossbar; it is the detail that separates a spade + // from a stick with a plate on the end, and it is right at the end of + // the silhouette where the eye lands. + // + // The bar crosses the grip swell rather than butting onto it, so the + // joint is an overlap like every other in the kit. + const gripSpan = config.shaftRadius * 8.6 + const grip = prismGeometry( + config.shaftRadius * 0.95, + config.shaftRadius * 0.82, + gripSpan, + 7, + [0, 0, 0], + new Color(tint('oak', 0.05)), + ) + // Built along Y; +90 degrees about Z lays it along X, across the blade. + grip.rotateZ(Math.PI / 2) + grip.translate(0, -shaft.top + config.shaftRadius * 0.9, 0) + const socketLength = config.length * 0.05 const socket = toolSocket({ y: shaft.top - socketLength * 0.3, @@ -98,7 +122,12 @@ export function createModel(overrides: Partial = {}) { { y: span, halfWidth: half * 0.44, thickness: t * 0.14, curve: curve * 0.48 }, ] - const sheet = dishedSheetGeometry(profile, 8, steelTint(random, -0.04), steelTint(random, 0.04)) + // Both colours copied out first: `createTinter` returns one Color and + // mutates it, so two tints inside one call would resolve to the same + // value. + const boardLow = new Color(tint('oak', -0.05)) + const boardHigh = new Color(tint('oakEnd', 0.03)) + const sheet = dishedSheetGeometry(profile, 8, boardLow, boardHigh) // Foot tread: the fold at the top edge of the blade, BEHIND the dish. It // must sit at shoulder height and be WIDE — this is where you step, and a @@ -109,7 +138,7 @@ export function createModel(overrides: Partial = {}) { t * 1.8, t * 0.34, [0, 0, 0], - steelTint(random, -0.07), + new Color(tint('oak', -0.1)), ) tread.rotateX(0.42) tread.translate(0, span * 0.12, -t * 1.7) @@ -137,10 +166,14 @@ export function createModel(overrides: Partial = {}) { } return { - shaft: { slot: 'oak', geometry: shaft.geometry }, + shaft: { slot: 'oak', geometry: mergeColoured([shaft.geometry, grip]) }, socket: { slot: 'iron', geometry: socket }, blade: { - slot: 'steel', + // Oak, not steel. A medieval digging shovel is a shaped board with + // an iron shoe along its lip -- the strap below is that shoe, and it + // has been there all along while the board it protects was rendered + // as a sheet of polished steel. + slot: 'oak', geometry: blade, extras: [{ slot: 'iron', geometry: strap }], }, diff --git a/scripts/verify-model.ts b/scripts/verify-model.ts index 5d69f28..778663f 100644 --- a/scripts/verify-model.ts +++ b/scripts/verify-model.ts @@ -317,7 +317,7 @@ const CASES: readonly Case[] = [ variants: [{ bladeLength: 0.18 }, { bladeLength: 0.4 }, { dish: 0 }, { bladeAngle: 25 }] , maxSize: [0.3, 1.4, 0.15] }, { id: 'wooden-pitchfork', make: as(createPitchfork), patch: { tineCount: 5, spread: 0.3 }, parts: 3, ownSlot: 'iron', borrowSlot: 'oak', - variants: [{ tineCount: 2 }, { spread: 0 }, { tineCount: 6 }] , maxSize: [0.3, 1.9, 0.15] }, + variants: [{ tineCount: 2 }, { spread: 0 }, { tineCount: 6 }] , maxSize: [0.4, 1.9, 0.2] }, { id: 'trestle-table', make: as(createTable), patch: { plankCount: 6, splay: 0.35 }, parts: 3, ownSlot: 'oak', borrowSlot: 'oak', closed: true, maxSize: [2.2, 0.9, 1.3], variants: [{ plankCount: 2 }, { splay: 0 }] }, diff --git a/src/models/medieval-kit/wooden-pitchfork/model.ts b/src/models/medieval-kit/wooden-pitchfork/model.ts index d403ec8..127511c 100644 --- a/src/models/medieval-kit/wooden-pitchfork/model.ts +++ b/src/models/medieval-kit/wooden-pitchfork/model.ts @@ -9,13 +9,13 @@ * point, and none of them sits at exactly the same angle as its neighbour. All * three were fixed here. */ -import { type BufferGeometry } from 'three' +import { Color, type BufferGeometry } from 'three' import { chamferedBoxGeometry, createKitModel, + createTinter, ironTint, - steelTint, jitter, bendGeometry, latheGeometry, @@ -40,20 +40,28 @@ export interface WoodenPitchforkConfig { export const woodenPitchforkDefaults: WoodenPitchforkConfig = { length: 1.5, shaftRadius: 0.021, - tineCount: 3, - spread: 0.2, - tineLength: 0.24, + // Four tines and longer ones. Three is a garden fork; a hay fork has four + // or five, and the tines are the working length of the tool -- at 0.24 on a + // 1.5 m shaft they were 16% of it against roughly 22% in the reference, and + // read as stubs rather than as something you could lift a forkful with. + // Tines run close to parallel, splaying only a little. Fanned out like a + // claw they read as a garden cultivator; a hay fork's tines stay together + // so a forkful stays on them. + tineCount: 4, + spread: 0.15, + tineLength: 0.34, seed: 37, } export type WoodenPitchforkParts = 'shaft' | 'socket' | 'tines' export function createModel(overrides: Partial = {}) { - return createKitModel({ + return createKitModel({ id: 'wooden-pitchfork', defaults: woodenPitchforkDefaults, - slots: ['oak', 'iron', 'steel'], + slots: ['oak', 'iron'], build: ({ config, random }) => { + const tint = createTinter(random) const tineSpan = config.length * config.tineLength const shaftLength = config.length - tineSpan * 0.86 const shaft = toolShaft({ length: shaftLength, radius: config.shaftRadius, random }) @@ -95,9 +103,13 @@ export function createModel(overrides: Partial = {}) { { y: tineSpan * 0.9, radius: radius * 0.42 }, { y: tineSpan, radius: radius * 0.12 }, // pointed but not zero ] - const tine = latheGeometry(profile, 6, [0, 0, 0], steelTint(random, -0.05), { + // Oak, not steel. The model is called wooden-pitchfork and the + // reference is exactly that: a hay fork was cut and steamed from wood, + // because iron tines are heavy at the end of a long shaft and hay does + // not need an edge. The socket stays iron -- that is the ferrule. + const tine = latheGeometry(profile, 6, [0, 0, 0], new Color(tint('oak', -0.03)), { capTop: false, - colourTop: steelTint(random, 0.05), + colourTop: new Color(tint('oakEnd', 0.06)), }) // Curve: a straight tine looks like a technical drawing. A real pitchfork // tine is bent forward — so it does not drop the straw it has lifted. @@ -114,7 +126,7 @@ export function createModel(overrides: Partial = {}) { return { shaft: { slot: 'oak', geometry: shaft.geometry }, socket: { slot: 'iron', geometry: socket }, - tines: { slot: 'steel', geometry: mergeColoured(pieces) }, + tines: { slot: 'oak', geometry: mergeColoured(pieces) }, } }, }, overrides) diff --git a/src/models/medieval-kit/wooden-shovel/model.ts b/src/models/medieval-kit/wooden-shovel/model.ts index e4ef76d..9121bb5 100644 --- a/src/models/medieval-kit/wooden-shovel/model.ts +++ b/src/models/medieval-kit/wooden-shovel/model.ts @@ -18,15 +18,16 @@ * the tip. A foot tread at the back — on a real shovel the top edge of the * blade is folded over, to press down on with the foot. */ -import { type BufferGeometry } from 'three' +import { Color, type BufferGeometry } from 'three' import { chamferedBoxGeometry, createKitModel, + createTinter, dishedSheetGeometry, ironTint, - steelTint, mergeColoured, + prismGeometry, toolShaft, toolSocket, type SheetLevel, @@ -59,15 +60,38 @@ export const woodenShovelDefaults: WoodenShovelConfig = { export type WoodenShovelParts = 'shaft' | 'socket' | 'blade' export function createModel(overrides: Partial = {}) { - return createKitModel({ + return createKitModel({ id: 'wooden-shovel', defaults: woodenShovelDefaults, - slots: ['oak', 'iron', 'steel'], + slots: ['oak', 'iron'], build: ({ config, random }) => { + const tint = createTinter(random) const span = config.length * config.bladeLength const shaftLength = config.length - span * 0.82 const shaft = toolShaft({ length: shaftLength, radius: config.shaftRadius, random }) + // --- T-handle -------------------------------------------------------- + // The reference has one and this did not: the shaft simply ended in a + // swelled knob. A digging spade is worked with both hands and the lower + // one goes round a crossbar; it is the detail that separates a spade + // from a stick with a plate on the end, and it is right at the end of + // the silhouette where the eye lands. + // + // The bar crosses the grip swell rather than butting onto it, so the + // joint is an overlap like every other in the kit. + const gripSpan = config.shaftRadius * 8.6 + const grip = prismGeometry( + config.shaftRadius * 0.95, + config.shaftRadius * 0.82, + gripSpan, + 7, + [0, 0, 0], + new Color(tint('oak', 0.05)), + ) + // Built along Y; +90 degrees about Z lays it along X, across the blade. + grip.rotateZ(Math.PI / 2) + grip.translate(0, -shaft.top + config.shaftRadius * 0.9, 0) + const socketLength = config.length * 0.05 const socket = toolSocket({ y: shaft.top - socketLength * 0.3, @@ -98,7 +122,12 @@ export function createModel(overrides: Partial = {}) { { y: span, halfWidth: half * 0.44, thickness: t * 0.14, curve: curve * 0.48 }, ] - const sheet = dishedSheetGeometry(profile, 8, steelTint(random, -0.04), steelTint(random, 0.04)) + // Both colours copied out first: `createTinter` returns one Color and + // mutates it, so two tints inside one call would resolve to the same + // value. + const boardLow = new Color(tint('oak', -0.05)) + const boardHigh = new Color(tint('oakEnd', 0.03)) + const sheet = dishedSheetGeometry(profile, 8, boardLow, boardHigh) // Foot tread: the fold at the top edge of the blade, BEHIND the dish. It // must sit at shoulder height and be WIDE — this is where you step, and a @@ -109,7 +138,7 @@ export function createModel(overrides: Partial = {}) { t * 1.8, t * 0.34, [0, 0, 0], - steelTint(random, -0.07), + new Color(tint('oak', -0.1)), ) tread.rotateX(0.42) tread.translate(0, span * 0.12, -t * 1.7) @@ -137,10 +166,14 @@ export function createModel(overrides: Partial = {}) { } return { - shaft: { slot: 'oak', geometry: shaft.geometry }, + shaft: { slot: 'oak', geometry: mergeColoured([shaft.geometry, grip]) }, socket: { slot: 'iron', geometry: socket }, blade: { - slot: 'steel', + // Oak, not steel. A medieval digging shovel is a shaped board with + // an iron shoe along its lip -- the strap below is that shoe, and it + // has been there all along while the board it protects was rendered + // as a sheet of polished steel. + slot: 'oak', geometry: blade, extras: [{ slot: 'iron', geometry: strap }], },