Give the sign real ironwork, and hang the board from what it hangs on
The sign read as broken, and the reason was the same one the tankard's handle had: `bendGeometry` applied to a `boxGeometry`. A box has two levels in Y, and two levels cannot bend -- they shear. Both the brace and the curl were sheared parallelograms rather than curves, and the sheared curl is what pushed the bracket's top to 0.579 while the post it is bolted to ends at 0.442. An arm standing above its own post is not ironwork, it is a mistake, and it had been in every render of this model. Both are now real sweeps from `arcBarGeometry`, with their ends placed inside the post and inside the arm rather than corrected towards them afterwards. Replacing the curl immediately exposed a second fault that it had been hiding. The board's part origin sat at [0, pivotY, 0] -- the post's centre line -- while every piece of the board and its chains is authored hanging from the cross-bar at z = reach * 0.86, half a metre away. At rest that is invisible. The moment the swing action runs, the assembly turns about a point it does not hang from and the tops of the chains sweep off the bar they are looped through. The support audit had been reporting this as a detached board only because the sheared curl was accidentally filling the gap; with the curl the right size, it failed honestly. The origin is now the cross-bar and the geometry is written relative to it: same place in the world, correct axis to turn about. Two proportions with it. The post was 62 mm square carrying a 0.72 m board two metres up -- thinner than the board is thick, and part of a habit of under-sizing timber that the bench, the table and the fence share. And the chain drop was 0.12, so the five links that connect board to bracket were a smudge; the chain is half of what makes a hanging sign read as hanging. Lengthening the drop grew the links from radius 0.0195 to 0.0434, at which point they interlock in earnest and their six-sided facets, all built at the same phase, met coplanar. Each link is now indexed differently about its own axis -- deterministically, so the seeded stream is untouched, and a real chain does not index its links either. 27 models, 18369 triangles, all checks pass, 0 floating cases, build clean.
This commit is contained in:
parent
bee4ac963a
commit
8ba617e9f4
3 changed files with 158 additions and 72 deletions
|
|
@ -67,7 +67,7 @@
|
|||
"address": "@medieval-kit/wooden-barrel",
|
||||
"source": "file:my-registry/dist/registry.json",
|
||||
"version": "workspace",
|
||||
"installedAt": "2026-08-22T06:29:40.554Z",
|
||||
"installedAt": "2026-08-22T06:39:18.810Z",
|
||||
"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-22T06:29:40.535Z",
|
||||
"installedAt": "2026-08-22T06:39:18.791Z",
|
||||
"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-22T06:29:40.558Z",
|
||||
"installedAt": "2026-08-22T06:39:18.814Z",
|
||||
"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-22T06:29:40.565Z",
|
||||
"installedAt": "2026-08-22T06:39:18.820Z",
|
||||
"files": [],
|
||||
"dependencies": []
|
||||
},
|
||||
|
|
@ -152,7 +152,7 @@
|
|||
"address": "@medieval-kit/iron-anvil",
|
||||
"source": "file:my-registry/dist/registry.json",
|
||||
"version": "workspace",
|
||||
"installedAt": "2026-08-22T06:29:40.542Z",
|
||||
"installedAt": "2026-08-22T06:39:18.798Z",
|
||||
"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-22T06:29:40.556Z",
|
||||
"installedAt": "2026-08-22T06:39:18.812Z",
|
||||
"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-22T06:29:40.559Z",
|
||||
"installedAt": "2026-08-22T06:39:18.815Z",
|
||||
"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-22T06:29:40.560Z",
|
||||
"installedAt": "2026-08-22T06:39:18.816Z",
|
||||
"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-22T06:29:40.561Z",
|
||||
"installedAt": "2026-08-22T06:39:18.817Z",
|
||||
"files": [
|
||||
{
|
||||
"path": "src\\models\\medieval-kit\\wooden-ladder\\model.ts",
|
||||
|
|
@ -227,7 +227,7 @@
|
|||
"address": "@medieval-kit/wooden-pitchfork",
|
||||
"source": "file:my-registry/dist/registry.json",
|
||||
"version": "workspace",
|
||||
"installedAt": "2026-08-22T06:29:40.563Z",
|
||||
"installedAt": "2026-08-22T06:39:18.818Z",
|
||||
"files": [
|
||||
{
|
||||
"path": "src\\models\\medieval-kit\\wooden-pitchfork\\model.ts",
|
||||
|
|
@ -242,7 +242,7 @@
|
|||
"address": "@medieval-kit/wooden-shovel",
|
||||
"source": "file:my-registry/dist/registry.json",
|
||||
"version": "workspace",
|
||||
"installedAt": "2026-08-22T06:29:40.564Z",
|
||||
"installedAt": "2026-08-22T06:39:18.819Z",
|
||||
"files": [
|
||||
{
|
||||
"path": "src\\models\\medieval-kit\\wooden-shovel\\model.ts",
|
||||
|
|
@ -257,7 +257,7 @@
|
|||
"address": "@medieval-kit/wooden-stool",
|
||||
"source": "file:my-registry/dist/registry.json",
|
||||
"version": "workspace",
|
||||
"installedAt": "2026-08-22T06:29:40.565Z",
|
||||
"installedAt": "2026-08-22T06:39:18.820Z",
|
||||
"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-22T06:29:40.538Z",
|
||||
"installedAt": "2026-08-22T06:39:18.793Z",
|
||||
"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-22T06:29:40.547Z",
|
||||
"installedAt": "2026-08-22T06:39:18.802Z",
|
||||
"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-22T06:29:40.552Z",
|
||||
"installedAt": "2026-08-22T06:39:18.807Z",
|
||||
"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-22T06:29:40.557Z",
|
||||
"installedAt": "2026-08-22T06:39:18.813Z",
|
||||
"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-22T06:29:40.541Z",
|
||||
"installedAt": "2026-08-22T06:39:18.797Z",
|
||||
"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-22T06:29:40.549Z",
|
||||
"installedAt": "2026-08-22T06:39:18.805Z",
|
||||
"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-22T06:29:40.555Z",
|
||||
"installedAt": "2026-08-22T06:39:18.811Z",
|
||||
"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-22T06:29:40.546Z",
|
||||
"installedAt": "2026-08-22T06:39:18.801Z",
|
||||
"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-22T06:29:40.548Z",
|
||||
"installedAt": "2026-08-22T06:39:18.804Z",
|
||||
"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-22T06:29:40.549Z",
|
||||
"installedAt": "2026-08-22T06:39:18.805Z",
|
||||
"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-22T06:29:40.537Z",
|
||||
"installedAt": "2026-08-22T06:39:18.792Z",
|
||||
"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-22T06:29:40.543Z",
|
||||
"installedAt": "2026-08-22T06:39:18.799Z",
|
||||
"files": [
|
||||
{
|
||||
"path": "src\\models\\medieval-kit\\iron-lantern\\model.ts",
|
||||
|
|
@ -452,11 +452,11 @@
|
|||
"address": "@medieval-kit/tavern-sign",
|
||||
"source": "file:my-registry/dist/registry.json",
|
||||
"version": "workspace",
|
||||
"installedAt": "2026-08-22T06:29:40.551Z",
|
||||
"installedAt": "2026-08-22T06:39:18.806Z",
|
||||
"files": [
|
||||
{
|
||||
"path": "src\\models\\medieval-kit\\tavern-sign\\model.ts",
|
||||
"sourceHash": "b19a7078bf15864781965bfb7115fd6f42027df62f6a5eea5b2af6a90e73c49e"
|
||||
"sourceHash": "4e83c594e037384b95e21c98b73ca4a64e49a7a22aa59e8a9ffb5b867b9a6e68"
|
||||
}
|
||||
],
|
||||
"dependencies": [
|
||||
|
|
@ -467,7 +467,7 @@
|
|||
"address": "@medieval-kit/coin-pouch",
|
||||
"source": "file:my-registry/dist/registry.json",
|
||||
"version": "workspace",
|
||||
"installedAt": "2026-08-22T06:29:40.539Z",
|
||||
"installedAt": "2026-08-22T06:39:18.794Z",
|
||||
"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-22T06:29:40.540Z",
|
||||
"installedAt": "2026-08-22T06:39:18.796Z",
|
||||
"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-22T06:29:40.544Z",
|
||||
"installedAt": "2026-08-22T06:39:18.800Z",
|
||||
"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-22T06:29:40.553Z",
|
||||
"installedAt": "2026-08-22T06:39:18.809Z",
|
||||
"files": [
|
||||
{
|
||||
"path": "src\\models\\medieval-kit\\wicker-basket\\model.ts",
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@
|
|||
import type { BufferGeometry } from 'three'
|
||||
|
||||
import {
|
||||
arcBarGeometry,
|
||||
bandGeometry,
|
||||
bendGeometry,
|
||||
boxGeometry,
|
||||
chamferedBoxGeometry,
|
||||
createKitModel,
|
||||
|
|
@ -51,7 +51,10 @@ export const tavernSignDefaults: TavernSignConfig = {
|
|||
height: 0.52,
|
||||
reach: 0.62,
|
||||
postHeight: 2.15,
|
||||
drop: 0.12,
|
||||
// Long enough to see the chain. At 0.12 the board hung almost against the
|
||||
// bracket and the five links that connect them were a smudge; the chain is
|
||||
// half of what makes a hanging sign read as hanging.
|
||||
drop: 0.28,
|
||||
plankCount: 3,
|
||||
damping: 0.42,
|
||||
seed: 73,
|
||||
|
|
@ -95,7 +98,11 @@ export function createModel(overrides: Partial<TavernSignConfig> = {}) {
|
|||
// period-correct — plenty of inn signs were on posts rather than walls —
|
||||
// and it is the version that can actually be dropped into a scene,
|
||||
// because it holds itself up.
|
||||
const postWidth = config.reach * 0.1
|
||||
// A signpost is a structural timber, not a stake. At reach*0.1 it came
|
||||
// out 62 mm square carrying a 0.72 m board two metres up -- thinner than
|
||||
// the board is thick, and part of the same across-the-kit habit of
|
||||
// under-sizing timber that the bench, the table and the fence all share.
|
||||
const postWidth = config.reach * 0.19
|
||||
const postTop = pivotY + config.reach * 0.1
|
||||
const postBase = postTop - config.postHeight
|
||||
const timber: BufferGeometry[] = [chamferedBoxGeometry(
|
||||
|
|
@ -134,25 +141,37 @@ export function createModel(overrides: Partial<TavernSignConfig> = {}) {
|
|||
// Brace: the curved support tying the arm back to the wall. Without it
|
||||
// the arm looks like it is hanging in the air and the eye's question of
|
||||
// "what is holding this up" goes unanswered.
|
||||
const braceLength = config.reach * 0.72
|
||||
const brace = boxGeometry(
|
||||
[bar * 1.1, braceLength, bar * 1.1],
|
||||
[0, braceLength / 2, 0],
|
||||
// A real quarter-arc, not a sheared box.
|
||||
//
|
||||
// This and the curl below were both `boxGeometry` put through
|
||||
// `bendGeometry`, and a box has two levels in Y. `bendGeometry` cannot
|
||||
// bend two levels -- it shears them -- so neither piece was ever a
|
||||
// curve. The sheared curl is what pushed the bracket's top to 0.579
|
||||
// while the post it is bolted to ends at 0.442: an arm standing above
|
||||
// its own post, which is why the sign read as broken rather than as
|
||||
// ironwork.
|
||||
//
|
||||
// `arcBarGeometry` sweeps a real arc. Its ends are placed rather than
|
||||
// corrected: one inside the post, one inside the arm.
|
||||
const braceRadius = config.reach * 0.45
|
||||
const brace = arcBarGeometry(
|
||||
braceRadius, bar * 1.2, -Math.PI / 2, 0, 7, [0, 0, 0],
|
||||
tint('iron', -0.02, 0.7),
|
||||
)
|
||||
bendGeometry(brace, -1.15 / braceLength)
|
||||
brace.rotateX(Math.PI / 4)
|
||||
brace.translate(0, armY - config.height * 0.42, bar)
|
||||
// Built in XY; -90 degrees about Y carries +X into +Z, standing the arc
|
||||
// in the plane the bracket occupies.
|
||||
brace.rotateY(-Math.PI / 2)
|
||||
brace.translate(0, armY + bar * 0.5, bar)
|
||||
iron.push(brace)
|
||||
// The curl at the end of the arm: the signature of forged iron.
|
||||
const curl = boxGeometry(
|
||||
[bar * 0.9, config.reach * 0.3, bar * 0.9],
|
||||
[0, config.reach * 0.15, 0],
|
||||
const curlRadius = config.reach * 0.11
|
||||
const curl = arcBarGeometry(
|
||||
curlRadius, bar * 0.9, -2.6, 1.9, 9, [0, 0, 0],
|
||||
tint('iron', 0.06, 0.7),
|
||||
)
|
||||
bendGeometry(curl, 5.2 / (config.reach * 0.3))
|
||||
curl.rotateX(Math.PI / 2)
|
||||
curl.translate(0, armY + bar * 0.5, config.reach)
|
||||
curl.rotateY(-Math.PI / 2)
|
||||
// Hung under the end of the arm, where a smith finishes the bar.
|
||||
curl.translate(0, armY + bar * 0.5 - curlRadius, config.reach - bar)
|
||||
iron.push(curl)
|
||||
|
||||
// Cross-bar at the end of the arm.
|
||||
|
|
@ -204,11 +223,21 @@ export function createModel(overrides: Partial<TavernSignConfig> = {}) {
|
|||
const y = -config.drop * (i / Math.max(1, count - 1))
|
||||
const ring = bandGeometry(linkRadius, 0, bar * 0.6, bar * 0.35, 6,
|
||||
tint('iron', jitter(random, 0.05), 0.7), { inner: true })
|
||||
// Each link is indexed a little differently about its own axis.
|
||||
//
|
||||
// The links are six-sided and they interlock, so consecutive ones
|
||||
// share space; with every link built at the same phase their facets
|
||||
// came out parallel and, where they overlapped, coplanar. Lengthening
|
||||
// the drop made this visible because the links grew with it -- radius
|
||||
// 0.0195 to 0.0434 -- and began to overlap in earnest. The offset is
|
||||
// deterministic rather than random so the seeded stream is untouched,
|
||||
// and a real chain does not index its links either.
|
||||
ring.rotateY(i * 0.37 + side * 0.19)
|
||||
// Successive links must pass through at right angles — that is what a
|
||||
// chain is.
|
||||
ring.rotateX(i % 2 === 0 ? Math.PI / 2 : 0)
|
||||
ring.rotateZ(i % 2 === 0 ? 0 : Math.PI / 2)
|
||||
ring.translate(side * hangX, y, config.reach * 0.86 * (side === 0 ? 1 : 1))
|
||||
ring.translate(side * hangX, y, 0)
|
||||
links.push(ring)
|
||||
}
|
||||
}
|
||||
|
|
@ -224,7 +253,7 @@ export function createModel(overrides: Partial<TavernSignConfig> = {}) {
|
|||
[config.width * 0.997, config.height * 0.05],
|
||||
plankHeight * 0.94,
|
||||
config.height * 0.012,
|
||||
[0, y, config.reach * 0.86],
|
||||
[0, y, 0],
|
||||
tint('oak', jitter(random, 0.05)),
|
||||
))
|
||||
}
|
||||
|
|
@ -233,7 +262,7 @@ export function createModel(overrides: Partial<TavernSignConfig> = {}) {
|
|||
for (const side of [-1, 1]) {
|
||||
board.push(boxGeometry(
|
||||
[config.width * 0.07, config.height * 0.94, config.height * 0.045],
|
||||
[side * config.width * 0.36, -config.drop - config.height / 2, config.reach * 0.86 - config.height * 0.045],
|
||||
[side * config.width * 0.36, -config.drop - config.height / 2, -config.height * 0.045],
|
||||
tint('oak', -0.09),
|
||||
))
|
||||
}
|
||||
|
|
@ -241,7 +270,7 @@ export function createModel(overrides: Partial<TavernSignConfig> = {}) {
|
|||
for (const side of [-1, 1]) {
|
||||
links.push(boxGeometry(
|
||||
[bar * 1.2, config.drop * 0.4, bar * 1.4],
|
||||
[side * hangX, -config.drop - config.drop * 0.06, config.reach * 0.86],
|
||||
[side * hangX, -config.drop - config.drop * 0.06, 0],
|
||||
tint('iron', 0.04, 0.7),
|
||||
))
|
||||
}
|
||||
|
|
@ -252,7 +281,21 @@ export function createModel(overrides: Partial<TavernSignConfig> = {}) {
|
|||
board: {
|
||||
slot: 'oak' as const,
|
||||
geometry: mergeColoured(board),
|
||||
origin: [0, pivotY, 0] as const,
|
||||
// The origin is the CROSS-BAR, not the post.
|
||||
//
|
||||
// Everything in this part is authored hanging from the bar at
|
||||
// z = reach * 0.86, but the origin sat at z = 0 on the post's centre
|
||||
// line -- half a metre away. At rest that is invisible; the moment
|
||||
// the swing action runs, the whole assembly rotates about a point it
|
||||
// does not hang from, and the tops of the chains sweep off the bar
|
||||
// they are supposed to be looped through. The support audit caught it
|
||||
// as a detached board the instant the sheared curl stopped
|
||||
// accidentally filling the gap.
|
||||
//
|
||||
// Moving the origin means the geometry above is written relative to
|
||||
// the bar, which is why every `config.reach * 0.86` in this part is
|
||||
// now zero. Same place in the world, correct axis to turn about.
|
||||
origin: [0, pivotY, config.reach * 0.86] as const,
|
||||
extras: [{ slot: 'iron' as const, geometry: mergeColoured(links) }],
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@
|
|||
import type { BufferGeometry } from 'three'
|
||||
|
||||
import {
|
||||
arcBarGeometry,
|
||||
bandGeometry,
|
||||
bendGeometry,
|
||||
boxGeometry,
|
||||
chamferedBoxGeometry,
|
||||
createKitModel,
|
||||
|
|
@ -51,7 +51,10 @@ export const tavernSignDefaults: TavernSignConfig = {
|
|||
height: 0.52,
|
||||
reach: 0.62,
|
||||
postHeight: 2.15,
|
||||
drop: 0.12,
|
||||
// Long enough to see the chain. At 0.12 the board hung almost against the
|
||||
// bracket and the five links that connect them were a smudge; the chain is
|
||||
// half of what makes a hanging sign read as hanging.
|
||||
drop: 0.28,
|
||||
plankCount: 3,
|
||||
damping: 0.42,
|
||||
seed: 73,
|
||||
|
|
@ -95,7 +98,11 @@ export function createModel(overrides: Partial<TavernSignConfig> = {}) {
|
|||
// period-correct — plenty of inn signs were on posts rather than walls —
|
||||
// and it is the version that can actually be dropped into a scene,
|
||||
// because it holds itself up.
|
||||
const postWidth = config.reach * 0.1
|
||||
// A signpost is a structural timber, not a stake. At reach*0.1 it came
|
||||
// out 62 mm square carrying a 0.72 m board two metres up -- thinner than
|
||||
// the board is thick, and part of the same across-the-kit habit of
|
||||
// under-sizing timber that the bench, the table and the fence all share.
|
||||
const postWidth = config.reach * 0.19
|
||||
const postTop = pivotY + config.reach * 0.1
|
||||
const postBase = postTop - config.postHeight
|
||||
const timber: BufferGeometry[] = [chamferedBoxGeometry(
|
||||
|
|
@ -134,25 +141,37 @@ export function createModel(overrides: Partial<TavernSignConfig> = {}) {
|
|||
// Brace: the curved support tying the arm back to the wall. Without it
|
||||
// the arm looks like it is hanging in the air and the eye's question of
|
||||
// "what is holding this up" goes unanswered.
|
||||
const braceLength = config.reach * 0.72
|
||||
const brace = boxGeometry(
|
||||
[bar * 1.1, braceLength, bar * 1.1],
|
||||
[0, braceLength / 2, 0],
|
||||
// A real quarter-arc, not a sheared box.
|
||||
//
|
||||
// This and the curl below were both `boxGeometry` put through
|
||||
// `bendGeometry`, and a box has two levels in Y. `bendGeometry` cannot
|
||||
// bend two levels -- it shears them -- so neither piece was ever a
|
||||
// curve. The sheared curl is what pushed the bracket's top to 0.579
|
||||
// while the post it is bolted to ends at 0.442: an arm standing above
|
||||
// its own post, which is why the sign read as broken rather than as
|
||||
// ironwork.
|
||||
//
|
||||
// `arcBarGeometry` sweeps a real arc. Its ends are placed rather than
|
||||
// corrected: one inside the post, one inside the arm.
|
||||
const braceRadius = config.reach * 0.45
|
||||
const brace = arcBarGeometry(
|
||||
braceRadius, bar * 1.2, -Math.PI / 2, 0, 7, [0, 0, 0],
|
||||
tint('iron', -0.02, 0.7),
|
||||
)
|
||||
bendGeometry(brace, -1.15 / braceLength)
|
||||
brace.rotateX(Math.PI / 4)
|
||||
brace.translate(0, armY - config.height * 0.42, bar)
|
||||
// Built in XY; -90 degrees about Y carries +X into +Z, standing the arc
|
||||
// in the plane the bracket occupies.
|
||||
brace.rotateY(-Math.PI / 2)
|
||||
brace.translate(0, armY + bar * 0.5, bar)
|
||||
iron.push(brace)
|
||||
// The curl at the end of the arm: the signature of forged iron.
|
||||
const curl = boxGeometry(
|
||||
[bar * 0.9, config.reach * 0.3, bar * 0.9],
|
||||
[0, config.reach * 0.15, 0],
|
||||
const curlRadius = config.reach * 0.11
|
||||
const curl = arcBarGeometry(
|
||||
curlRadius, bar * 0.9, -2.6, 1.9, 9, [0, 0, 0],
|
||||
tint('iron', 0.06, 0.7),
|
||||
)
|
||||
bendGeometry(curl, 5.2 / (config.reach * 0.3))
|
||||
curl.rotateX(Math.PI / 2)
|
||||
curl.translate(0, armY + bar * 0.5, config.reach)
|
||||
curl.rotateY(-Math.PI / 2)
|
||||
// Hung under the end of the arm, where a smith finishes the bar.
|
||||
curl.translate(0, armY + bar * 0.5 - curlRadius, config.reach - bar)
|
||||
iron.push(curl)
|
||||
|
||||
// Cross-bar at the end of the arm.
|
||||
|
|
@ -204,11 +223,21 @@ export function createModel(overrides: Partial<TavernSignConfig> = {}) {
|
|||
const y = -config.drop * (i / Math.max(1, count - 1))
|
||||
const ring = bandGeometry(linkRadius, 0, bar * 0.6, bar * 0.35, 6,
|
||||
tint('iron', jitter(random, 0.05), 0.7), { inner: true })
|
||||
// Each link is indexed a little differently about its own axis.
|
||||
//
|
||||
// The links are six-sided and they interlock, so consecutive ones
|
||||
// share space; with every link built at the same phase their facets
|
||||
// came out parallel and, where they overlapped, coplanar. Lengthening
|
||||
// the drop made this visible because the links grew with it -- radius
|
||||
// 0.0195 to 0.0434 -- and began to overlap in earnest. The offset is
|
||||
// deterministic rather than random so the seeded stream is untouched,
|
||||
// and a real chain does not index its links either.
|
||||
ring.rotateY(i * 0.37 + side * 0.19)
|
||||
// Successive links must pass through at right angles — that is what a
|
||||
// chain is.
|
||||
ring.rotateX(i % 2 === 0 ? Math.PI / 2 : 0)
|
||||
ring.rotateZ(i % 2 === 0 ? 0 : Math.PI / 2)
|
||||
ring.translate(side * hangX, y, config.reach * 0.86 * (side === 0 ? 1 : 1))
|
||||
ring.translate(side * hangX, y, 0)
|
||||
links.push(ring)
|
||||
}
|
||||
}
|
||||
|
|
@ -224,7 +253,7 @@ export function createModel(overrides: Partial<TavernSignConfig> = {}) {
|
|||
[config.width * 0.997, config.height * 0.05],
|
||||
plankHeight * 0.94,
|
||||
config.height * 0.012,
|
||||
[0, y, config.reach * 0.86],
|
||||
[0, y, 0],
|
||||
tint('oak', jitter(random, 0.05)),
|
||||
))
|
||||
}
|
||||
|
|
@ -233,7 +262,7 @@ export function createModel(overrides: Partial<TavernSignConfig> = {}) {
|
|||
for (const side of [-1, 1]) {
|
||||
board.push(boxGeometry(
|
||||
[config.width * 0.07, config.height * 0.94, config.height * 0.045],
|
||||
[side * config.width * 0.36, -config.drop - config.height / 2, config.reach * 0.86 - config.height * 0.045],
|
||||
[side * config.width * 0.36, -config.drop - config.height / 2, -config.height * 0.045],
|
||||
tint('oak', -0.09),
|
||||
))
|
||||
}
|
||||
|
|
@ -241,7 +270,7 @@ export function createModel(overrides: Partial<TavernSignConfig> = {}) {
|
|||
for (const side of [-1, 1]) {
|
||||
links.push(boxGeometry(
|
||||
[bar * 1.2, config.drop * 0.4, bar * 1.4],
|
||||
[side * hangX, -config.drop - config.drop * 0.06, config.reach * 0.86],
|
||||
[side * hangX, -config.drop - config.drop * 0.06, 0],
|
||||
tint('iron', 0.04, 0.7),
|
||||
))
|
||||
}
|
||||
|
|
@ -252,7 +281,21 @@ export function createModel(overrides: Partial<TavernSignConfig> = {}) {
|
|||
board: {
|
||||
slot: 'oak' as const,
|
||||
geometry: mergeColoured(board),
|
||||
origin: [0, pivotY, 0] as const,
|
||||
// The origin is the CROSS-BAR, not the post.
|
||||
//
|
||||
// Everything in this part is authored hanging from the bar at
|
||||
// z = reach * 0.86, but the origin sat at z = 0 on the post's centre
|
||||
// line -- half a metre away. At rest that is invisible; the moment
|
||||
// the swing action runs, the whole assembly rotates about a point it
|
||||
// does not hang from, and the tops of the chains sweep off the bar
|
||||
// they are supposed to be looped through. The support audit caught it
|
||||
// as a detached board the instant the sheared curl stopped
|
||||
// accidentally filling the gap.
|
||||
//
|
||||
// Moving the origin means the geometry above is written relative to
|
||||
// the bar, which is why every `config.reach * 0.86` in this part is
|
||||
// now zero. Same place in the world, correct axis to turn about.
|
||||
origin: [0, pivotY, config.reach * 0.86] as const,
|
||||
extras: [{ slot: 'iron' as const, geometry: mergeColoured(links) }],
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue