提交env

This commit is contained in:
2026-08-21 15:22:15 +08:00
parent 9d331cc37f
commit 91a443d990
7 changed files with 117 additions and 3 deletions
+12 -1
View File
@@ -28,6 +28,7 @@ from build123d import ( # noqa: E402
Mode,
Plane,
Polygon,
Sphere,
Vector,
Wire,
export_step,
@@ -49,6 +50,7 @@ SUPPORTED_ATOMIC_IDS = frozenset({
"hole_blind",
"hole_countersink",
"hole_counterbore",
"sphere_add",
})
@@ -265,7 +267,16 @@ def run_engine_plan(
sketch = step.get("sketch")
sid = step.get("step_id")
if atomic in ("extrude_add_blind", "extrude_add_two_sided", "extrude_cut_blind"):
if atomic == "sphere_add":
radius = _f(params.get("radius_mm") or 0)
center = params.get("center_mm") or [0, 0, 0]
if radius <= 0 or len(center) != 3:
raise ValueError(f"{sid}: sphere_add requires a positive radius_mm and center_mm")
with Locations((_f(center[0]), _f(center[1]), _f(center[2]))):
Sphere(radius, mode=Mode.ADD)
log.append(f"{sid}: sphere_add radius={radius}")
elif atomic in ("extrude_add_blind", "extrude_add_two_sided", "extrude_cut_blind"):
if sketch is None:
raise ValueError(f"{sid}: missing sketch")
plane = _plane_from_workplane(sketch.get("workplane") or {})