PartDesign: Fillet, Chamfer, Draft, Thickness : Enable tool to start with no selection.

This commit is contained in:
Paddle
2023-03-22 15:25:31 +01:00
parent 8ada7af302
commit 47cc265b4f
19 changed files with 288 additions and 497 deletions

View File

@@ -109,7 +109,8 @@ App::DocumentObjectExecReturn *Chamfer::execute()
Part::TopoShape TopShape;
try {
TopShape = getBaseShape();
} catch (Base::Exception& e) {
}
catch (Base::Exception& e) {
return new App::DocumentObjectExecReturn(e.what());
}
@@ -130,9 +131,6 @@ App::DocumentObjectExecReturn *Chamfer::execute()
getContinuousEdges(TopShape, SubNames, FaceNames);
if (SubNames.empty())
return new App::DocumentObjectExecReturn("No edges specified");
const int chamferType = ChamferType.getValue();
const double size = Size.getValue();
const double size2 = Size2.getValue();
@@ -145,6 +143,13 @@ App::DocumentObjectExecReturn *Chamfer::execute()
}
this->positionByBaseFeature();
//If no element is selected, then we use a copy of previous feature.
if (SubNames.empty()) {
this->Shape.setValue(TopShape);
return App::DocumentObject::StdReturn;
}
// create an untransformed copy of the basefeature shape
Part::TopoShape baseShape(TopShape);
baseShape.setTransform(Base::Matrix4D());