0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / tests / de_mesh / obj_write / mustang
... / ...
CommitLineData
1puts "========"
2puts "0029303: Data Exchange - add RWObj_CafWriter tool for wavefront OBJ file"
3puts "Write textured plane OBJ model into OBJ file"
4puts "========"
5
6pload XDE OCAF MODELING VISUALIZATION
7Close D -silent
8Close D1 -silent
9
10XNewDoc D1
11XSetLengthUnit D1 cm
12ReadObj D1 [locate_data_file "P-51 Mustang.obj"] -nocreatedoc -unit 1
13XGetOneShape s1 D1
14set aLProps1 [uplevel #0 sprops $s1]
15
16set aTmpObjBase "${imagedir}/${casename}_tmp"
17set aTmpObj "${aTmpObjBase}.obj"
18lappend occ_tmp_files $aTmpObj
19lappend occ_tmp_files "${aTmpObjBase}.mtl"
20lappend occ_tmp_files "${aTmpObjBase}_textures"
21
22WriteObj D1 "$aTmpObj"
23
24XNewDoc D
25XSetLengthUnit D cm
26ReadObj D "$aTmpObj" -nocreatedoc -unit 1
27XGetOneShape s D
28set aLProps2 [uplevel #0 sprops $s]
29checknbshapes s -face 14 -compound 1
30checktrinfo s -tri 4309 -nod 4727
31
32regexp {Mass\s:\s*([0-9\.]+)} $aLProps1 dummy anArea1
33regexp {Mass\s:\s*([0-9\.]+)} $aLProps2 dummy anArea2
34if {abs($anArea1 - $anArea2) > 1e-8 * $anArea1} {
35 puts "Error: invalid area $anArea1 instead of $anArea2"
36}
37
38vclear
39vinit View1
40XDisplay -dispMode 1 D
41vaxo
42vfit
43vdump ${imagedir}/${casename}.png