mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0030221: Data Exchange - VRML is exported with inversed normals
Added test case bugs/xde/bug30221
This commit is contained in:
parent
1b63268eb2
commit
9b9f2fe972
@ -396,11 +396,14 @@ Handle(VrmlData_Geometry) VrmlData_ShapeConvert::triToIndexedFaceSet
|
|||||||
(anAlloc->Allocate (nNodes * sizeof(gp_XYZ)));
|
(anAlloc->Allocate (nNodes * sizeof(gp_XYZ)));
|
||||||
const TShort_Array1OfShortReal& Norm = theTri->Normals();
|
const TShort_Array1OfShortReal& Norm = theTri->Normals();
|
||||||
Standard_Integer j;
|
Standard_Integer j;
|
||||||
for (i = 0, j = 1; i < nNodes; i++, j += 3) {
|
for (i = 0, j = 1; i < nNodes; i++, j += 3)
|
||||||
|
{
|
||||||
gp_XYZ aNormal(Norm(j), Norm(j+1), Norm(j+2));
|
gp_XYZ aNormal(Norm(j), Norm(j+1), Norm(j+2));
|
||||||
|
if (isReverse)
|
||||||
|
{
|
||||||
|
aNormal.Reverse();
|
||||||
|
}
|
||||||
arrVec[i] = aNormal;
|
arrVec[i] = aNormal;
|
||||||
|
|
||||||
}
|
}
|
||||||
const Handle(VrmlData_Normal) aNormalNode =
|
const Handle(VrmlData_Normal) aNormalNode =
|
||||||
new VrmlData_Normal (myScene, 0L, nNodes, arrVec);
|
new VrmlData_Normal (myScene, 0L, nNodes, arrVec);
|
||||||
|
23
tests/bugs/xde/bug30221
Normal file
23
tests/bugs/xde/bug30221
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "OCC30221"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
#################################################################
|
||||||
|
# Data Exchange - VRML is exported with inversed normals
|
||||||
|
#################################################################
|
||||||
|
|
||||||
|
set FileName bug30221_vmt01b
|
||||||
|
XOpen [locate_data_file ${FileName}.xbf] D
|
||||||
|
XShow D
|
||||||
|
vfit
|
||||||
|
vsetdispmode 1
|
||||||
|
vclose
|
||||||
|
file delete -force ${imagedir}/${FileName}.wrl
|
||||||
|
WriteVrml D ${imagedir}/${FileName}.wrl
|
||||||
|
loadvrml a ${imagedir}/${FileName}.wrl
|
||||||
|
|
||||||
|
vinit View1
|
||||||
|
vdisplay -dispMode 1 a
|
||||||
|
vfit
|
||||||
|
|
||||||
|
checkview -screenshot -3d -path ${imagedir}/${test_image}.png
|
Loading…
x
Reference in New Issue
Block a user