0029356: Modeling Algorithms - GCPnts_TangentialDeflection hangs on specific curve
authornds <nds@opencascade.com>
Mon, 29 Jan 2018 08:19:36 +0000 (11:19 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 16 Mar 2018 11:56:20 +0000 (14:56 +0300)
While UV Iso parameters are obtained in StdPrs_Isolines, UV limits should be applied only if face bounds has infinite values.
In the issue case, the UV values are greater than UVLimits and not infinite. This fix makes possible to have correct Iso lines in presentation without modification of UV limits beforehead.

src/StdPrs/StdPrs_Isolines.cxx
tests/v3d/face/G1 [new file with mode: 0644]
tests/v3d/face/G2 [new file with mode: 0644]
tests/v3d/face/G3 [new file with mode: 0644]
tests/v3d/face/G4 [new file with mode: 0644]

index 6df065a..8a7227f 100644 (file)
@@ -589,10 +589,14 @@ void StdPrs_Isolines::UVIsoParameters (const TopoDS_Face&      theFace,
 
   BRepTools::UVBounds (theFace, aUmin, aUmax, aVmin, aVmax);
 
-  aUmin = Max (aUmin, -theUVLimit);
-  aUmax = Min (aUmax,  theUVLimit);
-  aVmin = Max (aVmin, -theUVLimit);
-  aVmax = Min (aVmax,  theUVLimit);
+  if (Precision::IsInfinite (aUmin))
+    aUmin = -theUVLimit;
+  if (Precision::IsInfinite (aUmax))
+    aUmax = theUVLimit;
+  if (Precision::IsInfinite (aVmin))
+    aVmin = -theUVLimit;
+  if (Precision::IsInfinite (aVmax))
+    aVmax = theUVLimit;
 
   TopLoc_Location aLocation;
   const Handle(Geom_Surface)& aSurface = BRep_Tool::Surface (theFace, aLocation);
diff --git a/tests/v3d/face/G1 b/tests/v3d/face/G1
new file mode 100644 (file)
index 0000000..b91b280
--- /dev/null
@@ -0,0 +1,11 @@
+# isolines on infinite cylinder
+# maximum parameter value for a view sets UV limit for isolines on infinite object
+
+cylinder c 0 0 0 0 0 1 10
+mkface f c
+
+vinit
+vdisplay -dispMode 0 f
+vaspects -defaults -setMaxParamValue 10
+visos f 10 4 1
+vfit
diff --git a/tests/v3d/face/G2 b/tests/v3d/face/G2
new file mode 100644 (file)
index 0000000..20d68ba
--- /dev/null
@@ -0,0 +1,11 @@
+puts "========"
+puts "0029356: Modeling Algorithms - GCPnts_TangentialDeflection hangs on specific curve"
+puts "========"
+
+if {[info commands testreadiges] == ""} {pload XSDRAW}
+testreadiges [locate_data_file bug29356.igs] a
+
+vinit View1
+vdisplay -dispMode 0 a
+visos a 12 6 1
+vfit
diff --git a/tests/v3d/face/G3 b/tests/v3d/face/G3
new file mode 100644 (file)
index 0000000..5f6968f
--- /dev/null
@@ -0,0 +1,23 @@
+# isolines on infinite prism based on spline edge with poles closed to 1.4e+6
+
+if {[info commands testreadiges] == ""} {pload XSDRAW}
+testreadiges [locate_data_file bug29356.igs] a
+
+mksurface s a
+viso c s 0
+dump c
+mkedge e c
+
+haxo
+donly e
+prism r e 0 1 0 Inf
+fit
+xbounds r
+
+vinit
+vdisplay r
+visos r 2 3 1
+vfit
+vzoom 3000
+
+vdump $imagedir/${casename}_zoom.png
diff --git a/tests/v3d/face/G4 b/tests/v3d/face/G4
new file mode 100644 (file)
index 0000000..da03c8e
--- /dev/null
@@ -0,0 +1,20 @@
+# isolines on finite prism based on spline edge with poles closed to 1.4e+6
+
+if {[info commands testreadiges] == ""} {pload XSDRAW}
+testreadiges [locate_data_file bug29356.igs] a
+
+mksurface s a
+viso c s 0
+dump c
+mkedge e c
+
+haxo
+donly e
+prism r e 0 1 0 Fin
+fit
+xbounds r
+
+vinit
+vdisplay r
+visos r 2 2 1
+vfit