Skip to content

Commit

Permalink
+ fixes #1655: Pocket type UpToFirst and UpToFace doesn't produce exp…
Browse files Browse the repository at this point in the history
…ected results.
  • Loading branch information
wwmayer committed May 16, 2015
1 parent 78671cb commit a6436f7
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/Mod/PartDesign/App/FeaturePocket.cpp
Expand Up @@ -134,15 +134,21 @@ App::DocumentObjectExecReturn *Pocket::execute(void)
}
getUpToFace(upToFace, support, supportface, sketchshape, method, dir);

// Special treatment because often the created stand-alone prism is invalid (empty) because
// BRepFeat_MakePrism(..., 2, 1) is buggy
BRepFeat_MakePrism PrismMaker;
PrismMaker.Init(support, sketchshape, supportface, dir, 0, 1);
PrismMaker.Perform(upToFace);

if (!PrismMaker.IsDone())
return new App::DocumentObjectExecReturn("Pocket: Up to face: Could not extrude the sketch!");
TopoDS_Shape prism = PrismMaker.Shape();
// #0001655: When 'supportshape' consists of several faces BRepFeat_MakePrism uses only the first face.
// Thus, we have to iterate over the faces and use the algorithm for each of them.
TopoDS_Shape prism = support;
for (TopExp_Explorer xp(sketchshape, TopAbs_FACE); xp.More(); xp.Next()) {
// Special treatment because often the created stand-alone prism is invalid (empty) because
// BRepFeat_MakePrism(..., 2, 1) is buggy
BRepFeat_MakePrism PrismMaker;
PrismMaker.Init(prism, xp.Current(), supportface, dir, 0, 1);
PrismMaker.Perform(upToFace);

if (!PrismMaker.IsDone())
return new App::DocumentObjectExecReturn("Pocket: Up to face: Could not extrude the sketch!");
prism = PrismMaker.Shape();
}

prism = refineShapeIfActive(prism);

// And the really expensive way to get the SubShape...
Expand Down

0 comments on commit a6436f7

Please sign in to comment.