From: isn Date: Wed, 14 Dec 2016 14:41:08 +0000 (+0300) Subject: refs #1094 p.2 X-Git-Tag: Salome_8_3_Hydro_1_1rc1~68^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0d956a814;p=modules%2Fhydro.git refs #1094 p.2 --- diff --git a/src/HYDROData/HYDROData_DTM.cxx b/src/HYDROData/HYDROData_DTM.cxx index 9393ac04..2c96221d 100644 --- a/src/HYDROData/HYDROData_DTM.cxx +++ b/src/HYDROData/HYDROData_DTM.cxx @@ -52,6 +52,8 @@ #include #include #include +#include +#include #include #include #include @@ -315,19 +317,20 @@ bool HYDROData_DTM::GetPlanarFaceFromBanks( const TopoDS_Edge& LB, const TopoDS_ BRep_Builder BB; TopoDS_Face F; Handle_Geom_Plane refpl = new Geom_Plane(gp_Pnt(0,0,0), gp_Dir(0,0,1)); - BB.MakeFace(F, refpl, Precision::Confusion()); - BRepAlgo_NormalProjection nproj(F); - nproj.Add(LB); - nproj.Add(RB); - nproj.SetDefaultParams(); - nproj.Build(); - if(!nproj.IsDone()) - return false; - //TopoDS_Shape projBanks = nproj.Projection(); TopoDS_Vertex VFI, VLI, VFO, VLO; - TopoDS_Edge prLB = TopoDS::Edge(nproj.Generated(LB).First()); - TopoDS_Edge prRB = TopoDS::Edge(nproj.Generated(RB).First()); + TopoDS_Edge prLB; + TopoDS_Edge prRB; + + + BRepAdaptor_Curve LBAD(LB); + Handle_Geom_Curve LBPC = GeomProjLib::ProjectOnPlane(LBAD.Curve().Curve(), refpl, gp_Dir(0, 0, -1), 1 ); + prLB = BRepLib_MakeEdge(LBPC).Edge(); + + BRepAdaptor_Curve RBAD(RB); + Handle_Geom_Curve RBPC = GeomProjLib::ProjectOnPlane(RBAD.Curve().Curve(), refpl, gp_Dir(0, 0, -1), 1 ); + prRB = BRepLib_MakeEdge(RBPC).Edge(); + TopExp::Vertices(prLB, VFI, VFO, 1); TopExp::Vertices(prRB, VLI, VLO, 1); TopoDS_Edge prIL = BRepLib_MakeEdge(VFI, VLI).Edge();