From b66a3d2f74b8683586b83b332e4f54b045e4cce6 Mon Sep 17 00:00:00 2001 From: isn Date: Thu, 24 Nov 2016 16:42:39 +0300 Subject: [PATCH] refs #1002 --- src/HYDROGUI/HYDROGUI_Polyline.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/HYDROGUI/HYDROGUI_Polyline.cxx b/src/HYDROGUI/HYDROGUI_Polyline.cxx index 7225e2e6..ccd259aa 100644 --- a/src/HYDROGUI/HYDROGUI_Polyline.cxx +++ b/src/HYDROGUI/HYDROGUI_Polyline.cxx @@ -87,10 +87,20 @@ void HYDROGUI_Polyline::Compute(const Handle(PrsMgr_PresentationManager3d)& aPre Handle(Graphic3d_AspectLine3d) anAspect = new Graphic3d_AspectLine3d( aColor, aType, anWidth ); TopExp_Explorer Exp1 ( myshape, TopAbs_EDGE ); + Bnd_Box BB; + BRepBndLib::AddClose(myshape, BB); + double xmin, xmax, ymin, ymax, zmin, zmax; + double devCoeff = 0.1; + if (!BB.IsVoid()) + { + BB.Get(xmin, ymin, zmin, xmax, ymax, zmax); //ignore Z coord + double minSide = Min(Abs(xmax - xmin), Abs(ymax - ymin)); + devCoeff = minSide > 50 ? 0.1 : minSide / 500; + } for ( ; Exp1.More(); Exp1.Next() ) { TopoDS_Edge anEdge = TopoDS::Edge( Exp1.Current() ); - Handle( Graphic3d_ArrayOfPolylines ) anArray = BuildEdgePresentation( anEdge, 0.1 ); + Handle( Graphic3d_ArrayOfPolylines ) anArray = BuildEdgePresentation( anEdge, devCoeff ); if( !anArray.IsNull() ) { aGroup->SetPrimitivesAspect( anAspect ); -- 2.39.2