clone

an endless marble-race generator in the browser; the url is the seed, so every track can be shared

Island wedge law, third pass: flush-or-open — every side must be level or a full-course drop

Dami committed dd34551
The flank rule still admitted wedges beside HALF-course steps (island
columns differ by the kit's 0.5/0.25 quarter blocks), which grew
staircases of exposed triangle profiles along terraced shoulders, and
let diagonals sit above part-lowered backs. The law is now binary per
side: FLUSH (neighbor top at own level or higher, <=0.01) or OPEN
(clean full-course drop, >=0.99); any in-between step disqualifies the
cell. A slope needs exactly one open side; a diagonal exactly two
adjacent opens with the between-corner open. Everything else keeps the
cube.
commit
dd345514c73296302c425a8f5ef1b1abfb375b87
parent
fcd127de7b1d89e7160e36fc0696d44650170f93
author
Dami <dami.etoile@gmail.com>
1 file changed, +15 -24
Msrc/gen/endless/islands.ts39++++++++++++------------------
M src/gen/endless/islands.ts +15 -24
@@ -352,35 +352,26 @@ export function buildIsland(
352352 // Waterfall column: waterfallTop at the crest, waterfall faces below.353353 const isFall = k === waterfallCell && open.length > 0;354354 // Shoulder trim on plain edge tops (never on the waterfall). WFC355- // wedge laws (USER RULE: triangles must never read jagged):356- // 1. HIGH side closed — no wedge on opposite-open ridges (its high357- // edge would float);358- // 2. SIDE faces flanked at the wedge's own level (side neighbor top359- // within a course, or higher) — a wedge beside a lower terrace or360- // the void shows its bare triangular profile, and terraced rims361- // become staircases of spikes.362- // A corner diagonal satisfies law 2 by construction: its two side363- // dirs are exactly the closed backs.355+ // wedge law (USER RULE: triangles must never read jagged): every side356+ // of a wedge must be either FLUSH (neighbor top at the wedge's own357+ // level or higher) or fully OPEN (a clean full-course drop). Any358+ // in-between step — the kit's 0.5/0.25 half courses — disqualifies359+ // the cell: half-step terraces otherwise grow staircases of exposed360+ // triangle profiles. A slope then needs exactly ONE open side; a361+ // diagonal cut exactly two ADJACENT open sides with the corner362+ // between them open too (else the cut face jams into that corner).363+ const flush = DIRS.every(([dx, dz]) => {364+ const d = dropAt(c, dx, dz);365+ return d <= 0.01 || d >= 0.99;366+ });364367 const adjacentOpen = open.length === 2 &&365368 open[0][0] !== open[1][0] && open[0][1] !== open[1][1];366369 const dirs = open.map(([dx, dz]) => dirOf(dx, dz));367370 const corner = adjacentOpen &&368371 dropAt(c, open[0][0] + open[1][0], open[0][1] + open[1][1]) >= 0.99;369- const slopeDir = open.length === 0370- ? -1371- : open.length === 1372- ? dirs[0]373- : dropAt(c, open[1][0], open[1][1]) > dropAt(c, open[0][0], open[0][1])374- ? dirs[1]375- : dirs[0];376- const flanked = slopeDir >= 0 &&377- dropAt(c, DIRS[(slopeDir + 1) % 4][0], DIRS[(slopeDir + 1) % 4][1]) <378- 0.99 &&379- dropAt(c, DIRS[(slopeDir + 3) % 4][0], DIRS[(slopeDir + 3) % 4][1]) <380- 0.99;381372 const trim = trimIsland && !isFall && !c.onRun && c.dist >= 1 &&382- c.depth >= 1 &&383- (corner || (open.length === 1 && flanked));373+ c.depth >= 1 && flush &&374+ (corner || open.length === 1);384375 385376 // One face per waterfall column — water can't zigzag around the386377 // corner course to course (the old per-course re-pick did).
@@ -423,7 +414,7 @@ export function buildIsland(
423414 ? diagRot(424415 dirs.includes((dirs[0] + 1) % 4) ? dirs[0] : dirs[1],425416 )426- : slopeRot(slopeDir),417+ : slopeRot(dirs[0]),427418 role: "support",428419 });429420 shaped.add(k);