Fix the log pile's axis, and finish translating the repo
The pile was the model I had been told twice was wrong and had twice failed to find anything wrong with. A reference photograph of a real woodstack found it in one look: ours was five long sticks lying across each other, and the reference was forty short logs nested into courses. The cause was a single rotation. `latheGeometry` builds along Y, and the logs were turned with `rotateZ(PI/2)`, which sends +Y to -X -- so every log lay along the X axis. That is the same axis the layout spaces them along. Each log was 0.62 m long and its neighbour's centre was 0.13 m away, so every log ran through roughly five of its neighbours. `restingHeight` was right the whole time; it was solving tangency for an orientation the geometry did not actually have. Rotating about X instead sends +Y to +Z, which is the axis the solver assumes, and the pile immediately settles into courses that rest on each other. Nothing in the check suite could see this. Support saw one connected mass and passed it, which is exactly what a heap of interpenetrating logs looks like to a connectivity test. Two smaller things the same photograph showed. The file header claims the sawn ends are "far lighter than the bark" and that the pale discs are the first thing you see; at +0.07 lightness they were a slightly different brown, so the offset now delivers what the comment promises. And twelve logs read as some firewood rather than as a stack, so the default is denser. Also: .gitignore and .gitattributes were still entirely in Turkish. The earlier translation sweep matched on file extension and never looked at extensionless files. src/viewer.css tripped the scan too, but that was 80 occurrences of the CSS `var()` function, not Turkish. 27 models, 17393 triangles, all checks pass, 0 floating cases.
This commit is contained in:
parent
74068b13f5
commit
694c83f221
5 changed files with 88 additions and 50 deletions
|
|
@ -47,8 +47,11 @@ export interface LogPileConfig {
|
|||
}
|
||||
|
||||
export const logPileDefaults: LogPileConfig = {
|
||||
rows: 3,
|
||||
perRow: 5,
|
||||
// Denser than it was. Twelve logs read as "some firewood"; a stack is the
|
||||
// thing that makes a wall look lived-against, and that needs enough logs
|
||||
// for the ends to form a pattern rather than a row.
|
||||
rows: 4,
|
||||
perRow: 7,
|
||||
logLength: 0.62,
|
||||
logRadius: 0.065,
|
||||
variation: 0.22,
|
||||
|
|
@ -97,7 +100,11 @@ export function createModel(overrides: Partial<LogPileConfig> = {}) {
|
|||
}
|
||||
const endTint = (): Color => {
|
||||
tint.copy(MEDIEVAL_PALETTE.oakEnd)
|
||||
tint.offsetHSL(jitter(random, 0.012), jitter(random, 0.05), 0.07 + jitter(random, 0.05))
|
||||
// +0.07 did not deliver what the file header promises. A sawn end is
|
||||
// dramatically paler than bark -- in a reference photograph the pale
|
||||
// discs are the first thing the eye lands on -- and at this offset the
|
||||
// ends were merely a slightly different brown.
|
||||
tint.offsetHSL(jitter(random, 0.012), -0.06 + jitter(random, 0.04), 0.19 + jitter(random, 0.05))
|
||||
return tint
|
||||
}
|
||||
|
||||
|
|
@ -165,7 +172,17 @@ export function createModel(overrides: Partial<LogPileConfig> = {}) {
|
|||
const tilt = jitter(random, 0.04)
|
||||
for (const [target, geometry] of [[bark, body], [ends, capA], [ends, capB]] as const) {
|
||||
geometry.rotateY(roll)
|
||||
geometry.rotateZ(Math.PI / 2)
|
||||
// About X, NOT about Z.
|
||||
//
|
||||
// `latheGeometry` builds along Y. Rotating +90 degrees about Z
|
||||
// sends +Y to -X, so every log lay along the X axis -- which is
|
||||
// the very axis the layout spaces them along. Each log was 0.62 m
|
||||
// long and its neighbour's centre was 0.13 m away, so every log
|
||||
// ran straight through about five of its neighbours. The tangent
|
||||
// solve above was correct the whole time; it was solving for an
|
||||
// orientation the geometry did not have. Rotating about X sends
|
||||
// +Y to +Z, which is the axis `restingHeight` assumes.
|
||||
geometry.rotateX(Math.PI / 2)
|
||||
geometry.rotateY(tilt)
|
||||
geometry.translate(log.x, log.y, jitter(random, config.logLength * 0.015))
|
||||
target.push(geometry)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue