fix(evidence_v2): 将 annulus 降级为 analytic_contours 轮廓
同心圆截面改为输出外圆与内圆两条 analytic_contours 轮廓,避免旧 annulus 宏导致 CDSL 文档不符合 schema 且运行时无法执行
This commit is contained in:
@@ -412,7 +412,16 @@ def _analytic_profile(sketch: dict[str, Any]) -> dict[str, Any]:
|
||||
left, right = drawable
|
||||
if math.dist(left["center"], right["center"]) <= EPSILON_MM:
|
||||
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"]}
|
||||
# Annulus is emitted as analytic_contours (outer + inner) so the
|
||||
# generic runtime profile contract accepts the record; ring_revolve
|
||||
# can then revolve the two concentric circles into a hollow solid.
|
||||
return {
|
||||
"type": "analytic_contours",
|
||||
"contours": [
|
||||
{"role": "outer", "closed": True, "segments": [larger]},
|
||||
{"role": "inner", "closed": True, "segments": [smaller]},
|
||||
],
|
||||
}
|
||||
if drawable and all(item["type"] == "circle" 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
|
||||
|
||||
Reference in New Issue
Block a user