From: dbv Date: Thu, 3 Sep 2015 12:39:05 +0000 (+0300) Subject: Fix for extrusion creation X-Git-Tag: V_1.4.0_beta4~134 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d41db14ddc7990cc69456ff9d3d2e59a99777ae9;p=modules%2Fshaper.git Fix for extrusion creation --- diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp index 36c644f39..8c142cb3a 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp @@ -33,6 +33,8 @@ #include #include #include +#include +#include #include #include #include @@ -175,20 +177,19 @@ void GeomAlgoAPI_Prism::build(const std::shared_ptr& theBasis, } // Project points to bounding planes. Search max distance to them. - const TopoDS_Shape& aBndToShape = aBoundingToShape->impl(); - const TopoDS_Shape& aBndFromShape = aBoundingFromShape->impl(); + IntAna_Quadric aBndToQuadric(gp_Pln(aToPnt->impl(), aToDir->impl())); + IntAna_Quadric aBndFromQuadric(gp_Pln(aFromPnt->impl(), aFromDir->impl())); Standard_Real aMaxToDist = 0, aMaxFromDist = 0; gp_Vec aNormal(aBaseDir->impl()); for(int i = 0; i < 8; i++) { gp_Lin aLine(aPoints[i], aNormal); - TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge(aLine).Edge(); - BRepExtrema_ExtCF aToExt(anEdge, TopoDS::Face(aBndToShape)); - BRepExtrema_ExtCF aFromExt(anEdge, TopoDS::Face(aBndFromShape)); - if(aToExt.NbExt() == 0 || aFromExt.NbExt() == 0) { + IntAna_IntConicQuad aToIntAna(aLine, aBndToQuadric); + IntAna_IntConicQuad aFromIntAna(aLine, aBndFromQuadric); + if(aToIntAna.NbPoints() == 0 || aFromIntAna.NbPoints() == 0) { return; } - const gp_Pnt& aPntOnToFace = aToExt.PointOnFace(1); - const gp_Pnt& aPntOnFromFace = aFromExt.PointOnFace(1); + const gp_Pnt& aPntOnToFace = aToIntAna.Point(1); + const gp_Pnt& aPntOnFromFace = aFromIntAna.Point(1); if(aPoints[i].Distance(aPntOnToFace) > aMaxToDist) { aMaxToDist = aPoints[i].Distance(aPntOnToFace); } @@ -223,11 +224,10 @@ void GeomAlgoAPI_Prism::build(const std::shared_ptr& theBasis, // Orienting bounding planes. gp_Lin aLine(aCentrePnt, aNormal); - TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge(aLine).Edge(); - BRepExtrema_ExtCF aToExt(anEdge, TopoDS::Face(aBndToShape)); - BRepExtrema_ExtCF aFromExt(anEdge, TopoDS::Face(aBndFromShape)); - Standard_Real aToParameter = aToExt.ParameterOnEdge(1); - Standard_Real aFromParameter = aFromExt.ParameterOnEdge(1); + IntAna_IntConicQuad aToIntAna(aLine, aBndToQuadric); + IntAna_IntConicQuad aFromIntAna(aLine, aBndFromQuadric); + Standard_Real aToParameter = aToIntAna.ParamOnConic(1); + Standard_Real aFromParameter = aFromIntAna.ParamOnConic(1); if(aToParameter > aFromParameter) { gp_Vec aVec = aToDir->impl(); if((aVec * aNormal) > 0) {