Stop createTinter sharing one Color, and fix what that was hiding
The tinter returned a single Color and mutated it on every call. The
reasoning was sound -- the geometry helpers read the colour immediately, so
an allocation per call is waste -- and it holds right up until two tints
appear as arguments of the SAME call:
latheGeometry(profile, 7, origin, tint('char', 0.06),
{ colourTop: tint('charHot', -0.12) })
Both arguments are the same object and both carry whatever the second call
computed. That is why the torch's pitch head rendered hot orange instead of
black: the char never reached the geometry. The same mistake turned up
twice more in one session -- the anvil's stump came out painted in end
grain on every face, and the shovel nearly went the same way. Three
occurrences means the hazard belongs to the helper, not to the callers, and
a few hundred allocations at build time is not a price worth one class of
silent, invisible bug. `steelTint` and `ironTint` already allocate; the two
disagreeing was itself part of the trap.
With the colour actually arriving, the torch head is also fatter -- at 2.5
shaft radii it was a spindle, where a torch head is a fist of tow and rags
bound on, and it is the whole reason the object is not a stick -- and its
flame is shorter than the head that feeds it rather than twice its height.
The cart wheel's tyre was 23 mm of iron on a 0.52 m radius, set wider than
the wheel itself, and read as a pneumatic. A real tyre is 8 to 12 mm of bar
shrunk onto the felloe. It could not simply be narrowed: the felloe's axial
thickness jitters by ±7%, so anything from 0.93 to 1.07 of the width will
sooner or later share a plane with some piece, and the earlier fix for that
flicker was to go wider than the whole range at 1.1 -- which is what made it
look pneumatic. Going UNDER the range solves it the same way and is the
truer shape: the hoop is set into the tread, and on a worn wheel a sliver
of felloe shows at each edge where the iron has bedded in.
27 models, 19007 triangles, all checks pass, 0 floating cases, GLB
round-trip clean, Conformant, build clean.
This commit is contained in:
parent
64e8932d1b
commit
96defca639
7 changed files with 130 additions and 70 deletions
|
|
@ -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-23T05:02:54.976Z",
|
"installedAt": "2026-08-23T05:09:14.197Z",
|
||||||
"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-23T05:02:54.957Z",
|
"installedAt": "2026-08-23T05:09:14.176Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\medieval-kit\\core\\geometry.ts",
|
"path": "src\\models\\medieval-kit\\core\\geometry.ts",
|
||||||
|
|
@ -118,7 +118,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "src\\models\\medieval-kit\\core\\tint.ts",
|
"path": "src\\models\\medieval-kit\\core\\tint.ts",
|
||||||
"sourceHash": "d5b8d1606a64dfc223543330499b22de00850a8fc446597d211cddc46d08e73b"
|
"sourceHash": "381f4b64574ebc80bd150c50cd8faadd778cbb31775e412f52f2d500075f8350"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
|
|
@ -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-23T05:02:54.980Z",
|
"installedAt": "2026-08-23T05:09:14.202Z",
|
||||||
"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-23T05:02:54.985Z",
|
"installedAt": "2026-08-23T05:09:14.209Z",
|
||||||
"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-23T05:02:54.964Z",
|
"installedAt": "2026-08-23T05:09:14.184Z",
|
||||||
"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-23T05:02:54.978Z",
|
"installedAt": "2026-08-23T05:09:14.199Z",
|
||||||
"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-23T05:02:54.981Z",
|
"installedAt": "2026-08-23T05:09:14.203Z",
|
||||||
"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-23T05:02:54.982Z",
|
"installedAt": "2026-08-23T05:09:14.204Z",
|
||||||
"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-23T05:02:54.982Z",
|
"installedAt": "2026-08-23T05:09:14.205Z",
|
||||||
"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-23T05:02:54.983Z",
|
"installedAt": "2026-08-23T05:09:14.206Z",
|
||||||
"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-23T05:02:54.984Z",
|
"installedAt": "2026-08-23T05:09:14.208Z",
|
||||||
"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-23T05:02:54.985Z",
|
"installedAt": "2026-08-23T05:09:14.209Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\medieval-kit\\wooden-stool\\model.ts",
|
"path": "src\\models\\medieval-kit\\wooden-stool\\model.ts",
|
||||||
|
|
@ -272,11 +272,11 @@
|
||||||
"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-23T05:02:54.960Z",
|
"installedAt": "2026-08-23T05:09:14.180Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\medieval-kit\\cart-wheel\\model.ts",
|
"path": "src\\models\\medieval-kit\\cart-wheel\\model.ts",
|
||||||
"sourceHash": "5ed858155c12e65a7e9ba4a9a6cce681770fbbc88d97233f2d1b7577417d178c"
|
"sourceHash": "08fb82af124cfaab7e7b3682eb04d912b552e7f2310e3ec290fe03159642384a"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
|
|
@ -287,7 +287,7 @@
|
||||||
"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-23T05:02:54.968Z",
|
"installedAt": "2026-08-23T05:09:14.189Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\medieval-kit\\log-pile\\model.ts",
|
"path": "src\\models\\medieval-kit\\log-pile\\model.ts",
|
||||||
|
|
@ -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-23T05:02:54.974Z",
|
"installedAt": "2026-08-23T05:09:14.194Z",
|
||||||
"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-23T05:02:54.979Z",
|
"installedAt": "2026-08-23T05:09:14.201Z",
|
||||||
"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-23T05:02:54.963Z",
|
"installedAt": "2026-08-23T05:09:14.183Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\medieval-kit\\hay-bale\\model.ts",
|
"path": "src\\models\\medieval-kit\\hay-bale\\model.ts",
|
||||||
|
|
@ -347,11 +347,11 @@
|
||||||
"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-23T05:02:54.970Z",
|
"installedAt": "2026-08-23T05:09:14.191Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\medieval-kit\\pitch-torch\\model.ts",
|
"path": "src\\models\\medieval-kit\\pitch-torch\\model.ts",
|
||||||
"sourceHash": "cc6f51cdb70dfb9c247eed26dc42cdd28a45a78959ce318bf8aadd20f2f05a50"
|
"sourceHash": "afc3b92ad659f102aa141de59ba8d1d5d6ba36cace3f10d4b51639098acbd510"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
|
|
@ -362,7 +362,7 @@
|
||||||
"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-23T05:02:54.977Z",
|
"installedAt": "2026-08-23T05:09:14.198Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\medieval-kit\\wooden-bench\\model.ts",
|
"path": "src\\models\\medieval-kit\\wooden-bench\\model.ts",
|
||||||
|
|
@ -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-23T05:02:54.967Z",
|
"installedAt": "2026-08-23T05:09:14.188Z",
|
||||||
"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-23T05:02:54.969Z",
|
"installedAt": "2026-08-23T05:09:14.190Z",
|
||||||
"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-23T05:02:54.971Z",
|
"installedAt": "2026-08-23T05:09:14.192Z",
|
||||||
"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-23T05:02:54.959Z",
|
"installedAt": "2026-08-23T05:09:14.178Z",
|
||||||
"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-23T05:02:54.965Z",
|
"installedAt": "2026-08-23T05:09:14.186Z",
|
||||||
"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-23T05:02:54.972Z",
|
"installedAt": "2026-08-23T05:09:14.193Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\medieval-kit\\tavern-sign\\model.ts",
|
"path": "src\\models\\medieval-kit\\tavern-sign\\model.ts",
|
||||||
|
|
@ -467,7 +467,7 @@
|
||||||
"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-23T05:02:54.961Z",
|
"installedAt": "2026-08-23T05:09:14.181Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\medieval-kit\\coin-pouch\\model.ts",
|
"path": "src\\models\\medieval-kit\\coin-pouch\\model.ts",
|
||||||
|
|
@ -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-23T05:02:54.962Z",
|
"installedAt": "2026-08-23T05:09:14.182Z",
|
||||||
"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-23T05:02:54.966Z",
|
"installedAt": "2026-08-23T05:09:14.187Z",
|
||||||
"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-23T05:02:54.975Z",
|
"installedAt": "2026-08-23T05:09:14.195Z",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"path": "src\\models\\medieval-kit\\wicker-basket\\model.ts",
|
"path": "src\\models\\medieval-kit\\wicker-basket\\model.ts",
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,11 @@ export const cartWheelDefaults: CartWheelConfig = {
|
||||||
spokeCount: 10,
|
spokeCount: 10,
|
||||||
width: 0.09,
|
width: 0.09,
|
||||||
hubLength: 2.1,
|
hubLength: 2.1,
|
||||||
tyre: 0.045,
|
// An iron tyre is a HOOP: 8 to 12 mm of bar shrunk onto the felloe. At
|
||||||
|
// 0.045 of a 0.52 m radius it was 23 mm of iron, and with an axial width
|
||||||
|
// greater than the wheel's own it read as a pneumatic tyre rather than as
|
||||||
|
// the band that holds a wooden rim together.
|
||||||
|
tyre: 0.022,
|
||||||
seed: 27,
|
seed: 27,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -163,12 +167,20 @@ export function createModel(overrides: Partial<CartWheelConfig> = {}) {
|
||||||
const tyre = bandGeometry(
|
const tyre = bandGeometry(
|
||||||
config.radius,
|
config.radius,
|
||||||
0,
|
0,
|
||||||
// Wider than the felloe, and wider than the widest felloe piece can
|
// NARROWER than the narrowest felloe piece can jitter to.
|
||||||
// jitter to (±7%). A tyre exactly the felloe's width put its side faces
|
//
|
||||||
// in the same plane as any piece whose jitter came out near zero, and
|
// The felloe's axial thickness jitters by ±7%, so anything between
|
||||||
// those pairs flickered. A real iron tyre is proud of the wood anyway —
|
// 0.93 and 1.07 of the width lands inside that range and will sooner
|
||||||
// it is what takes the wear.
|
// or later share a plane with some piece; a tyre at exactly the
|
||||||
config.width * 1.1,
|
// felloe's width flickered against whichever piece came out near
|
||||||
|
// zero jitter. The first answer was to go wider than the whole range,
|
||||||
|
// at 1.1 -- which stopped the flicker and made the wheel look shod in
|
||||||
|
// a pneumatic tyre, a black band standing proud of its own rim.
|
||||||
|
//
|
||||||
|
// Going under the range instead solves it the same way and is the
|
||||||
|
// truer shape: the hoop is set into the tread, and on a worn wheel a
|
||||||
|
// sliver of felloe shows at each edge where the iron has bedded in.
|
||||||
|
config.width * 0.9,
|
||||||
tyreThickness * 1.06,
|
tyreThickness * 1.06,
|
||||||
segments * 2,
|
segments * 2,
|
||||||
iron(),
|
iron(),
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,27 @@ import { jitter } from './random.ts'
|
||||||
* amounts had drifted from model to model, so when two models were put side
|
* amounts had drifted from model to model, so when two models were put side
|
||||||
* by side one of them visibly had more variation than the other.
|
* by side one of them visibly had more variation than the other.
|
||||||
*
|
*
|
||||||
* The returned Color IS THE SAME OBJECT ON EVERY CALL. That is not a problem
|
* Every call returns A NEW Color.
|
||||||
* because the geometry functions read the colour immediately and write it into
|
*
|
||||||
* the vertices, and it is far cheaper than allocating one Color per call. But
|
* It used to return one shared object and mutate it, on the reasoning that the
|
||||||
* anyone who wants to keep it must do `new Color(tint(...))` — otherwise the
|
* geometry helpers read the colour immediately and an allocation per call is
|
||||||
* next call mutates what they are holding.
|
* waste. The reasoning holds right up until two tints appear as arguments of
|
||||||
|
* the SAME call:
|
||||||
|
*
|
||||||
|
* latheGeometry(profile, 7, origin, tint('char', 0.06),
|
||||||
|
* { colourTop: tint('charHot', -0.12) })
|
||||||
|
*
|
||||||
|
* Both arguments are the same object, so both carry whatever the second call
|
||||||
|
* computed. That is not a hypothetical: it is why the torch's pitch head
|
||||||
|
* rendered hot orange instead of black, and the same mistake was made twice
|
||||||
|
* more in one session -- once in the anvil's stump, which came out painted in
|
||||||
|
* end grain on every face, and once nearly in the shovel. Three times means
|
||||||
|
* the hazard is in the helper, not in the callers.
|
||||||
|
*
|
||||||
|
* A few hundred Color allocations at build time is not a cost worth one class
|
||||||
|
* of silent, invisible bug.
|
||||||
*/
|
*/
|
||||||
export function createTinter(random: () => number) {
|
export function createTinter(random: () => number) {
|
||||||
const scratch = new Color()
|
|
||||||
return (
|
return (
|
||||||
key: keyof MedievalPalette,
|
key: keyof MedievalPalette,
|
||||||
/** Lightness shift. Negative darkens. */
|
/** Lightness shift. Negative darkens. */
|
||||||
|
|
@ -26,7 +39,7 @@ export function createTinter(random: () => number) {
|
||||||
/** Deviation multiplier. 0 gives a completely flat colour. */
|
/** Deviation multiplier. 0 gives a completely flat colour. */
|
||||||
spread = 1,
|
spread = 1,
|
||||||
): Color => {
|
): Color => {
|
||||||
scratch.copy(MEDIEVAL_PALETTE[key])
|
const scratch = new Color(MEDIEVAL_PALETTE[key])
|
||||||
scratch.offsetHSL(
|
scratch.offsetHSL(
|
||||||
jitter(random, 0.012 * spread),
|
jitter(random, 0.012 * spread),
|
||||||
jitter(random, 0.05 * spread),
|
jitter(random, 0.05 * spread),
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,9 @@ export const pitchTorchDefaults: PitchTorchConfig = {
|
||||||
length: 0.58,
|
length: 0.58,
|
||||||
radius: 0.019,
|
radius: 0.019,
|
||||||
wrapLength: 0.3,
|
wrapLength: 0.3,
|
||||||
flameHeight: 1.15,
|
// The flame was taller than the head that feeds it. A pitch torch burns
|
||||||
|
// with a low, fat, smoky flame, not a candle's spire.
|
||||||
|
flameHeight: 0.78,
|
||||||
flicker: 1,
|
flicker: 1,
|
||||||
seed: 37,
|
seed: 37,
|
||||||
}
|
}
|
||||||
|
|
@ -103,13 +105,16 @@ export function createModel(overrides: Partial<PitchTorchConfig> = {}) {
|
||||||
// soot — an oak colour would be a lie here.
|
// soot — an oak colour would be a lie here.
|
||||||
const wrapProfile: Level[] = [
|
const wrapProfile: Level[] = [
|
||||||
{ y: wrapBase - wrapLength * 0.12, radius: config.radius * 1.15 },
|
{ y: wrapBase - wrapLength * 0.12, radius: config.radius * 1.15 },
|
||||||
{ y: wrapBase + wrapLength * 0.22, radius: config.radius * 2.35 },
|
// Fatter. A torch head is a fist of tow and rags soaked in pitch,
|
||||||
{ y: wrapBase + wrapLength * 0.62, radius: config.radius * 2.5 },
|
// bound on; at 2.5 shaft radii it was a spindle, and the head is the
|
||||||
{ y: half, radius: config.radius * 2.05 },
|
// whole reason the object is not a stick.
|
||||||
|
{ y: wrapBase + wrapLength * 0.22, radius: config.radius * 3.3 },
|
||||||
|
{ y: wrapBase + wrapLength * 0.62, radius: config.radius * 3.5 },
|
||||||
|
{ y: half, radius: config.radius * 2.9 },
|
||||||
]
|
]
|
||||||
const wrap = mergeColoured([latheGeometry(
|
const wrap = mergeColoured([latheGeometry(
|
||||||
wrapProfile, 7, [0, 0, 0], tint('char', 0.06),
|
wrapProfile, 7, [0, 0, 0], tint('char', 0.06),
|
||||||
{ colourTop: tint('charHot', -0.12) },
|
{ colourTop: tint('charHot', -0.32) },
|
||||||
)])
|
)])
|
||||||
|
|
||||||
// --- Flame -----------------------------------------------------------
|
// --- Flame -----------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,11 @@ export const cartWheelDefaults: CartWheelConfig = {
|
||||||
spokeCount: 10,
|
spokeCount: 10,
|
||||||
width: 0.09,
|
width: 0.09,
|
||||||
hubLength: 2.1,
|
hubLength: 2.1,
|
||||||
tyre: 0.045,
|
// An iron tyre is a HOOP: 8 to 12 mm of bar shrunk onto the felloe. At
|
||||||
|
// 0.045 of a 0.52 m radius it was 23 mm of iron, and with an axial width
|
||||||
|
// greater than the wheel's own it read as a pneumatic tyre rather than as
|
||||||
|
// the band that holds a wooden rim together.
|
||||||
|
tyre: 0.022,
|
||||||
seed: 27,
|
seed: 27,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -163,12 +167,20 @@ export function createModel(overrides: Partial<CartWheelConfig> = {}) {
|
||||||
const tyre = bandGeometry(
|
const tyre = bandGeometry(
|
||||||
config.radius,
|
config.radius,
|
||||||
0,
|
0,
|
||||||
// Wider than the felloe, and wider than the widest felloe piece can
|
// NARROWER than the narrowest felloe piece can jitter to.
|
||||||
// jitter to (±7%). A tyre exactly the felloe's width put its side faces
|
//
|
||||||
// in the same plane as any piece whose jitter came out near zero, and
|
// The felloe's axial thickness jitters by ±7%, so anything between
|
||||||
// those pairs flickered. A real iron tyre is proud of the wood anyway —
|
// 0.93 and 1.07 of the width lands inside that range and will sooner
|
||||||
// it is what takes the wear.
|
// or later share a plane with some piece; a tyre at exactly the
|
||||||
config.width * 1.1,
|
// felloe's width flickered against whichever piece came out near
|
||||||
|
// zero jitter. The first answer was to go wider than the whole range,
|
||||||
|
// at 1.1 -- which stopped the flicker and made the wheel look shod in
|
||||||
|
// a pneumatic tyre, a black band standing proud of its own rim.
|
||||||
|
//
|
||||||
|
// Going under the range instead solves it the same way and is the
|
||||||
|
// truer shape: the hoop is set into the tread, and on a worn wheel a
|
||||||
|
// sliver of felloe shows at each edge where the iron has bedded in.
|
||||||
|
config.width * 0.9,
|
||||||
tyreThickness * 1.06,
|
tyreThickness * 1.06,
|
||||||
segments * 2,
|
segments * 2,
|
||||||
iron(),
|
iron(),
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,27 @@ import { jitter } from './random.ts'
|
||||||
* amounts had drifted from model to model, so when two models were put side
|
* amounts had drifted from model to model, so when two models were put side
|
||||||
* by side one of them visibly had more variation than the other.
|
* by side one of them visibly had more variation than the other.
|
||||||
*
|
*
|
||||||
* The returned Color IS THE SAME OBJECT ON EVERY CALL. That is not a problem
|
* Every call returns A NEW Color.
|
||||||
* because the geometry functions read the colour immediately and write it into
|
*
|
||||||
* the vertices, and it is far cheaper than allocating one Color per call. But
|
* It used to return one shared object and mutate it, on the reasoning that the
|
||||||
* anyone who wants to keep it must do `new Color(tint(...))` — otherwise the
|
* geometry helpers read the colour immediately and an allocation per call is
|
||||||
* next call mutates what they are holding.
|
* waste. The reasoning holds right up until two tints appear as arguments of
|
||||||
|
* the SAME call:
|
||||||
|
*
|
||||||
|
* latheGeometry(profile, 7, origin, tint('char', 0.06),
|
||||||
|
* { colourTop: tint('charHot', -0.12) })
|
||||||
|
*
|
||||||
|
* Both arguments are the same object, so both carry whatever the second call
|
||||||
|
* computed. That is not a hypothetical: it is why the torch's pitch head
|
||||||
|
* rendered hot orange instead of black, and the same mistake was made twice
|
||||||
|
* more in one session -- once in the anvil's stump, which came out painted in
|
||||||
|
* end grain on every face, and once nearly in the shovel. Three times means
|
||||||
|
* the hazard is in the helper, not in the callers.
|
||||||
|
*
|
||||||
|
* A few hundred Color allocations at build time is not a cost worth one class
|
||||||
|
* of silent, invisible bug.
|
||||||
*/
|
*/
|
||||||
export function createTinter(random: () => number) {
|
export function createTinter(random: () => number) {
|
||||||
const scratch = new Color()
|
|
||||||
return (
|
return (
|
||||||
key: keyof MedievalPalette,
|
key: keyof MedievalPalette,
|
||||||
/** Lightness shift. Negative darkens. */
|
/** Lightness shift. Negative darkens. */
|
||||||
|
|
@ -26,7 +39,7 @@ export function createTinter(random: () => number) {
|
||||||
/** Deviation multiplier. 0 gives a completely flat colour. */
|
/** Deviation multiplier. 0 gives a completely flat colour. */
|
||||||
spread = 1,
|
spread = 1,
|
||||||
): Color => {
|
): Color => {
|
||||||
scratch.copy(MEDIEVAL_PALETTE[key])
|
const scratch = new Color(MEDIEVAL_PALETTE[key])
|
||||||
scratch.offsetHSL(
|
scratch.offsetHSL(
|
||||||
jitter(random, 0.012 * spread),
|
jitter(random, 0.012 * spread),
|
||||||
jitter(random, 0.05 * spread),
|
jitter(random, 0.05 * spread),
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,9 @@ export const pitchTorchDefaults: PitchTorchConfig = {
|
||||||
length: 0.58,
|
length: 0.58,
|
||||||
radius: 0.019,
|
radius: 0.019,
|
||||||
wrapLength: 0.3,
|
wrapLength: 0.3,
|
||||||
flameHeight: 1.15,
|
// The flame was taller than the head that feeds it. A pitch torch burns
|
||||||
|
// with a low, fat, smoky flame, not a candle's spire.
|
||||||
|
flameHeight: 0.78,
|
||||||
flicker: 1,
|
flicker: 1,
|
||||||
seed: 37,
|
seed: 37,
|
||||||
}
|
}
|
||||||
|
|
@ -103,13 +105,16 @@ export function createModel(overrides: Partial<PitchTorchConfig> = {}) {
|
||||||
// soot — an oak colour would be a lie here.
|
// soot — an oak colour would be a lie here.
|
||||||
const wrapProfile: Level[] = [
|
const wrapProfile: Level[] = [
|
||||||
{ y: wrapBase - wrapLength * 0.12, radius: config.radius * 1.15 },
|
{ y: wrapBase - wrapLength * 0.12, radius: config.radius * 1.15 },
|
||||||
{ y: wrapBase + wrapLength * 0.22, radius: config.radius * 2.35 },
|
// Fatter. A torch head is a fist of tow and rags soaked in pitch,
|
||||||
{ y: wrapBase + wrapLength * 0.62, radius: config.radius * 2.5 },
|
// bound on; at 2.5 shaft radii it was a spindle, and the head is the
|
||||||
{ y: half, radius: config.radius * 2.05 },
|
// whole reason the object is not a stick.
|
||||||
|
{ y: wrapBase + wrapLength * 0.22, radius: config.radius * 3.3 },
|
||||||
|
{ y: wrapBase + wrapLength * 0.62, radius: config.radius * 3.5 },
|
||||||
|
{ y: half, radius: config.radius * 2.9 },
|
||||||
]
|
]
|
||||||
const wrap = mergeColoured([latheGeometry(
|
const wrap = mergeColoured([latheGeometry(
|
||||||
wrapProfile, 7, [0, 0, 0], tint('char', 0.06),
|
wrapProfile, 7, [0, 0, 0], tint('char', 0.06),
|
||||||
{ colourTop: tint('charHot', -0.12) },
|
{ colourTop: tint('charHot', -0.32) },
|
||||||
)])
|
)])
|
||||||
|
|
||||||
// --- Flame -----------------------------------------------------------
|
// --- Flame -----------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue