fix(B07): 횡단면도 박스를 단면마다 자기 그림 + 1 mm 로 — 칸 통일 없앰

- 장 배치: 칸을 그 장 가장 큰 블록으로 통일하던 것을 없애고 블록을 자기 크기로 열마다 쌓음(좌하단부터 아래→위, 차면 오른쪽 열)
- 그리는 가로 범위를 선이 있는 데까지로 — 원지반 자료가 짧으면 빈 여유가 박스를 밀던 것
- 블록 크기에 암 경계선 포함(실제 그림과 같은 규칙)
- 옛 배치로 확정된 장은 저장본을 그대로 보이되 [수정] 안내 알림
- 검증_sub4: 박스 ↔ 그림 66개 모두 1.0 mm · 같은 조건 27장 → 20장

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013rJwJMVL4EE31y77TB11AP
This commit is contained in:
2026-10-06 23:11:14 +09:00
co-authored by Claude Opus 5.5
parent d42efb162b
commit 67bba96227
6 changed files with 196 additions and 70 deletions
+10 -14
View File
@@ -450,6 +450,10 @@ def _section_window(
if left is None or right is None:
xs = [x for x, _y in ground] or [-6.0, 6.0]
left, right = min(xs), max(xs)
# 여유는 선이 있는 데까지만 — 원지반 자료가 짧으면 빈 여유가 테두리를 밀어낸다(68-1).
drawn = [x for x, _y in ground] + [x for x, _y in design]
if drawn:
return (max(left - margin_m, min(drawn)), min(right + margin_m, max(drawn)))
return (left - margin_m, right + margin_m)
@@ -483,7 +487,6 @@ def build_cross_drawing(
design_elevation_m: float | None = None,
frame: dict[str, float] | None = None,
origin: tuple[float, float] = (0.0, 0.0),
cell_frame: tuple[float, float, float, float] | None = None,
) -> dict[str, Any]:
"""횡단도 한 장을 지표/설계/구조물(+암 경계) 레이어 + CAD 수량 산출표로 만든다.
@@ -491,10 +494,6 @@ def build_cross_drawing(
설계선·구조물이 원지반과 갈라지는 구간 + 여유다. 세로는 이 단면 선들의
bbox 중심을 0에 둔다(측점마다 화면 중앙 정렬). design_elevation_m는 현재
배치에 쓰지 않지만 향후 표고 주석용으로 시그니처를 유지한다.
cell_frame(왼쪽, 아래, 오른쪽, 위 — 종이 mm)을 주면 테두리를 그 칸에 맞춰
그린다. 장 배치에서 한 장 안의 칸을 같은 크기로 통일할 때 쓴다(2026-09-04
사용자 확정 — 축척 1/100은 그대로, 칸만 통일).
"""
ox, oy = origin
raw_ground = points_from_samples(source.get("samples", []), "offset_m")
@@ -556,15 +555,12 @@ def build_cross_drawing(
)
table_bottom = table_top - cross_table_height()
# 외곽 테두리: 단면 범위와 표를 함께 감싼다. 칸 크기를 받았으면 그 칸에 맞춘다.
if cell_frame is not None:
frame_left, frame_bottom, frame_right, frame_top = cell_frame
else:
pad = CROSS_BORDER_PAD_MM
frame_x = max((x1 - x0) / 2.0 * CROSS_MM + pad, cross_table_width() / 2.0 + pad)
frame_left, frame_right = center_x - frame_x, center_x + frame_x
frame_top = oy + half_height + pad
frame_bottom = table_bottom - pad
# 외곽 테두리: 단면 범위와 표를 함께 감싸고 1 mm 띄운다.
pad = CROSS_BORDER_PAD_MM
frame_x = max((x1 - x0) / 2.0 * CROSS_MM + pad, cross_table_width() / 2.0 + pad)
frame_left, frame_right = center_x - frame_x, center_x + frame_x
frame_top = oy + half_height + pad
frame_bottom = table_bottom - pad
corners = [
(frame_left, frame_bottom),
(frame_right, frame_bottom),