fix(engine): 支持显式坐标选择器的阵列变换 #4

Merged
likang merged 13 commits from ganjihong into main 2026-08-27 19:00:04 +08:00
Showing only changes of commit 98d208ae5d - Show all commits
+10 -1
View File
@@ -414,7 +414,16 @@ def _analytic_profile(sketch: dict[str, Any]) -> dict[str, Any]:
smaller, larger = sorted(drawable, key=lambda item: item["radius_mm"])
return {"type": "annulus", "center": larger["center"], "inner_radius_mm": smaller["radius_mm"], "outer_radius_mm": larger["radius_mm"]}
if drawable and all(item["type"] == "circle" for item in drawable):
return {"type": "circles", "items": [{"center": item["center"], "radius_mm": item["radius_mm"]} for item in drawable]}
# Multiple independent circles share the "extrude every closed loop" intent;
# emit them as analytic_contours (one outer contour per circle) so the
# generic runtime profile contract accepts the record.
return {
"type": "analytic_contours",
"contours": [
{"role": "outer", "closed": True, "segments": [item]}
for item in drawable
],
}
contours = _chain_segments(drawable)
areas = [_contour_area(contour) for contour in contours]