X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_FaceBuilder.cpp;h=8e108ebfa01d4f3423bba3c23f8a617500c69d60;hb=84557d24d6c6b48998f319ffe3e16171bd89e0ab;hp=d03b76169da3c224762f41fcdb5057e3885333cb;hpb=36c83ebade90867a88f2e1c1b0989625e6d6a505;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.cpp index d03b76169..8e108ebfa 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.cpp @@ -38,19 +38,8 @@ std::shared_ptr GeomAlgoAPI_FaceBuilder::square( -theSize / 2., theSize / 2., -theSize / 2., theSize / 2.); std::shared_ptr aRes(new GeomAPI_Shape); - aRes->setImpl(new TopoDS_Shape(aFaceBuilder.Face())); - return aRes; -} - -std::shared_ptr GeomAlgoAPI_FaceBuilder::plane(std::shared_ptr theCenter, - std::shared_ptr theNormal) -{ - const gp_Pnt& aCenter = theCenter->impl(); - const gp_Dir& aDir = theNormal->impl(); - gp_Pln aPlane(aCenter, aDir); - BRepBuilderAPI_MakeFace aFaceBuilder(aPlane); - std::shared_ptr aRes(new GeomAPI_Shape); - aRes->setImpl(new TopoDS_Shape(aFaceBuilder.Face())); + TopoDS_Shape aFace = aFaceBuilder.Face(); + aRes->setImpl(new TopoDS_Shape(aFace/*aFaceBuilder.Face()*/)); return aRes; } @@ -78,10 +67,28 @@ std::shared_ptr GeomAlgoAPI_FaceBuilder::plane( gp_Pln aPln = isPlanar.Plan(); double aA, aB, aC, aD; aPln.Coefficients(aA, aB, aC, aD); + if (aFace.Orientation() == TopAbs_REVERSED) { + aA = -aA; + aB = -aB; + aC = -aC; + aD = -aD; + } aResult = std::shared_ptr(new GeomAPI_Pln(aA, aB, aC, aD)); return aResult; } +std::shared_ptr GeomAlgoAPI_FaceBuilder::planarFace(std::shared_ptr theCenter, + std::shared_ptr theNormal) +{ + const gp_Pnt& aCenter = theCenter->impl(); + const gp_Dir& aDir = theNormal->impl(); + gp_Pln aPlane(aCenter, aDir); + BRepBuilderAPI_MakeFace aFaceBuilder(aPlane); + std::shared_ptr aRes(new GeomAPI_Shape); + aRes->setImpl(new TopoDS_Shape(aFaceBuilder.Face())); + return aRes; +} + std::shared_ptr GeomAlgoAPI_FaceBuilder::planarFace(std::shared_ptr thePlane, double theX, double theY, double theWidth, double theHeight)