feat(product): owner decisions on multi-body parts

- A cut that splits the body is no longer refused: cut_rsolid(on_split="pieces")
  (the default) returns every piece as list[Solid] ordered by centroid, recorded as
  make_cut_rsolid_list with piece_order=centroid and replayed in that order;
  on_split="error" keeps the strict contract. One-piece cuts are unchanged.
- Pieces become bodies: make_part_rpart(body=pieces) -> body_1..n,
  bodies={"bar": pieces} -> bar_1..n.
- Overlapping bodies are allowed and warned: inspect_body_overlaps_rlist and a
  BodyOverlapWarning when the definition is built.
- Multi-body definitions use profile simplecad-part-definition-3 (new schema);
  profile 2 is back to its dev bytes, so profile-2 readers refuse them.
- part_from_bodies: the implicit-Part rule (all open bodies, named by variable).
- Skill pages, API docs, stubs, design doc section 9, SDK defect 24.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
NiJingzhe
2026-11-04 04:46:26 +08:00
parent 7a590477a3
commit 9778a8e0a9
41 changed files with 727 additions and 86 deletions
+11 -2
View File
@@ -520,12 +520,21 @@ void bind_booleans(py::module_& m) {
m.def(
"cut_rsolid",
[](const py::args& solids, bool skip_non_intersecting, const py::object& tracking_policy) {
[](const py::args& solids, bool skip_non_intersecting, const py::object& tracking_policy,
const std::string& on_split) -> py::object {
const std::vector<Solid> operands = flattened(solids, "cut_rsolid");
const CutOptions options{skip_non_intersecting, policy_text(tracking_policy)};
return unlocked(false, [&] { return cut_rsolid(operands, options); });
if (on_split == "error")
return py::cast(unlocked(false, [&] { return cut_rsolid(operands, options); }));
if (on_split != "pieces")
throw scad::ValueError("on_split must be 'pieces' or 'error'");
CutOutcome outcome = unlocked(false, [&] { return cut_rsolid_keep_split(operands, options); });
if (outcome.solid)
return py::cast(*outcome.solid);
return solids_to_py(outcome.pieces); // the cut split the body: every piece, ordered by centroid
},
py::kw_only(), py::arg("skip_non_intersecting") = true, py::arg("tracking_policy") = "full",
py::arg("on_split") = "pieces",
"Compute the boolean difference of solids: the first is the base, the rest are subtracted in order.");
m.def(