auto: 2026-10-26 04:27 (ESD_LAPTOP)
This commit is contained in:
@@ -84,9 +84,10 @@ export function cutCells(
|
||||
const x = grid.x0 + (index % grid.nx) * grid.dx;
|
||||
const y = grid.y0 + Math.floor(index / grid.nx) * grid.dx;
|
||||
const slip = slipHeight(best, x, y);
|
||||
if (slip === null) return;
|
||||
const base = Math.max(slip, floor.get(index) ?? -Infinity);
|
||||
if (base < top) out.set(index, base);
|
||||
const base = Math.max(slip ?? top, floor.get(index) ?? -Infinity);
|
||||
// 엔진 덩이 셀 = 그대로(셀 안 일부만 잘린 가장자리 = 두께 0) · 옛 저장본 = 셀 중심이 잘린 칸만
|
||||
if (mass) out.set(index, Math.min(base, top));
|
||||
else if (base < top) out.set(index, base);
|
||||
});
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@ writeFileSync(process.argv[3], JSON.stringify({
|
||||
ellipsoid: mesh(M.slipMesh(c.grid, c.z, c.ellipsoid)),
|
||||
cut: Array.from(M.cutCells(c.grid, c.z, c.sphere).keys()),
|
||||
massCut: Array.from(M.cutCells(c.grid, c.z, { ...c.sphere, cells: [7 * 21 + 10, 7 * 21 + 11, 0] }).keys()),
|
||||
massBase0: M.cutCells(c.grid, c.z, { ...c.sphere, cells: [0] }).get(0),
|
||||
center: M.footprintCenter(c.grid, M.cutCells(c.grid, c.z, c.sphere), c.sphere),
|
||||
centerEmpty: M.footprintCenter(c.grid, new Map(), c.sphere),
|
||||
floored: Object.fromEntries(M.cutCells(c.grid, c.z,
|
||||
@@ -208,7 +209,8 @@ def test_terrain_hole_matches_cut(ts):
|
||||
"""활동체를 걷어낸 지표 = 지표 꼭짓점 − 잘린 셀 · 구멍 테두리는 활동면 메쉬와 같은 꼭짓점."""
|
||||
cut = [i for i, _ in _py_cut(SPHERE)]
|
||||
assert ts["cut"] == cut
|
||||
assert ts["massCut"] == [7 * 21 + 10, 7 * 21 + 11] # 엔진 덩이 셀만 · 안 잘린 셀(0)은 빠짐
|
||||
assert ts["massCut"] == [0, 7 * 21 + 10, 7 * 21 + 11] # 엔진 덩이 셀 그대로(0 = 안 잘림 · 두께 0)
|
||||
assert ts["massBase0"] == Z[0]
|
||||
assert ts["holed"]["n"] == ts["terrain"]["n"] - len(cut)
|
||||
assert not set(ts["holed"]["cells"]) & set(cut)
|
||||
assert _py_rim(set(cut)) <= set(ts["holed"]["cells"])
|
||||
|
||||
Reference in New Issue
Block a user