From: dbv Date: Tue, 5 Apr 2016 06:20:02 +0000 (+0300) Subject: #Issue 1343 Fixes for extrusion creation X-Git-Tag: V_2.3.0~304 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=65356429102bd54f8437a7921df2ddac5329e27c;p=modules%2Fshaper.git #Issue 1343 Fixes for extrusion creation --- 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;