]> OCCT Git - occt.git/commitdiff
0032982: [Regression to 7.3.0] Mesh - Meshing the shape takes too long and visualizat...
authoroan <oan@opencascade.com>
Fri, 26 Aug 2022 15:54:33 +0000 (18:54 +0300)
committersmoskvin <smoskvin@opencascade.com>
Thu, 8 Sep 2022 19:06:40 +0000 (22:06 +0300)
New formula to calculate number of points along V axis of a cone depending on ratio of its size along V and U.

src/BRepMesh/BRepMesh_ConeRangeSplitter.cxx
tests/bugs/mesh/bug25042
tests/bugs/mesh/bug25287
tests/bugs/mesh/bug32692_1
tests/bugs/mesh/bug32767
tests/bugs/mesh/bug32982_1 [new file with mode: 0644]
tests/bugs/mesh/bug32982_2 [new file with mode: 0644]

index add0a50374e5f6349769855b68774ace3dee601d..cc61eedb9d1a8e72845319c78f1f1812de33359b 100644 (file)
@@ -41,10 +41,13 @@ std::pair<Standard_Real, Standard_Real> BRepMesh_ConeRangeSplitter::GetSplitStep
 
   const Standard_Real aDiffU = aRangeU.second - aRangeU.first;
   const Standard_Real aDiffV = aRangeV.second - aRangeV.first;
-  Standard_Integer nbU = (Standard_Integer) (aDiffU / Du);
-  Standard_Integer nbV = (Standard_Integer) (nbU * (aDiffV) / (aDiffU * aRadius));
+  const Standard_Real aScale = (Du * aRadius);
+  const Standard_Real aRatio = Max(1., Log(aDiffV / aScale));
+  const Standard_Integer nbU = (Standard_Integer)(aDiffU / Du);
+  const Standard_Integer nbV = (Standard_Integer)(aDiffV / aScale / aRatio);
+
   Du = aDiffU / (nbU + 1);
-  Dv = aDiffV / (nbV + 1);
+  Dv = aDiffV / (nbV + static_cast<Standard_Integer>(aRatio));
 
   theStepsNb.first  = nbU;
   theStepsNb.second = nbV;
index 8f53da4b87653bf50e2d31e242ee3c617f6cf153..cdee565d5a926a27748d3dacbdb70c78097cd21a 100644 (file)
@@ -14,7 +14,7 @@ vviewparams -scale 1.81755 -proj 0.88572 0.104526 0.452299 -up -0.0339444 0.9862
  
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
 
-checktrinfo result -tri 957 -nod 558 -defl 1.1088499641289298 -tol_abs_defl 1e-6
+checktrinfo result -tri 509 -nod 327 -defl 1.5916215272983552 -tol_abs_defl 1e-6
 
 set log [tricheck result]
 if { [llength $log] != 0 } {
index 5b51eeeb95da63b2d59b627274e88a39186b9db1..80336f81b3e47800e0f8e442ae4e9b622d681209 100644 (file)
@@ -11,7 +11,7 @@ renamevar a_1 result
 
 incmesh result 0.0001 -a 30 -force_face_def -parallel
 
-checktrinfo result -tri 13854 -nod 9190 -defl 0.00028360162213471898 -tol_abs_defl 1e-6
+checktrinfo result -tri 12512 -nod 8519 -defl 0.00031502118964205414 -tol_abs_defl 1e-6
 
 vinit
 vsetdispmode 1
index db139cb93d64d784c5668d77bd2f1360b6f517dc..5a85bff3db5fee40cb96a625d715c698dabde642 100644 (file)
@@ -8,4 +8,4 @@ puts "REQUIRED ALL: Meshing statuses: SelfIntersectingWire Failure"
 restore [locate_data_file bug32692.brep] s
 incmesh s 0.01 -parallel
 
-checktrinfo s -nod 7511 -tri 7625 -empty 9 -face 309
+checktrinfo s -nod 7427 -tri 7457 -empty 9 -face 309
index b5e472cfe63302014a507456e38ca3e130c6709c..d336f9c9d5c4de8b97f1366484c5d59437af28d1 100644 (file)
@@ -6,4 +6,4 @@ puts ""
 restore [locate_data_file bug32767.brep] s
 tclean s
 incmesh s 0.01
-checktrinfo s -tri 3220 -nod 1770 -defl 0.018398669654253779 -tol_abs_defl 1e-6
\ No newline at end of file
+checktrinfo s -tri 1512 -nod 909 -defl 0.035378595363471328 -tol_abs_defl 1e-6
\ No newline at end of file
diff --git a/tests/bugs/mesh/bug32982_1 b/tests/bugs/mesh/bug32982_1
new file mode 100644 (file)
index 0000000..e4640ef
--- /dev/null
@@ -0,0 +1,19 @@
+puts "========="
+puts "OCC32982: Mesh - Meshing the shape takes too long and visualization is bad"
+puts "========="
+puts ""
+
+restore [locate_data_file bug32982.brep] result
+incmesh result 5.58
+
+checktrinfo result -nod 4036 -tri 7450
+
+vinit
+vdefaults -autoTriang 0
+vdisplay result
+vsetdispmode 1
+vfit
+vpan -5 198
+vzoom 150
+
+checkview -screenshot -3d -path ${imagedir}/${test_image}.png
diff --git a/tests/bugs/mesh/bug32982_2 b/tests/bugs/mesh/bug32982_2
new file mode 100644 (file)
index 0000000..1cf7089
--- /dev/null
@@ -0,0 +1,21 @@
+puts "========="
+puts "OCC32982: Mesh - Meshing the shape takes too long and visualization is bad"
+puts "========="
+puts ""
+
+restore [locate_data_file bug32982.brep] result
+
+tscale result 9.7978019714355504 25.567642604431001 42.7875250671255 0.001
+incmesh result 0.00558
+
+checktrinfo result -nod 4036 -tri 7450
+
+vinit
+vdefaults -autoTriang 0
+vdisplay result
+vsetdispmode 1
+vfit
+vpan -5 198
+vzoom 150
+
+checkview -screenshot -3d -path ${imagedir}/${test_image}.png