1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0027008: Visualization - polygonal selection algorithm does not work with MeshVS_Mesh

- correct calculation of normals for SelectMgr_TriangularFrustum;
- test case for issue #27008
This commit is contained in:
vpa 2016-10-28 15:03:38 +03:00 committed by apn
parent bc9a61ec69
commit d4507e82ba
2 changed files with 31 additions and 4 deletions

View File

@ -27,13 +27,13 @@ namespace
void computeFrustumNormals (const gp_Vec* theEdges, gp_Vec* theNormals)
{
// V0V1
theNormals[0] = theEdges[0].Crossed (theEdges[1]);
theNormals[0] = theEdges[0].Crossed (theEdges[3]);
// V1V2
theNormals[1] = theEdges[1].Crossed (theEdges[2]);
theNormals[1] = theEdges[1].Crossed (theEdges[4]);
// V0V2
theNormals[2] = theEdges[0].Crossed (theEdges[2]);
theNormals[2] = theEdges[0].Crossed (theEdges[5]);
// Near
theNormals[3] = theEdges[3].Crossed (theEdges[5]);
theNormals[3] = theEdges[3].Crossed (theEdges[4]);
// Far
theNormals[4] = -theNormals[3];
}

27
tests/bugs/vis/bug27008 Normal file
View File

@ -0,0 +1,27 @@
puts "==========="
puts "OCC27008"
puts "==========="
puts ""
##########################################################################
# Visualization - polygonal selection algorithm does not work with MeshVS_Mesh
##########################################################################
pload VISUALIZATION XDE
vclear
vinit View1
meshfromstl m [locate_data_file head.stl]
vsetdispmode m 2
vselmode m 8 1
vselect 0 0 409 409 0 409
if { [vnbselected] != "56748" } { puts "Error: the number of selected elements differs for mode 8" }
vdump $imagedir/${casename}_mode_8.png
vselect 0 0
vselmode m 8 0
vselmode m 1 1
vselect 0 0 409 409 0 409
if { [vnbselected] != "30830" } { puts "Error: the number of selected elements differs for mode 1" }
vdump $imagedir/${casename}_mode_1.png