feat(b07): 평면도 종류마다 축척 고르기 — 1/600 · 1/1,000 · 1/1,200 기본 · 유역도 1/6,000 고정(119-1)
- 종류 파일 scale(없거나 목록 밖이면 1200) · 추가 · 업데이트 인자 · 목록 밖 거절 - 장 나눔 · 도곽 범위 · 배경 절취 · 축척 글 · 도곽 칸 · IP 표 · 필지 라벨 · 측점 눈금 실거리 환산이 축척 따라감(함수 인자) - 「종류」 폼에 공용 「축척」 고르기 · 유역도 양식은 잠금 표시 - 시험 test_119_b07_plan_scale 새로 · test_b07_plan_kinds 종류 dict 에 scale Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPJGtfXo6GMbcpiboQC4uK
This commit is contained in:
@@ -87,13 +87,15 @@ def plan_area_mm() -> tuple[float, float]:
|
||||
return (width - (_COMPASS_MARGIN + _COMPASS_SIZE), height - _TITLE_BAND)
|
||||
|
||||
|
||||
def _chunk_span_m() -> tuple[float, float]:
|
||||
def _chunk_span_m(scale: int = DRAWING_SCALE_PLAN) -> tuple[float, float]:
|
||||
"""한 장이 담을 수 있는 실거리(m) — 도곽 지형 영역을 축척으로 되돌린 크기."""
|
||||
area_w, area_h = plan_area_mm()
|
||||
return (area_w * DRAWING_SCALE_PLAN / 1000.0, area_h * DRAWING_SCALE_PLAN / 1000.0)
|
||||
return (area_w * scale / 1000.0, area_h * scale / 1000.0)
|
||||
|
||||
|
||||
def plan_chunks(stations: list[tuple[float, float, float]]) -> list[dict[str, Any]]:
|
||||
def plan_chunks(
|
||||
stations: list[tuple[float, float, float]], scale: int = DRAWING_SCALE_PLAN
|
||||
) -> list[dict[str, Any]]:
|
||||
"""노선을 한 장에 들어가는 구간으로 나눈다. 각 항목: {number, start_m, end_m}.
|
||||
|
||||
입력은 종단 측점의 (누가거리 m, x, y)다 — **도면 목록과 도면 생성이 같은 자료**를
|
||||
@@ -107,7 +109,7 @@ def plan_chunks(stations: list[tuple[float, float, float]]) -> list[dict[str, An
|
||||
if len(ordered) < 2:
|
||||
span = (ordered[0][0] if ordered else 0.0, ordered[0][0] if ordered else 0.0)
|
||||
return [{"number": 1, "start_m": span[0], "end_m": span[1]}]
|
||||
span_w, span_h = _chunk_span_m()
|
||||
span_w, span_h = _chunk_span_m(scale)
|
||||
|
||||
def fits(part: list[tuple[float, float, float]]) -> bool:
|
||||
width = max(x for _c, x, _y in part) - min(x for _c, x, _y in part)
|
||||
|
||||
Reference in New Issue
Block a user