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 1689c99930
commit bc22bf9c0d
19 changed files with 288 additions and 497 deletions

View File

@@ -68,7 +68,8 @@ App::DocumentObjectExecReturn *Fillet::execute()
Part::TopoShape TopShape;
try {
TopShape = getBaseShape();
} catch (Base::Exception& e) {
}
catch (Base::Exception& e) {
return new App::DocumentObjectExecReturn(e.what());
}
std::vector<std::string> SubNames = std::vector<std::string>(Base.getSubValues());
@@ -86,9 +87,6 @@ App::DocumentObjectExecReturn *Fillet::execute()
getContinuousEdges(TopShape, SubNames);
if (SubNames.empty())
return new App::DocumentObjectExecReturn("Fillet not possible on selected shapes");
double radius = Radius.getValue();
if(radius <= 0)
@@ -96,6 +94,12 @@ App::DocumentObjectExecReturn *Fillet::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 base shape
Part::TopoShape baseShape(TopShape);
baseShape.setTransform(Base::Matrix4D());