From: vpa Date: Fri, 28 Oct 2016 12:03:38 +0000 (+0300) Subject: 0027008: Visualization - polygonal selection algorithm does not work with MeshVS_Mesh X-Git-Tag: V7_1_0_beta~38 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=d4507e82ba77fcc7f87fff7660c08903189fc4e0 0027008: Visualization - polygonal selection algorithm does not work with MeshVS_Mesh - correct calculation of normals for SelectMgr_TriangularFrustum; - test case for issue #27008 --- diff --git a/src/SelectMgr/SelectMgr_TriangularFrustum.cxx b/src/SelectMgr/SelectMgr_TriangularFrustum.cxx index 641e75461e..9a0bc8320a 100644 --- a/src/SelectMgr/SelectMgr_TriangularFrustum.cxx +++ b/src/SelectMgr/SelectMgr_TriangularFrustum.cxx @@ -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]; } diff --git a/tests/bugs/vis/bug27008 b/tests/bugs/vis/bug27008 new file mode 100644 index 0000000000..24a6bfdcf4 --- /dev/null +++ b/tests/bugs/vis/bug27008 @@ -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