diff --git a/media/kit.png b/media/kit.png index 5801012..f5a3a91 100644 Binary files a/media/kit.png and b/media/kit.png differ diff --git a/media/models.png b/media/models.png index b0e81de..3a2b154 100644 Binary files a/media/models.png and b/media/models.png differ diff --git a/models.lock.json b/models.lock.json index 9a48bc2..bf2d6c9 100644 --- a/models.lock.json +++ b/models.lock.json @@ -82,7 +82,7 @@ "address": "@medieval-kit/core", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-26T20:14:45.008Z", + "installedAt": "2026-08-27T06:50:20.568Z", "files": [ { "path": "src\\models\\medieval-kit\\core\\geometry.ts", @@ -362,11 +362,11 @@ "address": "@medieval-kit/wooden-bench", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-26T19:00:27.478Z", + "installedAt": "2026-08-27T06:50:20.571Z", "files": [ { "path": "src\\models\\medieval-kit\\wooden-bench\\model.ts", - "sourceHash": "bb0aa806250a40e1bb52da17a79ba2c969327ef82a7b74d55b0819f9751e7d2c" + "sourceHash": "ddba6c89ac114bf2cc31c6e8df1631ec97a0dae79ad2b06de4cbdbdbc78c556e" } ], "dependencies": [ @@ -677,11 +677,11 @@ "address": "@medieval-kit/market-stall", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-26T20:14:45.011Z", + "installedAt": "2026-08-27T06:46:34.436Z", "files": [ { "path": "src\\models\\medieval-kit\\market-stall\\model.ts", - "sourceHash": "31fa88ff1df342465177b5b95b5814575f5691b255fcea5e75e591fc1fd3740e" + "sourceHash": "1068f90351fae381f337fb2fc9e424ac1b96cb8d96c659e32219fe0e383a5adb" } ], "dependencies": [ diff --git a/my-registry/models/market-stall/model.ts b/my-registry/models/market-stall/model.ts index 0c3d9eb..e27b685 100644 --- a/my-registry/models/market-stall/model.ts +++ b/my-registry/models/market-stall/model.ts @@ -231,8 +231,14 @@ export function createModel(overrides: Partial = {}) { for (const sx of [-1, 1] as const) { for (const sz of [-1, 1] as const) { - // A shade past the cloth's mid surface, so the head is buried in it. - const head = clothY(sx * postX, sz * legZ) + boardT * 0.15 + // ON the cloth's mid surface, so half its thickness covers the head. + // + // A shade PAST it was the first version, and four dark post heads + // came through the awning like tacks — the same fault as the bench's + // tenons and made for the same reason: pushed proud to keep two + // faces out of one plane. Buried does that too, and cannot be seen + // doing it. + const head = clothY(sx * postX, sz * legZ) // Down PAST the rail and finishing as a stub below it, which is both // the reference's detail and the fix for a real fault: stopped at the // rail's underside, the post's foot lay in the same plane as it, @@ -269,7 +275,10 @@ export function createModel(overrides: Partial = {}) { levels.push({ y: halfDepth * (f * 2 - 1), halfWidth: halfLength, - thickness: boardT * 0.2, + // Thick enough to hide a post head in. At 0.2 of a board there was + // barely three millimetres of cloth either side of the mid surface, + // which is not enough to bury anything in with confidence. + thickness: boardT * 0.42, // Deeper at the front than the back. Cloth pulled over a ridge and // left loose at the eaves does not hang symmetrically. curve: sag * (0.72 + f * 0.55), diff --git a/my-registry/models/wooden-bench/model.ts b/my-registry/models/wooden-bench/model.ts index de959e2..ab23f3c 100644 --- a/my-registry/models/wooden-bench/model.ts +++ b/my-registry/models/wooden-bench/model.ts @@ -160,25 +160,39 @@ export function createModel(overrides: Partial = {}) { )) } - // Tenon: the end of the leg running THROUGH the seat and showing on - // top of it as a panel of end grain. It is the most recognisable - // detail of a medieval bench -- and it is nearly FLUSH. - // - // At 1.9 seat thicknesses it stood 42 mm proud of the seat: a block of - // oak the size of a thumb sticking straight up out of the surface you - // are meant to sit on. A real through-tenon is wedged and then planed - // back, so what shows is the grain and a hairline of shoulder, not a - // peg. Three millimetres proud, ten millimetres housed below. - const proud = seatThickness * 0.05 + /** + * Tenon: HOUSED in the seat, stopping short of its top face. + * + * It was a through-tenon and it was reported twice. First at 42 mm + * proud, a block of oak the size of a thumb standing out of the + * surface you sit on; I planed it to 3 mm and called it done, and 3 mm + * is still a raised patch with a lit edge on it, still visible in the + * render, and still the thing being complained about. The brief is + * that nothing on the seat shows, and 3 mm is not nothing — it is + * small. + * + * So it ends INSIDE the slab, an eighth of the seat's thickness below + * the top. That is a real joint and not a compromise: a stub tenon + * into the underside of a board is how a bench is made when the top is + * thick enough to take it, which at 0.135 of the height it is. What is + * lost is the panel of end grain on top; what is gained is a seat. + * + * Ending it LEVEL with the top face was never an option, which is what + * sent me to 3 mm proud in the first place: two upward faces in one + * plane is the z-fight the checker exists to find. Buried has neither + * problem — a face inside a solid cannot fight anything and cannot be + * seen. + */ + const buried = seatThickness * 0.12 const housed = seatThickness * 0.16 legPieces.push(chamferedBoxGeometry( [legWidth * 0.34, timber * 0.85], [legWidth * 0.32, timber * 0.8], - seatThickness + proud + housed, + seatThickness - buried + housed, timber * 0.16, [ side * legX, - seatBottom + (seatThickness + proud - housed) / 2, + seatBottom + (seatThickness - buried - housed) / 2, jitter(random, timber * 0.1), ], tint('oak', 0.09), diff --git a/scripts/verify-model.ts b/scripts/verify-model.ts index 0190cd6..203a8e6 100644 --- a/scripts/verify-model.ts +++ b/scripts/verify-model.ts @@ -295,6 +295,24 @@ interface Case { * shot 0.23 m forward, the model grew to 0.42 m deep, and no test objected. */ readonly maxSize?: readonly [number, number, number] + /** + * The part nothing else may rise above. + * + * "It should not be visible at all" is a real brief and it was given twice + * about the same bench, because the first time I answered it with a number + * instead of a rule: the through-tenons went from 42 mm proud to 3 mm, and + * 3 mm is still a raised patch with a lit edge on it. The market stall then + * repeated it exactly — four post heads through the awning — and for the + * same reason, which is the interesting part: both were pushed proud + * deliberately, to keep two faces out of one plane and away from the + * z-fight check. + * + * That trade is false. A piece that must not show ends INSIDE the solid it + * enters: a buried face cannot be coplanar with a surface and cannot be + * seen. This turns the brief into arithmetic — on a seat, on a counter, on + * an awning, nothing stands above the surface a person meets. + */ + readonly nothingAbove?: string } const as = (make: (o?: never) => T) => (o?: Record): KitModel => @@ -318,7 +336,7 @@ const CASES: readonly Case[] = [ parts: 3, ownSlot: 'leather', borrowSlot: 'oak', variants: [{ planks: 3 }, { lean: 0 }, { rivets: 0 }], maxSize: [1.3, 1.3, 0.9] }, - { id: 'market-stall', make: as(createStall), patch: { planks: 9, sag: 0.3 }, + { id: 'market-stall', make: as(createStall), nothingAbove: 'awning', patch: { planks: 9, sag: 0.3 }, parts: 4, ownSlot: 'cloth', borrowSlot: 'oak', variants: [{ sag: 0 }, { planks: 2 }, { length: 2.6 }, { awning: 1.4 }], maxSize: [3.2, 2.5, 1.6] }, @@ -373,7 +391,7 @@ const CASES: readonly Case[] = [ { 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.4, 1.9, 0.2] }, - { id: 'trestle-table', make: as(createTable), patch: { plankCount: 6, splay: 0.35 }, + { id: 'trestle-table', make: as(createTable), nothingAbove: 'top', 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 }] }, { id: 'cart-wheel', make: as(createWheel), patch: { spokeCount: 14, tyre: 0.07 }, @@ -382,7 +400,7 @@ const CASES: readonly Case[] = [ { id: 'wooden-chest', make: as(createChest), patch: { bandCount: 4, width: 1.1 }, parts: 4, ownSlot: 'iron', borrowSlot: 'oak', closed: true, variants: [{ bandCount: 0 }, { bandCount: 1 }, { depth: 0.7 }] , maxSize: [1, 0.62, 0.62] }, - { id: 'wooden-bench', make: as(createBench), patch: { length: 2.1, splay: 0.4 }, + { id: 'wooden-bench', make: as(createBench), nothingAbove: 'seat', patch: { length: 2.1, splay: 0.4 }, parts: 3, ownSlot: 'oak', borrowSlot: 'oak', closed: true, variants: [{ splay: 0 }, { inset: 0.02 }, { width: 0.45 }] , maxSize: [1.7, 0.5, 0.35] }, { id: 'pitch-torch', make: as(createTorch), patch: { wrapLength: 0.42, flameHeight: 2.2 }, @@ -477,6 +495,27 @@ for (const testCase of CASES) { expect('no NaN/Infinity vertices', report.nonFinite === 0) expect('bounds finite', report.size.every(Number.isFinite)) expect('within lowpoly budget (< 2500 triangles)', report.triangles < 2500) + if (testCase.nothingAbove) { + const top = model.parts[testCase.nothingAbove] + const above: string[] = [] + if (top) { + const ceiling = new Box3().setFromObject(top.anchor).max.y + for (const [name, handle] of Object.entries(model.parts)) { + if (name === testCase.nothingAbove || !handle) continue + const peak = new Box3().setFromObject((handle as { anchor: Object3D }).anchor).max.y + // A tenth of a millimetre, because a surface is allowed to be rough. + if (peak > ceiling + 0.0001) { + above.push(`${name} by ${((peak - ceiling) * 1000).toFixed(1)}mm`) + } + } + } + expect( + `nothing stands proud of ${testCase.nothingAbove}` + + (above.length ? ` — PROUD: ${above.join(', ')}` : ''), + top !== undefined && above.length === 0, + ) + } + if (testCase.maxSize) { const over = report.size .map((value, i) => (value > testCase.maxSize![i]! ? `${'xyz'[i]}=${value}>${testCase.maxSize![i]}` : '')) diff --git a/src/models/medieval-kit/market-stall/model.ts b/src/models/medieval-kit/market-stall/model.ts index 0c3d9eb..e27b685 100644 --- a/src/models/medieval-kit/market-stall/model.ts +++ b/src/models/medieval-kit/market-stall/model.ts @@ -231,8 +231,14 @@ export function createModel(overrides: Partial = {}) { for (const sx of [-1, 1] as const) { for (const sz of [-1, 1] as const) { - // A shade past the cloth's mid surface, so the head is buried in it. - const head = clothY(sx * postX, sz * legZ) + boardT * 0.15 + // ON the cloth's mid surface, so half its thickness covers the head. + // + // A shade PAST it was the first version, and four dark post heads + // came through the awning like tacks — the same fault as the bench's + // tenons and made for the same reason: pushed proud to keep two + // faces out of one plane. Buried does that too, and cannot be seen + // doing it. + const head = clothY(sx * postX, sz * legZ) // Down PAST the rail and finishing as a stub below it, which is both // the reference's detail and the fix for a real fault: stopped at the // rail's underside, the post's foot lay in the same plane as it, @@ -269,7 +275,10 @@ export function createModel(overrides: Partial = {}) { levels.push({ y: halfDepth * (f * 2 - 1), halfWidth: halfLength, - thickness: boardT * 0.2, + // Thick enough to hide a post head in. At 0.2 of a board there was + // barely three millimetres of cloth either side of the mid surface, + // which is not enough to bury anything in with confidence. + thickness: boardT * 0.42, // Deeper at the front than the back. Cloth pulled over a ridge and // left loose at the eaves does not hang symmetrically. curve: sag * (0.72 + f * 0.55), diff --git a/src/models/medieval-kit/wooden-bench/model.ts b/src/models/medieval-kit/wooden-bench/model.ts index de959e2..ab23f3c 100644 --- a/src/models/medieval-kit/wooden-bench/model.ts +++ b/src/models/medieval-kit/wooden-bench/model.ts @@ -160,25 +160,39 @@ export function createModel(overrides: Partial = {}) { )) } - // Tenon: the end of the leg running THROUGH the seat and showing on - // top of it as a panel of end grain. It is the most recognisable - // detail of a medieval bench -- and it is nearly FLUSH. - // - // At 1.9 seat thicknesses it stood 42 mm proud of the seat: a block of - // oak the size of a thumb sticking straight up out of the surface you - // are meant to sit on. A real through-tenon is wedged and then planed - // back, so what shows is the grain and a hairline of shoulder, not a - // peg. Three millimetres proud, ten millimetres housed below. - const proud = seatThickness * 0.05 + /** + * Tenon: HOUSED in the seat, stopping short of its top face. + * + * It was a through-tenon and it was reported twice. First at 42 mm + * proud, a block of oak the size of a thumb standing out of the + * surface you sit on; I planed it to 3 mm and called it done, and 3 mm + * is still a raised patch with a lit edge on it, still visible in the + * render, and still the thing being complained about. The brief is + * that nothing on the seat shows, and 3 mm is not nothing — it is + * small. + * + * So it ends INSIDE the slab, an eighth of the seat's thickness below + * the top. That is a real joint and not a compromise: a stub tenon + * into the underside of a board is how a bench is made when the top is + * thick enough to take it, which at 0.135 of the height it is. What is + * lost is the panel of end grain on top; what is gained is a seat. + * + * Ending it LEVEL with the top face was never an option, which is what + * sent me to 3 mm proud in the first place: two upward faces in one + * plane is the z-fight the checker exists to find. Buried has neither + * problem — a face inside a solid cannot fight anything and cannot be + * seen. + */ + const buried = seatThickness * 0.12 const housed = seatThickness * 0.16 legPieces.push(chamferedBoxGeometry( [legWidth * 0.34, timber * 0.85], [legWidth * 0.32, timber * 0.8], - seatThickness + proud + housed, + seatThickness - buried + housed, timber * 0.16, [ side * legX, - seatBottom + (seatThickness + proud - housed) / 2, + seatBottom + (seatThickness - buried - housed) / 2, jitter(random, timber * 0.1), ], tint('oak', 0.09),