fix(B07): DXF·DWG 불러오기 작은 원·호 뭉개짐 고침 — 곡선 토막마다 8마디 이상 · 부분 타원 닫는 줄 없앰(99-3)

- 원인: 펴기 허용오차 0.2 고정 — m 단위 도면(중력식 사방댐 시트 폭 약 80)에서 반지름 0.071 원이 길이 0 선 1개 · 0.15~0.2 원이 삼각형 · 0.36~0.46 호가 직선 한 마디
- 고침: 원·호·타원·스플라인·bulge 폴리선 모두 ezdxf 경로로 펴고 90° 이하 토막마다 8마디 이상
- 원본 DWG 대조: 원 42 · 호 16 오차 반지름의 0.5% 이하 · 호 16 모두 원래 각 범위 안(큰 호로 뒤집힘 0) · 불러오기 1.45 s · 도형 1,959
- 시험: test_b07_frame_import_shapes 작은 원·호 시험 하나 더함

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015KYZ2HWWdUwZWYnn3tQz7X
This commit is contained in:
2026-10-08 15:16:40 +09:00
co-authored by Claude Opus 5.5
parent 1849a11b33
commit 008558d4ee
2 changed files with 39 additions and 7 deletions
@@ -133,3 +133,24 @@ def test_내보내기_시계방향_작은_호(tmp_path):
(out,) = ezdxf.readfile(path).modelspace().query("ARC")
span = (out.dxf.end_angle - out.dxf.start_angle) % 360
assert math.isclose(span, 90) and math.isclose(out.dxf.start_angle % 360, 0, abs_tol=1e-9)
def test_작은_원_호는_뭉개지지_않음():
"""m 단위 도면(99-3 중력식사방댐) — 반지름 0.071 원 · 0.36 호 · bulge 0.4 폭 반원이 점 · 직선이 되지 않음."""
doc = ezdxf.new()
space = doc.modelspace()
space.add_circle((0, 0), 0.071)
space.add_arc((5, 0), 0.361, 10, 96)
space.add_lwpolyline([(10, 0, 0, 0, 1), (10.4, 0)], format="xyseb")
circle, arc, half = _read(doc)
circle_points = _points(circle)
assert len(circle_points) >= 33 and circle_points[0] == circle_points[-1]
assert _on_circle(circle_points, 0, 0, 0.071)
assert max(x for x, _y in circle_points) > 0.07 and min(x for x, _y in circle_points) < -0.07
arc_points = _points(arc)
assert len(arc_points) >= 9
for x, y in arc_points: # 10°~96° 안 · 큰 호로 뒤집히지 않음
assert abs(math.hypot(x - 5, y) - 0.361) < 0.003
assert 10 - 0.01 <= math.degrees(math.atan2(y, x - 5)) <= 96 + 0.01
half_points = _points(half)
assert len(half_points) >= 9 and min(y for _x, y in half_points) < -0.19