detect_sheet_frames: axis ticks vote like grid lines; expanded axis window
Two vote-killers found on 13号地块 towers: axis geometry sits OUTSIDE the wall-tight clip (stubs beyond the facade), and min_grid_len = pitch*0.25 discarded 0.8m axis-number ticks outright. Axis candidates are now collected in a pitch*0.16-expanded window, and strictly axis-parallel stubs (pitch*0.004..0.05) count alongside full-span lines — same-position ticks cluster into one vote. Synthetic tick fixture goes WEAK -> full votes. Honest finding logged: the 13号 tower frames genuinely contain NO axis geometry (all 249 ticks belong to other frames), so votes=0 is the correct verdict there — modeling proceeds via clip-corner fallback plus mandatory per-floor overlay verification; wall-position correlation noted as the future alignment source when axes are absent. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -349,13 +349,22 @@ def main() -> int:
|
||||
if clip is None:
|
||||
clip = rough
|
||||
notes.append(f"{t['name']}: no wall/roof geometry in rough clip; using pitch-based clip")
|
||||
axes = segments_in(lines, clip, axis_layers)
|
||||
# Axis geometry lives OUTSIDE the wall-tight clip (axis-number stubs sit
|
||||
# beyond the facade), so collect grid candidates in an expanded window.
|
||||
axis_margin = pitch * 0.16
|
||||
axis_clip = [clip[0] - axis_margin, clip[1] - axis_margin, clip[2] + axis_margin, clip[3] + axis_margin]
|
||||
axes = segments_in(lines, axis_clip, axis_layers)
|
||||
min_grid_len = pitch * 0.25
|
||||
# Some sets (13号地块) draw NO through grid lines at all — only ~0.8m
|
||||
# axis ticks. A tick's position still fingerprints the grid, so accept
|
||||
# short strictly-axis-parallel stubs alongside full-span lines.
|
||||
tick_min, tick_max = pitch * 0.004, pitch * 0.05
|
||||
vert, horiz = [], []
|
||||
for sx, sy, ex, ey in axes:
|
||||
if abs(ex - sx) < 2.0 and abs(ey - sy) > min_grid_len:
|
||||
dx, dy = abs(ex - sx), abs(ey - sy)
|
||||
if dx < 2.0 and (dy > min_grid_len or tick_min < dy < tick_max):
|
||||
vert.append((sx + ex) / 2)
|
||||
elif abs(ey - sy) < 2.0 and abs(ex - sx) > min_grid_len:
|
||||
elif dy < 2.0 and (dx > min_grid_len or tick_min < dx < tick_max):
|
||||
horiz.append((sy + ey) / 2)
|
||||
floors.append({
|
||||
"key": floor_key_for(t["name"], used_keys),
|
||||
|
||||
Reference in New Issue
Block a user