b0fbc579 |
1 | puts "==========================================================" |
2 | puts "0027540: Run-to-run differences in the 3D Offset algorithm" |
3 | puts "==========================================================" |
4 | puts "" |
5 | |
6 | pload MODELING |
7 | |
8 | restore [locate_data_file bug27540_shapes3.brep] s |
9 | explode s |
10 | |
11 | # make offset operations on two shapes |
12 | # first shape |
13 | offsetparameter 1e-7 c i |
14 | # set offset 20 for top faces (normal direction 0 0 1), 0 for all other faces |
15 | offsetload s_1 0 |
16 | set faces [explode s_1 f] |
17 | foreach f $faces { |
18 | mksurface surf $f |
19 | set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] |
20 | if {$found && abs($z - 1) < 1.e-7} { |
21 | offsetonface $f 20 |
22 | } |
23 | } |
24 | offsetperform result1 |
25 | checkprops result1 -s 464088 |
26 | checkprops result1 -v 1.29909e+007 |
27 | checknbshapes result1 -vertex 48 -edge 74 -wire 32 -face 30 -shell 1 -solid 1 |
28 | |
29 | |
30 | # second shape |
31 | offsetparameter 1e-7 c i |
32 | # set offset 20 for top faces (normal direction 0 0 1), 0 for all other faces |
33 | offsetload s_2 0 |
34 | set faces [explode s_2 f] |
35 | foreach f $faces { |
36 | mksurface surf $f |
37 | set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] |
38 | if {$found && abs($z - 1) < 1.e-7} { |
39 | offsetonface $f 20 |
40 | } |
41 | } |
42 | offsetperform result2 |
43 | checkprops result2 -s 464088 |
44 | checkprops result2 -v 1.29909e+007 |
45 | checknbshapes result2 -vertex 48 -edge 74 -wire 32 -face 30 -shell 1 -solid 1 |
46 | |
47 | |
48 | # compare the results |
49 | set vertices1 [nexplode result1 v] |
50 | set vertices2 [nexplode result2 v] |
51 | |
52 | set nbv1 [llength $vertices1] |
53 | |
54 | for {set i 0} {$i < $nbv1} {incr i} { |
55 | set v1 [lindex $vertices1 $i] |
56 | set v2 [lindex $vertices2 $i] |
57 | |
58 | mkpoint px $v1 |
59 | set dump_v1 [dump px] |
60 | |
61 | mkpoint px $v2 |
62 | set dump_v2 [dump px] |
63 | |
64 | if {$dump_v1 != $dump_v2} { |
65 | puts "Error: the results are not the same - $v1 and $v2" |
66 | } |
67 | } |