Merge remote-tracking branch 'origin/sub_desktop_1' into main_laptop_1

This commit is contained in:
2026-10-08 15:17:46 +09:00
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