1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-08 18:40:55 +03:00
occt/tests/bugs/mesh/bug22778
abv 44cf55e600 Test for 0022778: Bug in BRepMesh
Test case bugs mesh bug22778 added.
Test case bugs mesh bug23473 moved to systematic grid (mesh standard* X5)
2013-01-18 12:30:29 +04:00

44 lines
1.3 KiB
Plaintext

# test for #22778: compare number of triangles in triangulation
# produced on surface converted to nurbs, against number of triangles on
# original analytic (spherical) surface
puts "TODO #22778 All: too many triangles"
# original face on spherical surface
restore [locate_data_file bug22778_square.brep] s
checkshape s
incmesh s 0.001
set trinfo_s [trinfo s]
regexp {([0-9]+) triangles} $trinfo_s str nbtri_s
regexp {deflection ([0-9.+e-]+)} $trinfo_s str defl_s
# face converted to NURBS
nurbsconvert r s
checkshape r
incmesh r 0.001
set trinfo_r [trinfo r]
regexp {([0-9]+) triangles} $trinfo_r str nbtri_r
regexp {deflection ([0-9.+e-]+)} $trinfo_r str defl_r
# check deflections
if { $defl_s > 0.001 } {
puts "Error: too big deflection on original face ($defl_s > 0.001)"
}
if { $defl_r > 0.001 } {
puts "Error: too big deflection on NURBS face ($defl_r > 0.001)"
}
# compare number of triangles, allow twice more
if { $nbtri_r > [expr 2. * $nbtri_s] } {
puts "Error: too many triangles ($nbtri_r, while ~ $nbtri_s would be sufficient)"
}
# extra check: deflection on rough mesh on NURBS
tclean r
incmesh r 0.1
set trinfo_r_01 [trinfo r]
regexp {deflection ([0-9.+e-]+)} $trinfo_r_01 str defl_r_01
if { $defl_r_01 > 0.1 } {
puts "Error: too big deflection on NURBS face ($defl_r > 0.1)"
}