fixes #0002512 Allow multi-face part design tools
This commit is contained in:
@@ -131,8 +131,12 @@ App::DocumentObjectExecReturn *Revolution::execute(void)
|
||||
sketchshape.Move(invObjLoc);
|
||||
|
||||
// Check distance between sketchshape and axis - to avoid failures and crashes
|
||||
if (checkLineCrossesFace(gp_Lin(pnt, dir), TopoDS::Face(sketchshape)))
|
||||
return new App::DocumentObjectExecReturn("Revolve axis intersects the sketch");
|
||||
TopExp_Explorer xp;
|
||||
xp.Init(sketchshape, TopAbs_FACE);
|
||||
for (;xp.More(); xp.Next()) {
|
||||
if (checkLineCrossesFace(gp_Lin(pnt, dir), TopoDS::Face(xp.Current())))
|
||||
return new App::DocumentObjectExecReturn("Revolve axis intersects the sketch");
|
||||
}
|
||||
|
||||
// revolve the face to a solid
|
||||
BRepPrimAPI_MakeRevol RevolMaker(sketchshape, gp_Ax1(pnt, dir), angle);
|
||||
@@ -153,7 +157,7 @@ App::DocumentObjectExecReturn *Revolution::execute(void)
|
||||
result = refineShapeIfActive(result);
|
||||
}
|
||||
|
||||
this->Shape.setValue(result);
|
||||
this->Shape.setValue(getSolid(result));
|
||||
}
|
||||
else
|
||||
return new App::DocumentObjectExecReturn("Could not revolve the sketch!");
|
||||
@@ -164,7 +168,7 @@ App::DocumentObjectExecReturn *Revolution::execute(void)
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
if (std::string(e->GetMessageString()) == "TopoDS::Face")
|
||||
return new App::DocumentObjectExecReturn("Could not create face from sketch.\n"
|
||||
"Intersecting sketch entities or multiple faces in a sketch are not allowed.");
|
||||
"Intersecting sketch entities in a sketch are not allowed.");
|
||||
else
|
||||
return new App::DocumentObjectExecReturn(e->GetMessageString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user