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
@@ -454,8 +454,13 @@ void bind_part(py::module_& m) {
}
if (body.is_none() == bodies.is_none())
throw scad::TypeError("give exactly one of body (a Solid) or bodies (several named solids)");
if (!bodies.is_none()) {
return std::make_shared<Part>(text(part_id, "part_id"), body_list(bodies), optional_name(name),
if (!bodies.is_none() || is_pieces(body)) { // several bodies, or the pieces of a split cut
std::vector<Body> values;
if (bodies.is_none())
add_bodies(values, kDefaultBodyId, body);
else
values = body_list(bodies);
return std::make_shared<Part>(text(part_id, "part_id"), std::move(values), optional_name(name),
material_value, std::move(connector_values));
}
return std::make_shared<Part>(text(part_id, "part_id"), typed<Solid>(body, "body must be a Solid"),