Screw conveyors join by the shared rule: low ends and verticals join in the corner block (t67 phase 2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
// Shared join grid: eight rows (UR/DR/DL/UL, left/right ends), nine columns.
|
||||
// Screw H and V, then belt H; each tries the side, above/below, and E.
|
||||
// Self-contained, paused and empty. Use --zoom 4 --viewport 2100x1500 --no-light.
|
||||
money = 50000;
|
||||
for (let y = 40; y < 420; y++) for (let x = 100; x < 560; x++) {
|
||||
const i = y * W + x;
|
||||
setCell(i, EMPTY, 20, 0); bgm[i] = 0;
|
||||
}
|
||||
for (let x = 100; x < 560; x++) surfY[x] = 420;
|
||||
window.JOIN_CASES = [];
|
||||
for (let row = 0; row < 8; row++) for (let col = 0; col < 9; col++) {
|
||||
const v = 4 + (row >> 1), end = row & 1, side = end ? 1 : -1;
|
||||
const slope = v === 4 || v === 6 ? -1 : 1, dy = side * slope;
|
||||
const vertical = col >= 3 && col < 6, belt = col >= 6, spot = col % 3;
|
||||
const bx = 34 + col * 12, by = 24 + row * 10;
|
||||
const nx = bx + (spot === 1 ? 0 : side), ny = by + (spot === 0 ? 0 : dy);
|
||||
const code = belt ? BP_BELT : BP_SCREW;
|
||||
const straight = belt ? (side > 0 ? 1 : 0) : vertical ? (dy < 0 ? 0 : 2) : (side > 0 ? 1 : 3);
|
||||
const diagonalCode = belt ? (slope < 0 ? BP_BELT_UP : BP_BELT_DOWN) : BP_SCREW;
|
||||
const diagonalV = belt ? (SCREW_DIRS[v][0] > 0 ? 1 : 0) : v;
|
||||
for (let k = 0; k < 2; k++) placeBlock(diagonalCode, diagonalV, bx - k * side, by - k * dy, true);
|
||||
for (let k = 0; k < 2; k++) placeBlock(code, straight, nx + (vertical ? 0 : k * side * (spot === 1 ? -1 : 1)), ny + (vertical ? k * dy * (spot === 0 ? -1 : 1) : 0), true);
|
||||
const joined = endJoin(bx, by, end) >= 0;
|
||||
const kind = joined ? (ny === by ? (end ? 2 : 4) : vertical ? 6 : 5) : 0;
|
||||
JOIN_CASES.push({v, end, bx, by, nx, ny, vertical, code, straight, joined, kind, spot});
|
||||
}
|
||||
updateRoof();
|
||||
window.CAM = [326, 232];
|
||||
// Labels are part of the scene so screenshots and browser checks use the same layout.
|
||||
drawBot = () => {
|
||||
const ctx = R.ctx;
|
||||
ctx.save(); ctx.font = '12px monospace'; ctx.textBaseline = 'bottom';
|
||||
for (const j of JOIN_CASES) {
|
||||
const p = worldToScreenPx(j.bx * BS - 8, j.by * BS - 14);
|
||||
ctx.fillStyle = '#17222c';
|
||||
const name = ['UR', 'DR', 'DL', 'UL'][j.v - 4], axis = j.code === BP_BELT ? 'belt' : j.vertical ? 'V' : 'H';
|
||||
ctx.fillText(`${name} ${j.end ? 'R' : 'L'} ${axis} ${['side', 'up/down', 'E'][j.spot]}: ${j.joined ? 'JOIN' : 'free'}`, p.x, p.y);
|
||||
}
|
||||
ctx.restore();
|
||||
};
|
||||
@@ -1,27 +0,0 @@
|
||||
// Self-contained grid. Rows: UR, DR, DL, UL. Each run shows both ends.
|
||||
// Columns: horizontal edge, horizontal corner, vertical edge, vertical corner.
|
||||
// Corner columns stay unconnected, with two separate ends.
|
||||
// Repeat those four with the straight travel reversed. Camera fits --zoom 6 --viewport 2100x1300.
|
||||
// Run after clear-sky.js or by itself. Empty, paused screws expose the whole casing.
|
||||
money = 50000;
|
||||
for (let y = 64; y < 280; y++) for (let x = 112; x < 456; x++) {
|
||||
const i = y * W + x;
|
||||
setCell(i, EMPTY, 20, 0); bgm[i] = 0;
|
||||
}
|
||||
for (let x = 112; x < 456; x++) surfY[x] = 280;
|
||||
window.T62_JOINTS = [];
|
||||
for (let row = 0; row < 4; row++) for (let col = 0; col < 8; col++) {
|
||||
const v = 4 + row, [dx, dy] = SCREW_DIRS[v], vertical = !!(col & 2), corner = !!(col & 1);
|
||||
const x = 33 + col * 10 + (dx < 0 ? 4 : 0), y = 23 + row * 12 + (dy < 0 ? 4 : 0);
|
||||
const sv = vertical ? (dy < 0 ? 0 : 2) : (dx > 0 ? 1 : 3), straight = col < 4 ? sv : (sv + 2) % 4;
|
||||
for (let k = 0; k < 3; k++) placeBlock(BP_SCREW, v, x + k * dx, y + k * dy, true);
|
||||
for (const end of [-1, 1]) {
|
||||
const ex = x + (end > 0 ? 2 * dx : 0), ey = y + (end > 0 ? 2 * dy : 0);
|
||||
const nx = ex + (vertical && !corner ? 0 : end * dx), ny = ey + (!vertical && !corner ? 0 : end * dy);
|
||||
for (let k = 0; k < 2; k++) placeBlock(BP_SCREW, straight, nx + (vertical ? 0 : k * end * dx), ny + (vertical ? k * end * dy : 0), true);
|
||||
T62_JOINTS.push({v, end, vertical, corner, straight, bx:ex, by:ey});
|
||||
}
|
||||
}
|
||||
updateRoof();
|
||||
window.CAM = [284, 168];
|
||||
drawBot = () => {};
|
||||
Reference in New Issue
Block a user