diff --git a/models.lock.json b/models.lock.json index aa2e4be..f23822a 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-23T06:25:52.683Z", + "installedAt": "2026-08-23T06:28:21.677Z", "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-23T06:25:52.661Z", + "installedAt": "2026-08-23T06:28:21.655Z", "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-23T06:25:52.688Z", + "installedAt": "2026-08-23T06:28:21.682Z", "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-23T06:25:52.695Z", + "installedAt": "2026-08-23T06:28:21.689Z", "files": [], "dependencies": [] }, @@ -152,7 +152,7 @@ "address": "@medieval-kit/iron-anvil", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T06:25:52.669Z", + "installedAt": "2026-08-23T06:28:21.664Z", "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-23T06:25:52.686Z", + "installedAt": "2026-08-23T06:28:21.680Z", "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-23T06:25:52.689Z", + "installedAt": "2026-08-23T06:28:21.683Z", "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-23T06:25:52.690Z", + "installedAt": "2026-08-23T06:28:21.684Z", "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-23T06:25:52.691Z", + "installedAt": "2026-08-23T06:28:21.686Z", "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-23T06:25:52.692Z", + "installedAt": "2026-08-23T06:28:21.687Z", "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-23T06:25:52.693Z", + "installedAt": "2026-08-23T06:28:21.688Z", "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-23T06:25:52.695Z", + "installedAt": "2026-08-23T06:28:21.689Z", "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-23T06:25:52.664Z", + "installedAt": "2026-08-23T06:28:21.659Z", "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-23T06:25:52.674Z", + "installedAt": "2026-08-23T06:28:21.668Z", "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-23T06:25:52.681Z", + "installedAt": "2026-08-23T06:28:21.675Z", "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-23T06:25:52.687Z", + "installedAt": "2026-08-23T06:28:21.681Z", "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-23T06:25:52.668Z", + "installedAt": "2026-08-23T06:28:21.662Z", "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-23T06:25:52.676Z", + "installedAt": "2026-08-23T06:28:21.671Z", "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-23T06:25:52.685Z", + "installedAt": "2026-08-23T06:28:21.678Z", "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-23T06:25:52.672Z", + "installedAt": "2026-08-23T06:28:21.667Z", "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-23T06:25:52.675Z", + "installedAt": "2026-08-23T06:28:21.669Z", "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-23T06:25:52.678Z", + "installedAt": "2026-08-23T06:28:21.673Z", "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-23T06:25:52.663Z", + "installedAt": "2026-08-23T06:28:21.657Z", "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-23T06:25:52.670Z", + "installedAt": "2026-08-23T06:28:21.665Z", "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-23T06:25:52.680Z", + "installedAt": "2026-08-23T06:28:21.674Z", "files": [ { "path": "src\\models\\medieval-kit\\tavern-sign\\model.ts", - "sourceHash": "4e83c594e037384b95e21c98b73ca4a64e49a7a22aa59e8a9ffb5b867b9a6e68" + "sourceHash": "31b8a14033543246a72ae0a42099bca0b5cc8666d4c0ac6d87acce5c1f109340" } ], "dependencies": [ @@ -467,7 +467,7 @@ "address": "@medieval-kit/coin-pouch", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T06:25:52.665Z", + "installedAt": "2026-08-23T06:28:21.660Z", "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-23T06:25:52.666Z", + "installedAt": "2026-08-23T06:28:21.661Z", "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-23T06:25:52.671Z", + "installedAt": "2026-08-23T06:28:21.666Z", "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-23T06:25:52.682Z", + "installedAt": "2026-08-23T06:28:21.676Z", "files": [ { "path": "src\\models\\medieval-kit\\wicker-basket\\model.ts", @@ -527,7 +527,7 @@ "address": "@medieval-kit/post-mill", "source": "file:my-registry/dist/registry.json", "version": "workspace", - "installedAt": "2026-08-23T06:25:52.677Z", + "installedAt": "2026-08-23T06:28:21.672Z", "files": [ { "path": "src\\models\\medieval-kit\\post-mill\\model.ts", diff --git a/my-registry/models/tavern-sign/model.ts b/my-registry/models/tavern-sign/model.ts index 1d7173b..dd1daed 100644 --- a/my-registry/models/tavern-sign/model.ts +++ b/my-registry/models/tavern-sign/model.ts @@ -88,7 +88,9 @@ export function createModel(overrides: Partial = {}) { // board and the chains are written RELATIVE to this point. const pivotY = config.height * 0.5 + config.drop const armY = pivotY - const hangX = config.width * 0.4 + // Where the two chains meet the arm, measured ALONG it. + const hangA = config.reach * 0.34 + const hangB = config.reach * 0.92 // --- Bracket ----------------------------------------------------------- // Sits against the wall at Z zero and reaches out along +Z. @@ -174,19 +176,18 @@ export function createModel(overrides: Partial = {}) { curl.translate(0, armY + bar * 0.5 - curlRadius, config.reach - bar) iron.push(curl) - // Cross-bar at the end of the arm. + // No cross-bar. The chains hang from the ARM. // - // Without it the board could not be attached at all: the arm is a single - // bar on the model's centre line, roughly 4 cm wide, while the board - // hangs from two chains set `width * 0.8` apart. The chains passed the - // arm on either side and touched nothing, so the entire board — planks, - // battens, chains and all — was a separate object hanging in the air. - // A real bracket has this piece for exactly the same reason. - iron.push(boxGeometry( - [hangX * 2 + bar * 2.4, bar * 1.2, bar * 1.5], - [0, armY + bar * 0.5, config.reach * 0.86], - tint('iron', 0.03, 0.7), - )) + // The board used to hang across the arm rather than along it -- its width + // ran in X while the arm projected in Z -- so the sign stuck out sideways + // from the end of the bracket. That is not how an inn sign hangs: the arm + // comes out from the post and the board hangs UNDER it, in line with it, + // so it faces the road on both sides and can be read walking past. + // + // Once the board is turned the right way its two chains hang from two + // points along the arm, and the arm is the cross-bar. The extra piece + // that used to be needed to reach chains set either side of a + // centre-line bar is not needed at all. // --- Chains ---------------------------------------------------------------- // They have to swing TOGETHER with the board, hence the board's `extras` @@ -237,7 +238,7 @@ export function createModel(overrides: Partial = {}) { // 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, 0) + ring.translate(0, y, side < 0 ? hangA - config.reach * 0.62 : hangB - config.reach * 0.62) links.push(ring) } } @@ -249,8 +250,8 @@ export function createModel(overrides: Partial = {}) { for (let i = 0; i < planks; i += 1) { const y = -config.drop - config.height + plankHeight * (i + 0.5) board.push(chamferedBoxGeometry( - [config.width, config.height * 0.055], - [config.width * 0.997, config.height * 0.05], + [config.height * 0.055, config.width], + [config.height * 0.05, config.width * 0.997], plankHeight * 0.94, config.height * 0.012, [0, y, 0], @@ -261,16 +262,16 @@ export function createModel(overrides: Partial = {}) { // INTO the planks so that no two faces end up coplanar. 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.height * 0.045], + [config.height * 0.045, config.height * 0.94, config.width * 0.07], + [-config.height * 0.045, -config.drop - config.height / 2, side * config.width * 0.36], tint('oak', -0.09), )) } // The two iron lugs joining the board to the chain. 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, 0], + [bar * 1.4, config.drop * 0.4, bar * 1.2], + [0, -config.drop - config.drop * 0.06, side < 0 ? hangA - config.reach * 0.62 : hangB - config.reach * 0.62], tint('iron', 0.04, 0.7), )) } @@ -295,21 +296,21 @@ export function createModel(overrides: Partial = {}) { // 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, + origin: [0, pivotY, config.reach * 0.62] as const, extras: [{ slot: 'iron' as const, geometry: mergeColoured(links) }], }, } }, actions: ({ parts }) => { - parts.board.anchor.rotation.x = angle + parts.board.anchor.rotation.z = angle return { push: (strength = 1) => { // Reinforces the existing motion instead of resetting it: successive // pushes should accumulate the way a real wind does. velocity += (velocity >= 0 ? 1 : -1) * 1.6 * strength }, - still: () => { angle = 0; velocity = 0; parts.board.anchor.rotation.x = 0 }, + still: () => { angle = 0; velocity = 0; parts.board.anchor.rotation.z = 0 }, lean: () => angle, } }, @@ -328,7 +329,7 @@ export function createModel(overrides: Partial = {}) { angle = Math.sign(angle) * limit velocity *= -0.4 } - parts.board.anchor.rotation.x = angle + parts.board.anchor.rotation.z = angle }, }, overrides) } diff --git a/src/models/medieval-kit/tavern-sign/model.ts b/src/models/medieval-kit/tavern-sign/model.ts index 1d7173b..dd1daed 100644 --- a/src/models/medieval-kit/tavern-sign/model.ts +++ b/src/models/medieval-kit/tavern-sign/model.ts @@ -88,7 +88,9 @@ export function createModel(overrides: Partial = {}) { // board and the chains are written RELATIVE to this point. const pivotY = config.height * 0.5 + config.drop const armY = pivotY - const hangX = config.width * 0.4 + // Where the two chains meet the arm, measured ALONG it. + const hangA = config.reach * 0.34 + const hangB = config.reach * 0.92 // --- Bracket ----------------------------------------------------------- // Sits against the wall at Z zero and reaches out along +Z. @@ -174,19 +176,18 @@ export function createModel(overrides: Partial = {}) { curl.translate(0, armY + bar * 0.5 - curlRadius, config.reach - bar) iron.push(curl) - // Cross-bar at the end of the arm. + // No cross-bar. The chains hang from the ARM. // - // Without it the board could not be attached at all: the arm is a single - // bar on the model's centre line, roughly 4 cm wide, while the board - // hangs from two chains set `width * 0.8` apart. The chains passed the - // arm on either side and touched nothing, so the entire board — planks, - // battens, chains and all — was a separate object hanging in the air. - // A real bracket has this piece for exactly the same reason. - iron.push(boxGeometry( - [hangX * 2 + bar * 2.4, bar * 1.2, bar * 1.5], - [0, armY + bar * 0.5, config.reach * 0.86], - tint('iron', 0.03, 0.7), - )) + // The board used to hang across the arm rather than along it -- its width + // ran in X while the arm projected in Z -- so the sign stuck out sideways + // from the end of the bracket. That is not how an inn sign hangs: the arm + // comes out from the post and the board hangs UNDER it, in line with it, + // so it faces the road on both sides and can be read walking past. + // + // Once the board is turned the right way its two chains hang from two + // points along the arm, and the arm is the cross-bar. The extra piece + // that used to be needed to reach chains set either side of a + // centre-line bar is not needed at all. // --- Chains ---------------------------------------------------------------- // They have to swing TOGETHER with the board, hence the board's `extras` @@ -237,7 +238,7 @@ export function createModel(overrides: Partial = {}) { // 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, 0) + ring.translate(0, y, side < 0 ? hangA - config.reach * 0.62 : hangB - config.reach * 0.62) links.push(ring) } } @@ -249,8 +250,8 @@ export function createModel(overrides: Partial = {}) { for (let i = 0; i < planks; i += 1) { const y = -config.drop - config.height + plankHeight * (i + 0.5) board.push(chamferedBoxGeometry( - [config.width, config.height * 0.055], - [config.width * 0.997, config.height * 0.05], + [config.height * 0.055, config.width], + [config.height * 0.05, config.width * 0.997], plankHeight * 0.94, config.height * 0.012, [0, y, 0], @@ -261,16 +262,16 @@ export function createModel(overrides: Partial = {}) { // INTO the planks so that no two faces end up coplanar. 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.height * 0.045], + [config.height * 0.045, config.height * 0.94, config.width * 0.07], + [-config.height * 0.045, -config.drop - config.height / 2, side * config.width * 0.36], tint('oak', -0.09), )) } // The two iron lugs joining the board to the chain. 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, 0], + [bar * 1.4, config.drop * 0.4, bar * 1.2], + [0, -config.drop - config.drop * 0.06, side < 0 ? hangA - config.reach * 0.62 : hangB - config.reach * 0.62], tint('iron', 0.04, 0.7), )) } @@ -295,21 +296,21 @@ export function createModel(overrides: Partial = {}) { // 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, + origin: [0, pivotY, config.reach * 0.62] as const, extras: [{ slot: 'iron' as const, geometry: mergeColoured(links) }], }, } }, actions: ({ parts }) => { - parts.board.anchor.rotation.x = angle + parts.board.anchor.rotation.z = angle return { push: (strength = 1) => { // Reinforces the existing motion instead of resetting it: successive // pushes should accumulate the way a real wind does. velocity += (velocity >= 0 ? 1 : -1) * 1.6 * strength }, - still: () => { angle = 0; velocity = 0; parts.board.anchor.rotation.x = 0 }, + still: () => { angle = 0; velocity = 0; parts.board.anchor.rotation.z = 0 }, lean: () => angle, } }, @@ -328,7 +329,7 @@ export function createModel(overrides: Partial = {}) { angle = Math.sign(angle) * limit velocity *= -0.4 } - parts.board.anchor.rotation.x = angle + parts.board.anchor.rotation.z = angle }, }, overrides) }