1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +03:00

0031136: Modeling Data - BinXCAF persistence loses normals from triangulation-only Faces

Information about normals are stored in BinOCAF, XmlOCAF, BRep and BBRep (in case of triangulation-only Faces).
Versions of formats have been changed (11 for TDocStd, 4 for BRep Shape and 3 for Binary BRep Shape)
theWithNormals parameter added to BRepTools::Write()
IsWithNormals()/SetWithNormals() function added to BRepTools_ShapeSet
-normals/-noNormals option added to StoreTriangulation DRAW command
-normals/-noNormals option added to writebrep DRAW command
Tests for writing to brep/binary brep/BinXCaf/XmlXCaf added
Test for StoreTriangulation options -normals/-noNormals added
This commit is contained in:
asuraven
2020-11-17 20:37:01 +03:00
committed by bugmaster
parent 6fab0b3428
commit 9f45d35b6b
40 changed files with 703 additions and 209 deletions

View File

@@ -0,0 +1,23 @@
puts "=========="
puts "0031136: BinXCAF persistence loses normals from triangulation-only Faces"
puts "=========="
puts ""
pload MODELING XDE OCAF VISUALIZATION
source $env(CSF_OCCTSamplesPath)/tcl/cad.tcl
trinfo res
wavefront res $imagedir/${test_image}
readobj o $imagedir/${test_image}.obj
# binary format
set test_image_bbrep ${test_image}_bbrep
binsave o $imagedir/${test_image_bbrep}.bbrep
binrestore $imagedir/${test_image_bbrep}.bbrep b1
vclear
vclose ALL
vinit v1/v1
vbottom
vdisplay -dispMode 1 b1
vfit
vrenderparams -shadingModel phong
checkview -screenshot -3d -path ${imagedir}/${test_image_bbrep}.png

View File

@@ -0,0 +1,24 @@
puts "=========="
puts "0031136: BinXCAF persistence loses normals from triangulation-only Faces"
puts "=========="
puts ""
pload MODELING XDE OCAF VISUALIZATION
source $env(CSF_OCCTSamplesPath)/tcl/cad.tcl
trinfo res
wavefront res $imagedir/${test_image}
readobj o $imagedir/${test_image}.obj
# ASCII format
set test_image_brep ${test_image}_brep
save o $imagedir/${test_image_brep}.brep
restore $imagedir/${test_image_brep}.brep b2
vclear
vclose ALL
vinit v1/v1
vbottom
vdisplay -dispMode 1 b2
vfit
vrenderparams -shadingModel phong
checkview -screenshot -3d -path ${imagedir}/${test_image_brep}.png

View File

@@ -0,0 +1,27 @@
puts "=========="
puts "0031136: BinXCAF persistence loses normals from triangulation-only Faces"
puts "=========="
puts ""
pload MODELING XDE OCAF VISUALIZATION
source $env(CSF_OCCTSamplesPath)/tcl/cad.tcl
trinfo res
wavefront res $imagedir/${test_image}
readobj o $imagedir/${test_image}.obj
# XBF format
set test_image_XBF ${test_image}_XBF
XNewDoc D1
XAddShape D1 o
XSave D1 $imagedir/${test_image_XBF}.xbf
Close D1
XOpen $imagedir/${test_image_XBF}.xbf D2
vclear
vclose ALL
vinit v1/v1
vbottom
XDisplay -dispMode 1 D2
Close D2
vfit
vrenderparams -shadingModel phong
checkview -screenshot -3d -path ${imagedir}/${test_image_XBF}.png

View File

@@ -0,0 +1,29 @@
puts "=========="
puts "0031136: BinXCAF persistence loses normals from triangulation-only Faces"
puts "=========="
puts ""
pload MODELING XDE OCAF VISUALIZATION
source $env(CSF_OCCTSamplesPath)/tcl/cad.tcl
trinfo res
wavefront res $imagedir/${test_image}
readobj o $imagedir/${test_image}.obj
# XML format
set test_image_XML ${test_image}_XML
NewDocument D1 XmlXCAF
XAddShape D1 o
# SetStorageFormatVersion D1 10
SaveAs D1 $imagedir/${test_image_XML}.xml
Close D1
Open $imagedir/${test_image_XML}.xml D2
vclear
vclose ALL
vinit v1/v1
vbottom
XDisplay -dispMode 1 D2
Close D2
vfit
vrenderparams -shadingModel phong
checkview -screenshot -3d -path ${imagedir}/${test_image_XML}.png

View File

@@ -0,0 +1,69 @@
puts "=========="
puts "0031136: BinXCAF persistence loses normals from triangulation-only Faces"
puts "=========="
puts ""
pload XDE OCAF
StoreTriangulation 1 -normals
set res [StoreTriangulation -getnormals]
if { $res != 1 } {
puts "Error : normals not on"
}
StoreTriangulation 1 -normals 0
set res [StoreTriangulation -getnormals]
if { $res != 0 } {
puts "Error : normals not off"
}
StoreTriangulation 1 -normals 1
set res [StoreTriangulation -getnormals]
if { $res != 1 } {
puts "Error : normals not on"
}
StoreTriangulation 1 -nonormals
set res [StoreTriangulation -getnormals]
if { $res != 0 } {
puts "Error : normals not off"
}
StoreTriangulation 1 -nonormals 0
set res [StoreTriangulation -getnormals]
if { $res != 1 } {
puts "Error : normals not on"
}
StoreTriangulation 1 -nonormals 1
set res [StoreTriangulation -getnormals]
if { $res != 0 } {
puts "Error : normals not off"
}
StoreTriangulation -normals
set res [StoreTriangulation -getnormals]
if { $res != 1 } {
puts "Error : normals not on"
}
StoreTriangulation -normals 0
set res [StoreTriangulation -getnormals]
if { $res != 0 } {
puts "Error : normals not off"
}
StoreTriangulation -normals 1
set res [StoreTriangulation -getnormals]
if { $res != 1 } {
puts "Error : normals not on"
}
StoreTriangulation -nonormals
set res [StoreTriangulation -getnormals]
if { $res != 0 } {
puts "Error : normals not off"
}
StoreTriangulation -nonormals 0
set res [StoreTriangulation -getnormals]
if { $res != 1 } {
puts "Error : normals not on"
}
StoreTriangulation -nonormals 1
set res [StoreTriangulation -getnormals]
if { $res != 0 } {
puts "Error : normals not off"
}
puts "OK"