+ Add option to refine solid on sketch-based features

This commit is contained in:
wmayer
2013-09-21 09:16:44 +02:00
parent 3c55434939
commit 79e9f108e6
11 changed files with 70 additions and 9 deletions

View File

@@ -143,13 +143,15 @@ App::DocumentObjectExecReturn *Pocket::execute(void)
if (!PrismMaker.IsDone())
return new App::DocumentObjectExecReturn("Pocket: Up to face: Could not extrude the sketch!");
TopoDS_Shape prism = PrismMaker.Shape();
prism = refineShapeIfActive(prism);
// And the really expensive way to get the SubShape...
BRepAlgoAPI_Cut mkCut(support, prism);
if (!mkCut.IsDone())
return new App::DocumentObjectExecReturn("Pocket: Up to face: Could not get SubShape!");
// FIXME: In some cases this affects the Shape property: It is set to the same shape as the SubShape!!!!
this->SubShape.setValue(mkCut.Shape());
TopoDS_Shape result = refineShapeIfActive(mkCut.Shape());
this->SubShape.setValue(result);
this->Shape.setValue(prism);
} else {
TopoDS_Shape prism;
@@ -159,6 +161,7 @@ App::DocumentObjectExecReturn *Pocket::execute(void)
return new App::DocumentObjectExecReturn("Pocket: Resulting shape is empty");
// set the subtractive shape property for later usage in e.g. pattern
prism = refineShapeIfActive(prism);
this->SubShape.setValue(prism);
// Cut the SubShape out of the support
@@ -170,6 +173,7 @@ App::DocumentObjectExecReturn *Pocket::execute(void)
TopoDS_Shape solRes = this->getSolid(result);
if (solRes.IsNull())
return new App::DocumentObjectExecReturn("Pocket: Resulting shape is not a solid");
solRes = refineShapeIfActive(solRes);
remapSupportShape(solRes);
this->Shape.setValue(solRes);
}