Surface: [skip ci] only try to build surface if at least two boundary curves are used

This commit is contained in:
wmayer
2021-10-21 18:23:03 +02:00
parent 796efc4c6b
commit ee311b0835

View File

@@ -298,6 +298,7 @@ App::DocumentObjectExecReturn *Filling::execute(void)
}
// Add the constraints of border curves/faces (bound)
int numBoundaries = BoundaryEdges.getSize();
addConstraints(builder, BoundaryEdges, BoundaryFaces, BoundaryOrder, Standard_True);
// Add additional edge constraints if available (unbound)
@@ -316,7 +317,8 @@ App::DocumentObjectExecReturn *Filling::execute(void)
}
//Build the face
builder.Build();
if (numBoundaries > 1)
builder.Build();
if (!builder.IsDone()) {
Standard_Failure::Raise("Failed to create a face from constraints");
}
@@ -327,7 +329,6 @@ App::DocumentObjectExecReturn *Filling::execute(void)
return App::DocumentObject::StdReturn;
}
catch (Standard_Failure& e) {
return new App::DocumentObjectExecReturn(e.GetMessageString());
}
}