Land the spilled coins, plane the bench's tenons, and sharpen the support check

Three defects reported from looking at the models, and the first of them
says something about the check that was supposed to catch it.

Every third coin was lifted to "land on top of the previous one" while its
position stayed independently scattered, so it was almost never above
anything and simply hovered about 3 mm off the ground. A stacking coin now
takes the previous coin's PLACE as well as its height. The tilted ones were
lifted by half their thickness plus their circumradius; a coin is a
nine-sided prism and can come to rest on a face rather than a corner, so
the lift uses the apothem and its own radius, erring towards bedding into
the ground rather than floating above it.

The support check missed all of that, and the reason is worth writing down:
its voxel is the model's extent over the resolution, so at 64 a 0.19 m coin
pouch gets a 3 mm voxel -- exactly the size of the gap it existed to find. A
check coarser than the defect it hunts is worth very little. At 112 the
whole suite still runs in fifteen seconds.

Raising it immediately turned up a real fault nobody had seen. The log
pile's sawn ends were cut to exactly the body's end radius and placed
exactly at its rim, so disc and lathe met along a seam of no width: they
touched and never overlapped, and there was nothing joining them but two
edges in the same place. The caps are now three percent wider and seated
slightly inside, which is two millimetres here and true of a real log
anyway, since bark wears back from a cut face.

And the bench's through-tenons 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 end grain and a hairline of shoulder. Three millimetres
proud, ten housed below.

28 models, 20 547 triangles, all checks pass at resolution 112, 0 floating
cases, build clean.
This commit is contained in:
CRTkafa 2026-08-23 13:23:09 +07:00
parent 2b6e2b4d02
commit 1888616315
8 changed files with 175 additions and 64 deletions

View file

@ -67,7 +67,7 @@
"address": "@medieval-kit/wooden-barrel", "address": "@medieval-kit/wooden-barrel",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.314Z", "installedAt": "2026-08-23T06:21:57.397Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\wooden-barrel\\model.ts", "path": "src\\models\\medieval-kit\\wooden-barrel\\model.ts",
@ -82,7 +82,7 @@
"address": "@medieval-kit/core", "address": "@medieval-kit/core",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.288Z", "installedAt": "2026-08-23T06:21:57.373Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\core\\geometry.ts", "path": "src\\models\\medieval-kit\\core\\geometry.ts",
@ -129,7 +129,7 @@
"address": "@medieval-kit/wooden-crate", "address": "@medieval-kit/wooden-crate",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.319Z", "installedAt": "2026-08-23T06:21:57.403Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\wooden-crate\\model.ts", "path": "src\\models\\medieval-kit\\wooden-crate\\model.ts",
@ -144,7 +144,7 @@
"address": "@medieval-kit/kit", "address": "@medieval-kit/kit",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.327Z", "installedAt": "2026-08-23T06:21:57.410Z",
"files": [], "files": [],
"dependencies": [] "dependencies": []
}, },
@ -152,7 +152,7 @@
"address": "@medieval-kit/iron-anvil", "address": "@medieval-kit/iron-anvil",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.297Z", "installedAt": "2026-08-23T06:21:57.382Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\iron-anvil\\model.ts", "path": "src\\models\\medieval-kit\\iron-anvil\\model.ts",
@ -167,7 +167,7 @@
"address": "@medieval-kit/wooden-bucket", "address": "@medieval-kit/wooden-bucket",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.316Z", "installedAt": "2026-08-23T06:21:57.400Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\wooden-bucket\\model.ts", "path": "src\\models\\medieval-kit\\wooden-bucket\\model.ts",
@ -182,7 +182,7 @@
"address": "@medieval-kit/wooden-fence", "address": "@medieval-kit/wooden-fence",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.321Z", "installedAt": "2026-08-23T06:21:57.404Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\wooden-fence\\model.ts", "path": "src\\models\\medieval-kit\\wooden-fence\\model.ts",
@ -197,7 +197,7 @@
"address": "@medieval-kit/wooden-hoe", "address": "@medieval-kit/wooden-hoe",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.322Z", "installedAt": "2026-08-23T06:21:57.405Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\wooden-hoe\\model.ts", "path": "src\\models\\medieval-kit\\wooden-hoe\\model.ts",
@ -212,7 +212,7 @@
"address": "@medieval-kit/wooden-ladder", "address": "@medieval-kit/wooden-ladder",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.324Z", "installedAt": "2026-08-23T06:21:57.406Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\wooden-ladder\\model.ts", "path": "src\\models\\medieval-kit\\wooden-ladder\\model.ts",
@ -227,7 +227,7 @@
"address": "@medieval-kit/wooden-pitchfork", "address": "@medieval-kit/wooden-pitchfork",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.325Z", "installedAt": "2026-08-23T06:21:57.408Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\wooden-pitchfork\\model.ts", "path": "src\\models\\medieval-kit\\wooden-pitchfork\\model.ts",
@ -242,7 +242,7 @@
"address": "@medieval-kit/wooden-shovel", "address": "@medieval-kit/wooden-shovel",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.326Z", "installedAt": "2026-08-23T06:21:57.409Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\wooden-shovel\\model.ts", "path": "src\\models\\medieval-kit\\wooden-shovel\\model.ts",
@ -257,7 +257,7 @@
"address": "@medieval-kit/wooden-stool", "address": "@medieval-kit/wooden-stool",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.327Z", "installedAt": "2026-08-23T06:21:57.410Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\wooden-stool\\model.ts", "path": "src\\models\\medieval-kit\\wooden-stool\\model.ts",
@ -272,7 +272,7 @@
"address": "@medieval-kit/cart-wheel", "address": "@medieval-kit/cart-wheel",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.292Z", "installedAt": "2026-08-23T06:21:57.377Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\cart-wheel\\model.ts", "path": "src\\models\\medieval-kit\\cart-wheel\\model.ts",
@ -287,11 +287,11 @@
"address": "@medieval-kit/log-pile", "address": "@medieval-kit/log-pile",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.303Z", "installedAt": "2026-08-23T06:21:57.387Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\log-pile\\model.ts", "path": "src\\models\\medieval-kit\\log-pile\\model.ts",
"sourceHash": "0cae2e57ac46fedf3ad63211901671c0ace45520b893f5443c3be23008751369" "sourceHash": "d0a68191cd5e464c7f8d699277a1d9c132947ae5fcf4d4e54636baf1a5665b5d"
} }
], ],
"dependencies": [ "dependencies": [
@ -302,7 +302,7 @@
"address": "@medieval-kit/trestle-table", "address": "@medieval-kit/trestle-table",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.311Z", "installedAt": "2026-08-23T06:21:57.394Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\trestle-table\\model.ts", "path": "src\\models\\medieval-kit\\trestle-table\\model.ts",
@ -317,7 +317,7 @@
"address": "@medieval-kit/wooden-chest", "address": "@medieval-kit/wooden-chest",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.318Z", "installedAt": "2026-08-23T06:21:57.401Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\wooden-chest\\model.ts", "path": "src\\models\\medieval-kit\\wooden-chest\\model.ts",
@ -332,7 +332,7 @@
"address": "@medieval-kit/hay-bale", "address": "@medieval-kit/hay-bale",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.296Z", "installedAt": "2026-08-23T06:21:57.381Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\hay-bale\\model.ts", "path": "src\\models\\medieval-kit\\hay-bale\\model.ts",
@ -347,7 +347,7 @@
"address": "@medieval-kit/pitch-torch", "address": "@medieval-kit/pitch-torch",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.305Z", "installedAt": "2026-08-23T06:21:57.389Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\pitch-torch\\model.ts", "path": "src\\models\\medieval-kit\\pitch-torch\\model.ts",
@ -362,11 +362,11 @@
"address": "@medieval-kit/wooden-bench", "address": "@medieval-kit/wooden-bench",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.315Z", "installedAt": "2026-08-23T06:21:57.398Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\wooden-bench\\model.ts", "path": "src\\models\\medieval-kit\\wooden-bench\\model.ts",
"sourceHash": "91169da4e428d4ffa11818a249df4cc230db341ab9bbfbcfe47bf6c50891cfb2" "sourceHash": "3b3468721c72911d1fd9eb54da61828cdc666c1b5a86871c5c5997ab9cc37533"
} }
], ],
"dependencies": [ "dependencies": [
@ -377,7 +377,7 @@
"address": "@medieval-kit/linen-sack", "address": "@medieval-kit/linen-sack",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.301Z", "installedAt": "2026-08-23T06:21:57.386Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\linen-sack\\model.ts", "path": "src\\models\\medieval-kit\\linen-sack\\model.ts",
@ -392,7 +392,7 @@
"address": "@medieval-kit/oak-tankard", "address": "@medieval-kit/oak-tankard",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.304Z", "installedAt": "2026-08-23T06:21:57.388Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\oak-tankard\\model.ts", "path": "src\\models\\medieval-kit\\oak-tankard\\model.ts",
@ -407,7 +407,7 @@
"address": "@medieval-kit/straw-broom", "address": "@medieval-kit/straw-broom",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.308Z", "installedAt": "2026-08-23T06:21:57.392Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\straw-broom\\model.ts", "path": "src\\models\\medieval-kit\\straw-broom\\model.ts",
@ -422,7 +422,7 @@
"address": "@medieval-kit/bronze-bell", "address": "@medieval-kit/bronze-bell",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.291Z", "installedAt": "2026-08-23T06:21:57.375Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\bronze-bell\\model.ts", "path": "src\\models\\medieval-kit\\bronze-bell\\model.ts",
@ -437,7 +437,7 @@
"address": "@medieval-kit/iron-lantern", "address": "@medieval-kit/iron-lantern",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.299Z", "installedAt": "2026-08-23T06:21:57.383Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\iron-lantern\\model.ts", "path": "src\\models\\medieval-kit\\iron-lantern\\model.ts",
@ -452,7 +452,7 @@
"address": "@medieval-kit/tavern-sign", "address": "@medieval-kit/tavern-sign",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.310Z", "installedAt": "2026-08-23T06:21:57.393Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\tavern-sign\\model.ts", "path": "src\\models\\medieval-kit\\tavern-sign\\model.ts",
@ -467,11 +467,11 @@
"address": "@medieval-kit/coin-pouch", "address": "@medieval-kit/coin-pouch",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.294Z", "installedAt": "2026-08-23T06:21:57.378Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\coin-pouch\\model.ts", "path": "src\\models\\medieval-kit\\coin-pouch\\model.ts",
"sourceHash": "0f3f18fbe15f17b0fefe335586bb2f3bfb4753d422f62aad2bb42e95d39fad78" "sourceHash": "53798f5add1ae70354be451840cd34c59f0370b93358ee75710395e2288fabcc"
} }
], ],
"dependencies": [ "dependencies": [
@ -482,7 +482,7 @@
"address": "@medieval-kit/glass-phial", "address": "@medieval-kit/glass-phial",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.295Z", "installedAt": "2026-08-23T06:21:57.379Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\glass-phial\\model.ts", "path": "src\\models\\medieval-kit\\glass-phial\\model.ts",
@ -497,7 +497,7 @@
"address": "@medieval-kit/leather-book", "address": "@medieval-kit/leather-book",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.300Z", "installedAt": "2026-08-23T06:21:57.384Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\leather-book\\model.ts", "path": "src\\models\\medieval-kit\\leather-book\\model.ts",
@ -512,7 +512,7 @@
"address": "@medieval-kit/wicker-basket", "address": "@medieval-kit/wicker-basket",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.312Z", "installedAt": "2026-08-23T06:21:57.396Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\wicker-basket\\model.ts", "path": "src\\models\\medieval-kit\\wicker-basket\\model.ts",
@ -527,7 +527,7 @@
"address": "@medieval-kit/post-mill", "address": "@medieval-kit/post-mill",
"source": "file:my-registry/dist/registry.json", "source": "file:my-registry/dist/registry.json",
"version": "workspace", "version": "workspace",
"installedAt": "2026-08-23T06:13:59.307Z", "installedAt": "2026-08-23T06:21:57.391Z",
"files": [ "files": [
{ {
"path": "src\\models\\medieval-kit\\post-mill\\model.ts", "path": "src\\models\\medieval-kit\\post-mill\\model.ts",

View file

@ -111,6 +111,7 @@ export function createModel(overrides: Partial<CoinPouchConfig> = {}) {
const coinPieces: BufferGeometry[] = [] const coinPieces: BufferGeometry[] = []
// Scatter DIRECTION: all one way, because spilled money flows to one side. // Scatter DIRECTION: all one way, because spilled money flows to one side.
const spillAngle = random() * Math.PI * 2 const spillAngle = random() * Math.PI * 2
let previous: { x: number; z: number; top: number } | undefined
for (let i = 0; i < count; i += 1) { for (let i = 0; i < count; i += 1) {
const t = (i + 0.6) / count const t = (i + 0.6) / count
// Distance grows with a square root: piled at the pouch, thin further out. // Distance grows with a square root: piled at the pouch, thin further out.
@ -118,11 +119,19 @@ export function createModel(overrides: Partial<CoinPouchConfig> = {}) {
const spread = jitter(random, 0.75) * (0.35 + t * 0.65) const spread = jitter(random, 0.75) * (0.35 + t * 0.65)
const angle = spillAngle + spread const angle = spillAngle + spread
const thickness = config.coinRadius * (0.13 + random() * 0.06) const thickness = config.coinRadius * (0.13 + random() * 0.06)
// The overlapping ones: every third coin lands on top of the previous. // Every third coin lands ON the one before it -- which means taking
const stack = i % 3 === 2 ? thickness * 1.6 : 0 // that coin's PLACE, not just its height.
//
// The lift was applied while the position stayed independent, so the
// stacking coin was almost never above anything and simply hovered
// about 3 mm off the ground. The support check missed it at its default
// resolution: the voxel is the model's extent over 64, which on a 0.19 m
// pouch is 3 mm -- exactly the size of the gap it had to see.
const stacking = i % 3 === 2 && previous !== undefined
const lower = config.coinRadius * (0.92 + random() * 0.16)
const coin = prismGeometry( const coin = prismGeometry(
config.coinRadius * (0.92 + random() * 0.16), lower,
config.coinRadius * (0.9 + random() * 0.16), config.coinRadius * (0.9 + random() * 0.16),
thickness, 9, [0, 0, 0], tint('brass', jitter(random, 0.06), 0.5), thickness, 9, [0, 0, 0], tint('brass', jitter(random, 0.06), 0.5),
) )
@ -130,11 +139,26 @@ export function createModel(overrides: Partial<CoinPouchConfig> = {}) {
const tilt = random() < 0.22 ? 0.5 + random() * 0.7 : jitter(random, 0.12) const tilt = random() < 0.22 ? 0.5 + random() * 0.7 : jitter(random, 0.12)
coin.rotateX(tilt) coin.rotateX(tilt)
coin.rotateY(random() * Math.PI * 2) coin.rotateY(random() * Math.PI * 2)
coin.translate( // A tilted disc has to rise by half of (its diameter's projection plus
Math.sin(angle) * distance, // its own thickness) for its lowest edge to reach the ground, not by
floor + thickness / 2 + stack + Math.sin(tilt) * config.coinRadius * 0.5, // half its thickness alone.
Math.cos(angle) * distance, // The APOTHEM, not the circumradius, and this coin's own radius rather
) // than the nominal one. A coin is a nine-sided prism; rolled onto its
// edge it can come to rest on a face rather than a corner, so lifting
// it by the circumradius leaves it standing on nothing. Erring towards
// the smaller radius beds it into the ground instead, which is the
// right way to be wrong.
const rest = (Math.sin(tilt) * lower * 2 * Math.cos(Math.PI / 9)
+ thickness * Math.cos(tilt)) / 2
const x = stacking
? previous!.x + jitter(random, config.coinRadius * 0.45)
: Math.sin(angle) * distance
const z = stacking
? previous!.z + jitter(random, config.coinRadius * 0.45)
: Math.cos(angle) * distance
const y = stacking ? previous!.top + rest : floor + rest
coin.translate(x, y, z)
previous = { x, z, top: y + rest * 0.55 }
coinPieces.push(coin) coinPieces.push(coin)
} }

View file

@ -162,8 +162,24 @@ export function createModel(overrides: Partial<LogPileConfig> = {}) {
capBottom: false, capBottom: false,
}) })
const grain = endTint() const grain = endTint()
const capA = headGeometry(profile.at(-1)!.radius, length / 2, 7, 'up', grain, 3, 0.07) // The sawn end stands a shade PROUD of the bark, and it has to.
const capB = headGeometry(profile[0]!.radius, -length / 2, 7, 'down', grain, 3, 0.07) //
// Cut to exactly the body's end radius, the disc and the lathe's open
// rim meet along a seam of no width at all: they touch and never
// overlap. Raising the support check's resolution showed that up at
// once -- the ends came away from the logs they belong to, because
// there was never anything joining them, only two edges in the same
// place. Three percent of the radius is two millimetres here, which
// nobody will see, and it is true of a real log anyway: bark wears
// back from a cut face.
// Set a little INSIDE the end as well as wider than it, so the rim
// passes through the wall rather than sitting level with its edge.
// Widening alone left one cap in five still meeting the body edge to
// edge, which is a joint only in the sense that two things are in the
// same place.
const seat = length * 0.02
const capA = headGeometry(profile.at(-1)!.radius * 1.03, length / 2 - seat, 7, 'up', grain, 3, 0.07)
const capB = headGeometry(profile[0]!.radius * 1.03, -length / 2 + seat, 7, 'down', grain, 3, 0.07)
// Each log is rolled randomly about its own axis: with every facet at // Each log is rolled randomly about its own axis: with every facet at
// the same angle the pile looks mechanical, and on top of that // the same angle the pile looks mechanical, and on top of that

View file

@ -136,15 +136,27 @@ export function createModel(overrides: Partial<WoodenBenchConfig> = {}) {
)) ))
} }
// Tenon: the end of the leg that runs THROUGH the seat and shows on // Tenon: the end of the leg running THROUGH the seat and showing on
// top of it. It overshoots the seat's top face — the most recognisable // top of it as a panel of end grain. It is the most recognisable
// detail of a medieval bench. // 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
const housed = seatThickness * 0.16
legPieces.push(chamferedBoxGeometry( legPieces.push(chamferedBoxGeometry(
[legWidth * 0.34, timber * 0.85], [legWidth * 0.34, timber * 0.85],
[legWidth * 0.32, timber * 0.8], [legWidth * 0.32, timber * 0.8],
seatThickness * 1.9, seatThickness + proud + housed,
timber * 0.16, timber * 0.16,
[side * legX, seatBottom + seatThickness * 0.75, jitter(random, timber * 0.1)], [
side * legX,
seatBottom + (seatThickness + proud - housed) / 2,
jitter(random, timber * 0.1),
],
tint('oak', 0.09), tint('oak', 0.09),
)) ))
} }

View file

@ -449,7 +449,14 @@ for (const testCase of CASES) {
// rung length assumed, and the basket's fruit hung level with the rim of a // rung length assumed, and the basket's fruit hung level with the rim of a
// basket deep enough to swallow it. // basket deep enough to swallow it.
{ {
const report = findFloating(model.root as never, { resolution: 64 }) // 112, not 64.
//
// The voxel is the model's own extent divided by this, so on a 0.19 m coin
// pouch 64 gives a 3 mm voxel -- and a coin hovering 3 mm off the ground
// was bridged by it and passed. Someone looking at the model saw the gap
// immediately. A check that is coarser than the defect it exists to find
// is worth very little, and the cost of halving the voxel is seconds.
const report = findFloating(model.root as never, { resolution: 112 })
const detail = report.floating const detail = report.floating
.map((piece) => `${piece.parts.join('+')} @${piece.clearance}m`) .map((piece) => `${piece.parts.join('+')} @${piece.clearance}m`)
.join(', ') .join(', ')

View file

@ -111,6 +111,7 @@ export function createModel(overrides: Partial<CoinPouchConfig> = {}) {
const coinPieces: BufferGeometry[] = [] const coinPieces: BufferGeometry[] = []
// Scatter DIRECTION: all one way, because spilled money flows to one side. // Scatter DIRECTION: all one way, because spilled money flows to one side.
const spillAngle = random() * Math.PI * 2 const spillAngle = random() * Math.PI * 2
let previous: { x: number; z: number; top: number } | undefined
for (let i = 0; i < count; i += 1) { for (let i = 0; i < count; i += 1) {
const t = (i + 0.6) / count const t = (i + 0.6) / count
// Distance grows with a square root: piled at the pouch, thin further out. // Distance grows with a square root: piled at the pouch, thin further out.
@ -118,11 +119,19 @@ export function createModel(overrides: Partial<CoinPouchConfig> = {}) {
const spread = jitter(random, 0.75) * (0.35 + t * 0.65) const spread = jitter(random, 0.75) * (0.35 + t * 0.65)
const angle = spillAngle + spread const angle = spillAngle + spread
const thickness = config.coinRadius * (0.13 + random() * 0.06) const thickness = config.coinRadius * (0.13 + random() * 0.06)
// The overlapping ones: every third coin lands on top of the previous. // Every third coin lands ON the one before it -- which means taking
const stack = i % 3 === 2 ? thickness * 1.6 : 0 // that coin's PLACE, not just its height.
//
// The lift was applied while the position stayed independent, so the
// stacking coin was almost never above anything and simply hovered
// about 3 mm off the ground. The support check missed it at its default
// resolution: the voxel is the model's extent over 64, which on a 0.19 m
// pouch is 3 mm -- exactly the size of the gap it had to see.
const stacking = i % 3 === 2 && previous !== undefined
const lower = config.coinRadius * (0.92 + random() * 0.16)
const coin = prismGeometry( const coin = prismGeometry(
config.coinRadius * (0.92 + random() * 0.16), lower,
config.coinRadius * (0.9 + random() * 0.16), config.coinRadius * (0.9 + random() * 0.16),
thickness, 9, [0, 0, 0], tint('brass', jitter(random, 0.06), 0.5), thickness, 9, [0, 0, 0], tint('brass', jitter(random, 0.06), 0.5),
) )
@ -130,11 +139,26 @@ export function createModel(overrides: Partial<CoinPouchConfig> = {}) {
const tilt = random() < 0.22 ? 0.5 + random() * 0.7 : jitter(random, 0.12) const tilt = random() < 0.22 ? 0.5 + random() * 0.7 : jitter(random, 0.12)
coin.rotateX(tilt) coin.rotateX(tilt)
coin.rotateY(random() * Math.PI * 2) coin.rotateY(random() * Math.PI * 2)
coin.translate( // A tilted disc has to rise by half of (its diameter's projection plus
Math.sin(angle) * distance, // its own thickness) for its lowest edge to reach the ground, not by
floor + thickness / 2 + stack + Math.sin(tilt) * config.coinRadius * 0.5, // half its thickness alone.
Math.cos(angle) * distance, // The APOTHEM, not the circumradius, and this coin's own radius rather
) // than the nominal one. A coin is a nine-sided prism; rolled onto its
// edge it can come to rest on a face rather than a corner, so lifting
// it by the circumradius leaves it standing on nothing. Erring towards
// the smaller radius beds it into the ground instead, which is the
// right way to be wrong.
const rest = (Math.sin(tilt) * lower * 2 * Math.cos(Math.PI / 9)
+ thickness * Math.cos(tilt)) / 2
const x = stacking
? previous!.x + jitter(random, config.coinRadius * 0.45)
: Math.sin(angle) * distance
const z = stacking
? previous!.z + jitter(random, config.coinRadius * 0.45)
: Math.cos(angle) * distance
const y = stacking ? previous!.top + rest : floor + rest
coin.translate(x, y, z)
previous = { x, z, top: y + rest * 0.55 }
coinPieces.push(coin) coinPieces.push(coin)
} }

View file

@ -162,8 +162,24 @@ export function createModel(overrides: Partial<LogPileConfig> = {}) {
capBottom: false, capBottom: false,
}) })
const grain = endTint() const grain = endTint()
const capA = headGeometry(profile.at(-1)!.radius, length / 2, 7, 'up', grain, 3, 0.07) // The sawn end stands a shade PROUD of the bark, and it has to.
const capB = headGeometry(profile[0]!.radius, -length / 2, 7, 'down', grain, 3, 0.07) //
// Cut to exactly the body's end radius, the disc and the lathe's open
// rim meet along a seam of no width at all: they touch and never
// overlap. Raising the support check's resolution showed that up at
// once -- the ends came away from the logs they belong to, because
// there was never anything joining them, only two edges in the same
// place. Three percent of the radius is two millimetres here, which
// nobody will see, and it is true of a real log anyway: bark wears
// back from a cut face.
// Set a little INSIDE the end as well as wider than it, so the rim
// passes through the wall rather than sitting level with its edge.
// Widening alone left one cap in five still meeting the body edge to
// edge, which is a joint only in the sense that two things are in the
// same place.
const seat = length * 0.02
const capA = headGeometry(profile.at(-1)!.radius * 1.03, length / 2 - seat, 7, 'up', grain, 3, 0.07)
const capB = headGeometry(profile[0]!.radius * 1.03, -length / 2 + seat, 7, 'down', grain, 3, 0.07)
// Each log is rolled randomly about its own axis: with every facet at // Each log is rolled randomly about its own axis: with every facet at
// the same angle the pile looks mechanical, and on top of that // the same angle the pile looks mechanical, and on top of that

View file

@ -136,15 +136,27 @@ export function createModel(overrides: Partial<WoodenBenchConfig> = {}) {
)) ))
} }
// Tenon: the end of the leg that runs THROUGH the seat and shows on // Tenon: the end of the leg running THROUGH the seat and showing on
// top of it. It overshoots the seat's top face — the most recognisable // top of it as a panel of end grain. It is the most recognisable
// detail of a medieval bench. // 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
const housed = seatThickness * 0.16
legPieces.push(chamferedBoxGeometry( legPieces.push(chamferedBoxGeometry(
[legWidth * 0.34, timber * 0.85], [legWidth * 0.34, timber * 0.85],
[legWidth * 0.32, timber * 0.8], [legWidth * 0.32, timber * 0.8],
seatThickness * 1.9, seatThickness + proud + housed,
timber * 0.16, timber * 0.16,
[side * legX, seatBottom + seatThickness * 0.75, jitter(random, timber * 0.1)], [
side * legX,
seatBottom + (seatThickness + proud - housed) / 2,
jitter(random, timber * 0.1),
],
tint('oak', 0.09), tint('oak', 0.09),
)) ))
} }