-// Copyright (C) 2020 CEA/DEN, EDF R&D
+// Copyright (C) 2020-2022 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
if (!theBaseWire || theFilletVertices.empty() || theRadius < 0.)
return;
+ myFailedVertices.clear();
// store all edges of a base wire as modified, because they will be rebuild by ShapeFix
for (GeomAPI_WireExplorer aWExp(theBaseWire->wire()); aWExp.more(); aWExp.next()) {
GeomShapePtr aCurrent = aWExp.current();
// create fillet builder
GEOMImpl_Fillet1d aFilletBuilder(anEdge1, anEdge2, aPlane->impl<gp_Pln>());
- if (!aFilletBuilder.Perform(theRadius))
- return; // fillet is failed, no way to continue
+ bool isOk = aFilletBuilder.Perform(theRadius);
+ TopoDS_Edge aFilletEdge;
+ if (isOk) {
+ GeomPointPtr aPoint = aVE->first->vertex()->point();
+ aFilletEdge = aFilletBuilder.Result(aPoint->impl<gp_Pnt>(), anEdge1, anEdge2);
+ isOk = !aFilletEdge.IsNull();
+ }
- GeomPointPtr aPoint = aVE->first->vertex()->point();
- TopoDS_Edge aFilletEdge = aFilletBuilder.Result(aPoint->impl<gp_Pnt>(), anEdge1, anEdge2);
+ if (!isOk) {
+ // something gone wrong and the fillet edge is not constructed,
+ // just store the failed vertex and continue
+ myFailedVertices.push_back(*aVIt);
+ continue;
+ }
// store modified shapes
myGenerated[aVE->first].push_back(convert(aFilletEdge));
aFixWire.ClosedWireMode() = aBaseWire->isClosed();
aFixWire.FixReorder();
aNewWire = aFixWire.WireAPIMake();
- if (aNewWire.IsNull())
+ if (aNewWire.IsNull()) {
+ myFailedVertices = theFilletVertices;
return;
+ }
// update the map of modified shapes, because the edges are changed by ShapeFix
for (BRepTools_WireExplorer anExp(aNewWire); anExp.More(); anExp.Next()) {
myModified[theBaseWire].push_back(aShape);
setShape(aShape);
- setDone(true);
+ setDone(myFailedVertices.empty());
}
void GeomAlgoAPI_Fillet1D::generated(const GeomShapePtr theOldShape,