Files
VoxelForge/Standalone/Research/WorldAssemblerM3/Linux32/FindMeshTileWindowL32.py
T
Fr0zkaandClaude Opus 5.5 d0158c6019 wip(assembler): round L32 -- smooth Gradient interface at full amplitude (no rings, not flat)
Band faces now use signed distance to the displaced solid intervals, continuous across bands, so
MC interpolates the interface instead of terracing at density levels. The Gradient amplitude is
restored to width/8 (about 4 m peak-to-peak at 16 m). Ring/terrace audit at LOD0-8 on the FI floor and SW
ceiling passes; negative controls: L30 (rings) and L31 (flat) both fail. Hole/interface audits,
16 passage rows and 24/24 determinism pass. Evaluator 20. Cost vs L31 SW +1.9%, FI +1.5%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CSFYgsdW8ejZSyiMf4qRSX
2026-10-21 20:27:29 +02:00

49 lines
2.1 KiB
Python

#!/usr/bin/env python3
"""Find VFMSH tiles intersecting a small region without reading mesh payloads."""
import argparse
import glob
import os
import resource
import struct
def main():
parser = argparse.ArgumentParser()
parser.add_argument("directory")
parser.add_argument("--lod", type=int, required=True)
parser.add_argument("--bounds", nargs=6, type=float, required=True,
metavar=("XMIN", "XMAX", "YMIN", "YMAX", "ZMIN", "ZMAX"))
args = parser.parse_args()
xmin, xmax, ymin, ymax, zmin, zmax = args.bounds
matches = 0
for path in sorted(glob.glob(os.path.join(args.directory, "*.vfmesh"))):
with open(path, "rb") as stream:
if stream.read(8) != b"VFMSH001":
continue
version, voxel_um, tile_count = struct.unpack("<3I", stream.read(12))
stream.seek(40, 1)
if version != 1:
continue
for _ in range(tile_count):
key = struct.unpack("<4i", stream.read(16))
surface_count, _, vertex_count, index_count, mask_count = struct.unpack(
"<5I", stream.read(20))
extent = 32.0 * (1 << key[3]) * voxel_um / 1_000_000.0
x0, y0, z0 = (key[axis] * extent for axis in range(3))
intersects = (key[3] == args.lod and index_count > 0
and x0 <= xmax and x0 + extent >= xmin
and y0 <= ymax and y0 + extent >= ymin
and z0 <= zmax and z0 + extent >= zmin)
if intersects:
matches += 1
print(f"[VFMeshTileWindow] scene={os.path.basename(path)} key={key} "
f"vertices={vertex_count} indices={index_count} "
f"extent_m={extent:.3f}")
stream.seek(vertex_count * 24 + index_count * 4 + mask_count, 1)
print(f"[VFMeshTileWindowSummary] matching_tiles={matches} "
f"peak_rss_kib={resource.getrusage(resource.RUSAGE_SELF).ru_maxrss}")
if __name__ == "__main__":
main()