diff --git a/src/BRepMesh/BRepMesh_CurveTessellator.cxx b/src/BRepMesh/BRepMesh_CurveTessellator.cxx index 3779a52425..c8e942ec3a 100644 --- a/src/BRepMesh/BRepMesh_CurveTessellator.cxx +++ b/src/BRepMesh/BRepMesh_CurveTessellator.cxx @@ -101,9 +101,21 @@ void BRepMesh_CurveTessellator::init() myEdgeSqTol = BRep_Tool::Tolerance (myEdge); myEdgeSqTol *= myEdgeSqTol; - const Standard_Integer aMinPntNb = Max(myMinPointsNb, - (myCurve.GetType() == GeomAbs_Circle) ? 4 : 2); //OCC287 + Standard_Integer aMinPntThreshold = 2; + switch (myCurve.GetType()) + { + case GeomAbs_Circle: + case GeomAbs_Ellipse: + case GeomAbs_Parabola: + case GeomAbs_Hyperbola: + aMinPntThreshold = 4; + break; + default: + break; + } + + const Standard_Integer aMinPntNb = Max (myMinPointsNb, aMinPntThreshold); //OCC287 myDiscretTool.Initialize (myCurve, myCurve.FirstParameter(), myCurve.LastParameter(), aPreciseAngDef, aPreciseLinDef, aMinPntNb, diff --git a/tests/bugs/mesh/bug27845 b/tests/bugs/mesh/bug27845 index 6287701923..c9a337f75b 100644 --- a/tests/bugs/mesh/bug27845 +++ b/tests/bugs/mesh/bug27845 @@ -14,7 +14,7 @@ vdisplay result vfit checkview -screenshot -3d -path ${imagedir}/${test_image}.png -checktrinfo result -tri 3828 -nod 4771 -defl 3.0544822246414993 -tol_abs_defl 1e-6 +checktrinfo result -tri 3834 -nod 4777 -defl 3.0544822246414993 -tol_abs_defl 1e-6 set log [tricheck result] if { [llength $log] != 0 } { diff --git a/tests/bugs/mesh/bug31449_1 b/tests/bugs/mesh/bug31449_1 index f117e4a33c..05032627a6 100644 --- a/tests/bugs/mesh/bug31449_1 +++ b/tests/bugs/mesh/bug31449_1 @@ -15,6 +15,6 @@ vfit vsetdispmode 1 XGetOneShape result Q -checktrinfo result -tri 9025 -nod 6562 +checktrinfo result -tri 9097 -nod 6634 checkview -screenshot -3d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/mesh/bug31449_3 b/tests/bugs/mesh/bug31449_3 index f77c0646c0..b7dc0cdc22 100644 --- a/tests/bugs/mesh/bug31449_3 +++ b/tests/bugs/mesh/bug31449_3 @@ -14,6 +14,6 @@ XGetOneShape result Q incmesh result 0.00039624 -a 20 -min 0.0001 -parallel -checktrinfo result -tri 7661 -nod 5810 +checktrinfo result -tri 7733 -nod 5882 checkview -display result -3d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/mesh/bug31865 b/tests/bugs/mesh/bug31865 new file mode 100644 index 0000000000..e9477fdc07 --- /dev/null +++ b/tests/bugs/mesh/bug31865 @@ -0,0 +1,20 @@ +puts "========" +puts "0031865: Mesh - triangulation fails with large deflection values due to unhandled Standard_OutOfRange, BRepMesh_PairOfIndex::Append()" +puts "========" +puts "" + +restore [locate_data_file bug31865.brep] result + +tclean result +incmesh result 0.2 + +vinit +vdefaults -autoTriang 0 +checkview -display result -3d -path ${imagedir}/${test_image}.png + +set log [tricheck result] +if { [llength $log] != 0 } { + puts "Error : Invalid mesh" +} else { + puts "Mesh is OK" +} diff --git a/tests/bugs/modalg_2/bug264_6 b/tests/bugs/modalg_2/bug264_6 index 5285e22da3..08f75e8aa3 100755 --- a/tests/bugs/modalg_2/bug264_6 +++ b/tests/bugs/modalg_2/bug264_6 @@ -15,6 +15,6 @@ vclear isos result 0 triangles result -checktrinfo result -tri 18 -nod 20 +checktrinfo result -tri 20 -nod 22 checkprops result -s 19.2399 checkview -display result -3d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_2/bug264_7 b/tests/bugs/modalg_2/bug264_7 index 9197a0b3da..1a03acd2e1 100755 --- a/tests/bugs/modalg_2/bug264_7 +++ b/tests/bugs/modalg_2/bug264_7 @@ -15,6 +15,6 @@ vclear isos result 0 triangles result -checktrinfo result -tri 91 -nod 93 +checktrinfo result -tri 103 -nod 105 checkprops result -s 150.283 checkview -display result -3d -path ${imagedir}/${test_image}.png diff --git a/tests/de_mesh/shape_write_stl/A8 b/tests/de_mesh/shape_write_stl/A8 index b7880923c9..16bf1a7661 100644 --- a/tests/de_mesh/shape_write_stl/A8 +++ b/tests/de_mesh/shape_write_stl/A8 @@ -9,7 +9,7 @@ writestl m $imagedir/${casename} readstl res $imagedir/${casename} file delete $imagedir/${casename} -checktrinfo res -tri 34 -nod 19 +checktrinfo res -tri 36 -nod 20 # Visual check checkview -display res -2d -path ${imagedir}/${test_image}.png diff --git a/tests/hlr/poly_hlr/A3 b/tests/hlr/poly_hlr/A3 index 804241eb90..df6a3bf924 100644 --- a/tests/hlr/poly_hlr/A3 +++ b/tests/hlr/poly_hlr/A3 @@ -4,7 +4,7 @@ puts "=====================================" puts "" set viewname "vbottom" -set length 8.40196 +set length 8.40188 restore [locate_data_file bug27341_hlrsave.brep] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C13 b/tests/hlr/poly_hlr/C13 index 6a502fbb74..69067419fd 100644 --- a/tests/hlr/poly_hlr/C13 +++ b/tests/hlr/poly_hlr/C13 @@ -1,5 +1,5 @@ set viewname "vright" -set length 9547.12 +set length 9546.37 testreadstep [locate_data_file bug27341_Assembly_ABS_1_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C15 b/tests/hlr/poly_hlr/C15 index 804df0c48f..a90bd9554c 100644 --- a/tests/hlr/poly_hlr/C15 +++ b/tests/hlr/poly_hlr/C15 @@ -1,5 +1,5 @@ set viewname "vright" -set length 5101.26 +set length 5101.97 testreadstep [locate_data_file bug27341_Assembly_GMS_Kurz_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C20 b/tests/hlr/poly_hlr/C20 index ae4a9db262..14bf820c30 100644 --- a/tests/hlr/poly_hlr/C20 +++ b/tests/hlr/poly_hlr/C20 @@ -1,5 +1,5 @@ set viewname "vright" -set length 1704.86 +set length 1705.48 testreadstep [locate_data_file bug27341_Drehkopf_HSK_Gewinde_R_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C23 b/tests/hlr/poly_hlr/C23 index c1c2ed6118..7651d0d8fa 100644 --- a/tests/hlr/poly_hlr/C23 +++ b/tests/hlr/poly_hlr/C23 @@ -1,5 +1,5 @@ set viewname "vright" -set length 826.794 +set length 829.419 testreadstep [locate_data_file bug27341_KMM_Adapter_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C24 b/tests/hlr/poly_hlr/C24 index 46a0173c34..0ea41a1855 100644 --- a/tests/hlr/poly_hlr/C24 +++ b/tests/hlr/poly_hlr/C24 @@ -1,5 +1,5 @@ set viewname "vright" -set length 217.803 +set length 239.091 testreadstep [locate_data_file bug27341_MZX_01_1_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C3 b/tests/hlr/poly_hlr/C3 index b6806e8256..33f2568bd7 100644 --- a/tests/hlr/poly_hlr/C3 +++ b/tests/hlr/poly_hlr/C3 @@ -1,5 +1,5 @@ set viewname "vright" -set length 3057.35 +set length 3057.09 testreadstep [locate_data_file bug27341_570-DWLNL-40-08-L_131LANG_16VERSATZ_DIN.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C6 b/tests/hlr/poly_hlr/C6 index e0ad37efcc..e3077f9d8e 100644 --- a/tests/hlr/poly_hlr/C6 +++ b/tests/hlr/poly_hlr/C6 @@ -1,5 +1,5 @@ set viewname "vright" -set length 2832.09 +set length 2832.15 testreadstep [locate_data_file bug27341_ABS_Grundhalter_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/C8 b/tests/hlr/poly_hlr/C8 index 0a1185bbfd..986c7614fe 100644 --- a/tests/hlr/poly_hlr/C8 +++ b/tests/hlr/poly_hlr/C8 @@ -1,5 +1,5 @@ set viewname "vright" -set length 1154.09 +set length 1154.43 testreadstep [locate_data_file bug27341_AWN_Adapter_CAD.stp] a COMPUTE_HLR $viewname $algotype diff --git a/tests/hlr/poly_hlr/bug27979_2 b/tests/hlr/poly_hlr/bug27979_2 index a5df15c581..48132c53ea 100644 --- a/tests/hlr/poly_hlr/bug27979_2 +++ b/tests/hlr/poly_hlr/bug27979_2 @@ -4,7 +4,7 @@ puts "========================================================================" puts "" set viewname "vtop" -set length 13.0106 +set length 13.0091 restore [locate_data_file bug27979_parsed.brep] a COMPUTE_HLR $viewname $algotype