From 01542223df41faf56ce549a789912595e9f1f3b1 Mon Sep 17 00:00:00 2001 From: dbv Date: Thu, 7 Apr 2016 18:38:24 +0300 Subject: [PATCH] Removed unused fields from pipe algo --- src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp index 0143ddc94..38b2eb57e 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -412,7 +413,26 @@ void GeomAlgoAPI_Revolution::build(const GeomShapePtr& theBaseSh } // Try to cut with base face. If it can not be done then keep result of cut with bounding plane. - TopoDS_Shape aModifiedBaseShape = aBaseShape; + TopoDS_Shape aModifiedBaseShape; + if(aShapeTypeToExp != TopAbs_FACE) { + ListOfShape aList; + GeomShapePtr aSh(new GeomAPI_Shape()); + aSh->setImpl(new TopoDS_Shape(aBaseShape)); + std::shared_ptr theCenter(new GeomAPI_Pnt(aBasePlane->Location().X(), + aBasePlane->Location().Y(), + aBasePlane->Location().Z())); + std::shared_ptr theNormal(new GeomAPI_Dir(aBasePlane->Axis().Direction().X(), + aBasePlane->Axis().Direction().Y(), + aBasePlane->Axis().Direction().Z())); + GeomShapePtr aPln = GeomAlgoAPI_FaceBuilder::planarFace(theCenter, theNormal); + + aList.push_back(aSh); + std::list > aBoundingPoints = GeomAlgoAPI_ShapeTools::getBoundingBox(aList); + + aSh = GeomAlgoAPI_ShapeTools::fitPlaneToBox(aPln, aBoundingPoints); + } else { + aModifiedBaseShape = aBaseShape; + } if(isFromFaceSet) { if(aModifiedBaseShape.ShapeType() == TopAbs_FACE) { aModifiedBaseShape.Orientation(TopAbs_REVERSED); -- 2.39.2