0027015: Sewing returns invalid shape if some faces are nearly plane cones
[occt.git] / tests / bugs / modalg_6 / bug27537
1 puts "============"
2 puts "OCC27537"
3 puts "============"
4 puts ""
5 ######################################################
6 # Incorrect number of sample points provided by GCPnts_TangentialDeflection
7 ######################################################
8
9 restore [locate_data_file bug27537.brep] result
10 incmesh result 0.2
11
12 set bndbox [bounding result]
13 set xMin [lindex $bndbox 0]
14 set yMin [lindex $bndbox 1]
15 set zMin [lindex $bndbox 2]
16 set xMax [lindex $bndbox 3]
17 set yMax [lindex $bndbox 4]
18 set zMax [lindex $bndbox 5]
19
20 mkcurve c result
21 bounds c u1 u2
22 set first [dval u1]
23 set last  [dval u2]
24
25 set x 0.
26 set y 0.
27 set z 0.
28 set param 0.
29 set isOk true
30
31 set nbSamples 100
32 set step [expr ($last - $first)/$nbSamples]
33 for {set i 0} {$i <= $nbSamples} {incr i} {
34   if {$i < $nbSamples} {
35     set param [expr $first + $i * $step]
36   } else {
37     set param $last
38   }
39
40   cvalue c $param cx cy cz
41   set x [dval cx]
42   set y [dval cy]
43   set z [dval cz]
44   if {$x < $xMin || $x > $xMax || $y < $yMin || $y > $yMax || $z < $zMin || $z > $zMax} {
45     puts "ERROR: point ($x; $y; $z) is out of bounding box"
46     set isOk false
47   }
48 }
49
50 if {$isOk} {
51   puts "OK: all sample points inside bounding box"
52 }
53
54 top; fit
55 checkview -screenshot -2d -path ${imagedir}/${test_image}.png