Design tab: pick several solid edges and dress them in one feature

A solid edge could only be picked one at a time, and Fillet/Chamfer took
either that one edge or a whole face group. Rounding three chosen edges
meant three features, whose edge ids each resolve against a body the
previous one had already changed.

- Shift+click (or Ctrl+click) on an edge of the body already picked adds
  it to the selection, or removes it; the same modifiers that extend a
  sketch selection. The whole set is highlighted. A plain click replaces
  it, as before.
- Fillet/Chamfer dresses every picked edge in ONE feature at one size,
  all ids resolved against the same body. The card says "3 edges", the
  status line and the offer header name the count.
- CadFeature gains dressup_edges, appended at the end of the framed
  recipe, so existing projects load and rebuild unchanged. dressup_edge
  keeps the first edge, so an older build opening a newer project still
  dresses that edge instead of falling back to the face group.
- The MCP fillet/chamfer verbs take `edge` as one id or an array.

Tests: a fillet on the four picked top edges equals the Top face group
exactly; the list survives save/load; two opposite chamfers remove
exactly twice one; a missing id fails with a reason. The truncated-
recipe test accounts for the new tail field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QK4VgguuCAk2hZLWgcjJb9
This commit is contained in:
Claude committed 2026-09-30 08:34:33 +00:00
1 parent f4cdeb1706
commit 3c218591bc
13 files changed
+297 -42

No files matched your search

+30 -4
View File
@@ -928,6 +928,19 @@ int CadDocument::add_fillet(double radius, int edge_id, const std::string& name)
return int(features.size()) - 1;
}
int CadDocument::add_fillet(double radius, const std::vector<int>& edge_ids, const std::string& name)
{
if (edge_ids.size() == 1) return add_fillet(radius, edge_ids.front(), name);
CadFeature f;
f.type = CadFeatureType::Fillet;
f.name = name;
f.dressup_size = radius;
f.dressup_edges = edge_ids;
f.dressup_edge = edge_ids.empty() ? -1 : edge_ids.front();
features.push_back(f);
return int(features.size()) - 1;
}
int CadDocument::add_chamfer(double distance, FaceGroup faces, const std::string& name)
{
CadFeature f;
@@ -950,6 +963,19 @@ int CadDocument::add_chamfer(double distance, int edge_id, const std::string& na
return int(features.size()) - 1;
}
int CadDocument::add_chamfer(double distance, const std::vector<int>& edge_ids, const std::string& name)
{
if (edge_ids.size() == 1) return add_chamfer(distance, edge_ids.front(), name);
CadFeature f;
f.type = CadFeatureType::Chamfer;
f.name = name;
f.dressup_size = distance;
f.dressup_edges = edge_ids;
f.dressup_edge = edge_ids.empty() ? -1 : edge_ids.front();
features.push_back(f);
return int(features.size()) - 1;
}
int CadDocument::add_hole(double diameter, double depth, bool through,
double x, double y, const SketchPlane& plane,
const std::string& name)
@@ -2886,15 +2912,15 @@ void CadDocument::apply_feature(TopoDS_Shape& result, bool& have_body,
}
case CadFeatureType::Fillet:
if (!have_body) throw std::runtime_error("fillet needs a body");
if (f.dressup_edge >= 0)
result = GeometryEngine::apply_fillet(result, f.dressup_size, f.dressup_edge);
if (f.dressup_edge >= 0 || !f.dressup_edges.empty())
result = GeometryEngine::apply_fillet(result, f.dressup_size, f.dressup_edge_ids());
else
result = GeometryEngine::apply_fillet(result, f.dressup_size, f.face_group);
break;
case CadFeatureType::Chamfer:
if (!have_body) throw std::runtime_error("chamfer needs a body");
if (f.dressup_edge >= 0)
result = GeometryEngine::apply_chamfer(result, f.dressup_size, f.dressup_edge);
if (f.dressup_edge >= 0 || !f.dressup_edges.empty())
result = GeometryEngine::apply_chamfer(result, f.dressup_size, f.dressup_edge_ids());
else
result = GeometryEngine::apply_chamfer(result, f.dressup_size, f.face_group);
break;