From 3805ce7393a1a7cc98ebb9f664a60647d5dc4c1a Mon Sep 17 00:00:00 2001 From: dbv Date: Tue, 5 Apr 2016 09:20:02 +0300 Subject: [PATCH] #Issue 1343 Fixes for extrusion creation --- src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp index 9ec5b2738..b971c401a 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp @@ -91,13 +91,12 @@ void GeomAlgoAPI_Prism::build(const GeomShapePtr& theBaseShape, std::shared_ptr aBaseLoc; std::shared_ptr aBaseDir; GeomShapePtr aBasePlane; - if(theDirection.get()) { - aDirVec = theDirection->impl(); - } else { - BRepBuilderAPI_FindPlane aFindPlane(aBaseShape); - if(aBaseShape.ShapeType() == TopAbs_VERTEX || - aBaseShape.ShapeType() == TopAbs_EDGE || - aFindPlane.Found() != Standard_True) { + const bool isBoundingShapesSet = theFromShape.get() || theToShape.get(); + BRepBuilderAPI_FindPlane aFindPlane(aBaseShape); + if(aBaseShape.ShapeType() == TopAbs_VERTEX || aBaseShape.ShapeType() == TopAbs_EDGE || + aFindPlane.Found() != Standard_True) { + // Direction and both bounding planes should be set or empty. + if(!theDirection.get() || (isBoundingShapesSet && (!theToShape.get() || !theFromShape.get()))) { return; } @@ -110,19 +109,7 @@ void GeomAlgoAPI_Prism::build(const GeomShapePtr& theBaseShape, aBasePlane = GeomAlgoAPI_FaceBuilder::planarFace(aBaseLoc, aBaseDir); } - //std::shared_ptr aBaseFace; - //if(theBaseShape->shapeType() == GeomAPI_Shape::FACE) { - // aBaseFace = std::shared_ptr(new GeomAPI_Face(theBaseShape)); - //} else if(theBaseShape->shapeType() == GeomAPI_Shape::SHELL){ - // GeomAPI_ShapeExplorer anExp(theBaseShape, GeomAPI_Shape::FACE); - // if(anExp.more()) { - // GeomShapePtr aFaceOnShell = anExp.current(); - // aBaseFace = std::shared_ptr(new GeomAPI_Face(aFaceOnShell)); - // } - //} - TopoDS_Shape aResult; - bool isBoundingShapesSet = theFromShape || theToShape; if(!isBoundingShapesSet) { // Moving base shape. gp_Trsf aTrsf; -- 2.39.2