d4a07938dcceffe7b228954bad428fac507ecc26
[occt.git] / tests / bugs / xde / bug23193
1 puts "============"
2 puts "OCC23193"
3 puts "============"
4 puts ""
5 ###########################################################################
6 # Some triangles are inverted when writing an STL file
7 ###########################################################################
8 pload QAcommands
9
10 if {[array get env os_type] != ""} {
11     set os $env(os_type)
12 }
13
14 if { [string compare $os "windows"] == 0 } {
15     set aFile C:/temp/bug23193_sample.stl
16 } else {
17     set aFile /tmp/bug23193_sample.stl
18 }
19
20 catch {exec rm -f ${aFile}}
21 if { [file exists ${aFile}] } {
22    puts "Error : There is old ${aFile} file"
23 }
24
25 vinit
26 stepread [locate_data_file bug23193_sample.stp] a *
27 writestl a_1 ${aFile} 0
28 catch {exec chmod 777 ${aFile}}
29
30 meshfromstl m1 ${aFile}
31 meshcolors m1 elem2 1
32 QARotateV3dView 4 0 0 1
33 vfit
34
35 set color [QAGetPixelColor 189 236]
36 regexp {RED +: +([-0-9.+eE]+)} $color full rd
37 regexp {GREEN +: +([-0-9.+eE]+)} $color full gr
38 regexp {BLUE +: +([-0-9.+eE]+)} $color full bl
39
40 set a [expr $bl*10]
41 set bl_1 [expr round($a)]
42
43 if { $rd != 0 || $gr != 0 || $bl_1 != 7 } {
44     puts "Error : Color are not equal. There is missing triangle"
45 }
46
47 set 3dviewer 2
48
49
50
51