diff --git a/src/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx b/src/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx index 2a473f7a5f..87f1ad4a34 100755 --- a/src/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx +++ b/src/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx @@ -146,6 +146,7 @@ void StdPrs_WFDeflectionRestrictedFace::Add gp_Pnt dummypnt; Standard_Real ddefle= Max(UMax-UMin, VMax-VMin) * aDrawer->DeviationCoefficient(); TColgp_SequenceOfPnt2d tabP; + Standard_Real aHatchingTol = 1.e100; UMin = VMin = 1.e100; UMax = VMax = -1.e100; @@ -173,6 +174,7 @@ void StdPrs_WFDeflectionRestrictedFace::Add UMax = Max(P2.X(), UMax); VMin = Min(P2.Y(), VMin); VMax = Max(P2.Y(), VMax); + aHatchingTol = Min(P1.SquareDistance(P2), aHatchingTol); if(Orient == TopAbs_FORWARD ) { //isobuild.Trim(P1,P2); @@ -219,6 +221,8 @@ void StdPrs_WFDeflectionRestrictedFace::Add UMax = Max(P2.X(), UMax); VMin = Min(P2.Y(), VMin); VMax = Max(P2.Y(), VMax); + aHatchingTol = Min(P1.SquareDistance(P2), aHatchingTol); + if(Orient == TopAbs_FORWARD ) { // isobuild.Trim(P1,P2); tabP.Append(P1); @@ -240,8 +244,13 @@ void StdPrs_WFDeflectionRestrictedFace::Add FFaceTimer2.Start(); #endif + // Compute the hatching tolerance. + aHatchingTol *= 0.1; + aHatchingTol = Max(Precision::Confusion(), aHatchingTol); + aHatchingTol = Min(1.e-5, aHatchingTol); + // load the isos - Hatch_Hatcher isobuild(1.e-5,ToolRst.IsOriented()); + Hatch_Hatcher isobuild(aHatchingTol, ToolRst.IsOriented()); Standard_Boolean UClosed = aFace->IsUClosed(); Standard_Boolean VClosed = aFace->IsVClosed(); diff --git a/src/ViewerTest/ViewerTest.cxx b/src/ViewerTest/ViewerTest.cxx index d017497813..2eefcd809c 100755 --- a/src/ViewerTest/ViewerTest.cxx +++ b/src/ViewerTest/ViewerTest.cxx @@ -56,6 +56,7 @@ #include #include #include +#include #ifdef HAVE_CONFIG_H # include @@ -3556,6 +3557,10 @@ void ViewerTest::Commands(Draw_Interpretor& theCommands) const char *group = "AIS_Display"; // display + theCommands.Add("visos", + "visos [name1 ...] [nbUIsos nbVIsos IsoOnPlane(0|1)]\n" + "\tIf last 3 optional parameters are not set prints numbers of U-, V- isolines and IsoOnPlane.\n", + __FILE__, visos, group); theCommands.Add("vdisplay", "vdisplay : vdisplay2 name1 [name2] ... [name n] ", diff --git a/tests/bugs/vis/bug23705 b/tests/bugs/vis/bug23705 new file mode 100755 index 0000000000..c5c35cbaa2 --- /dev/null +++ b/tests/bugs/vis/bug23705 @@ -0,0 +1,22 @@ +puts "========" +puts "CR23705" +puts "========" +puts "" +############################################################### +## Isoline in the AIS viewer is not trimmed +############################################################### + +restore [locate_data_file bug23705_plancher20igs_face.brep] result + +vinit +visos 10 10 1 + +vdisplay result +vfit + +set x 326 +set y 295 + +checkcolor $x $y 0 0 0 + +set only_screen 1