fix(377 B07 전개도): 화면 검증 손질 — 돌 무늬가 박스 왼쪽을 넘던 흔들림 한도 · 콘크리트 · 쇄석 점 크기(화면 배율에서 안 보임) · 표 크게(그림 241 꼴) · 높이 · 폭 소수 둘째 자리 표기(면적이 쓴 값 그대로)

- 시험: 무늬는 박스 안(형태 다섯 · 견본 서른) · 확정본 kind development · 3.55 폭 표기

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Se7ytqbohmBQnfYpwYFnYf
This commit is contained in:
2026-10-17 15:20:34 +09:00
co-authored by Claude Opus 5.5
parent bb5f07eb0c
commit bbfe7ce27e
2 changed files with 61 additions and 9 deletions
@@ -51,9 +51,10 @@ _BELOW = 9.0 # 박스 아래 L= 자리
_GAP = 16.0 # 박스 사이(오른 끝 기울인 글 자리)
_MIN_H, _MAX_H = 12.0, 40.0 # 가장 높은 박스 세로 mm
_EMPTY_H = 0.6 # 높이 빈칸 박스 = 가장 높은 박스의 몫
_FONT, _TITLE_FONT = 2.2, 7.0
_ROW_H = 6.0
_COLUMNS = (44.0, 18.0, 18.0, 22.0)
_FONT, _TITLE_FONT = 2.5, 7.0
_TABLE_FONT = 3.2 # 표는 그림 241 처럼 크게(작도 영역 폭의 약 1/4)
_ROW_H = 9.0
_COLUMNS = (80.0, 32.0, 32.0, 40.0)
_SLANT = (0.5, math.sqrt(3) / 2) # 60°
@@ -61,6 +62,14 @@ def _fmt(value: float | None) -> str:
return "" if value is None else f"{value:,.1f}"
def _size(value: float | None) -> str:
"""높이 · 폭 — 소수 둘째 자리까지(3.55 · 3.5 · 2.0) · 면적이 쓴 값 그대로 보이게."""
if value is None:
return ""
text = f"{value:.2f}".rstrip("0")
return f"{text}0" if text.endswith(".") else text
# ── 무늬 ────────────────────────────────────────────────
@@ -89,7 +98,8 @@ def _stones(seed, rng, box, rows, cap=500):
while y <= y1 - 0.3 - r + 1e-9 and len(out) < cap:
x = x0 + 0.3 + r + (step / 2 if row % 2 else 0.0)
while x <= x1 - 0.3 - r + 1e-9 and len(out) < cap:
jx = min(rng.uniform(-0.15, 0.15) * step, x1 - 0.3 - r - x, x - x0 - 0.3 - r)
room = (x - x0 - 0.3 - r, x1 - 0.3 - r - x) # 왼 · 오 여유 — 돌이 박스를 안 넘게
jx = max(-room[0], min(rng.uniform(-0.15, 0.15) * step, room[1]))
line = polyline_entity(
seed, _stone(rng, x + jx, y, r), FILL_LAYER_ID, FILL_COLOR, f":s{len(out)}"
)
@@ -170,9 +180,9 @@ def fill_entities(seed: str, form: str, group: str, box: tuple[float, float, flo
"""형태 → 무늬(찰 작은 돌 · 메 큰 돌 · 콘크리트 · 쇄석 점 · 돌망태 격자+돌 · 통나무 원)."""
rng = random.Random(seed)
if group == "gravel":
return _dots(seed, rng, box, 0.12, 0.35, 900)
return _dots(seed, rng, box, 0.025, 0.9, 900)
if group == "concrete" or form == "콘크리트":
return _dots(seed, rng, box, 0.2, 0.15, 1200)
return _dots(seed, rng, box, 0.045, 0.6, 1200)
if form == "돌쌓기(찰)":
return _stones(seed, rng, box, 5)
if form == "돌쌓기(메)":
@@ -254,7 +264,7 @@ def _box_entities(drawing_id, index, row, box, label, station):
)
]
out += fill_entities(f"{seed}:{row['key']}", row["form"], row["group"], (x0, y0, x1, y1))
height = "미입력" if row["height_m"] is None else f"{row['height_m']:.1f}"
height = "미입력" if row["height_m"] is None else _size(row["height_m"])
for end, x, chainage in (("s", x0, row["start_m"]), ("e", x1, row["end_m"])):
out.append(
_line_entity(
@@ -318,7 +328,7 @@ def _table(drawing_id, lines, label, origin):
[
cell(item["station"]),
cell(_fmt(item["distance"]), "right", TABLE_VALUE_COLOR),
cell(_fmt(item["height"]), "right", TABLE_VALUE_COLOR),
cell(_size(item["height"]), "right", TABLE_VALUE_COLOR),
cell(_fmt(item["area"]), "right", TABLE_VALUE_COLOR),
]
)
@@ -339,7 +349,7 @@ def _table(drawing_id, lines, label, origin):
cells,
TABLE_LAYER_ID,
TABLE_COLOR,
_FONT,
_TABLE_FONT,
TABLE_LABEL_COLOR,
)