Salome HOME
0020656: EDF 883 SMESH: A face is badly meshed with BlSurf - Netgen1D2D is OK BR_WIN_INDUS_514 V5_1_4_BR V5_1_4 V5_1_4_patch01 V5_1_4_patch02 V5_1_4_patch03 V5_1_4rc2 V5_1_4rc3
authoreap <eap@opencascade.com>
Tue, 18 May 2010 13:42:25 +0000 (13:42 +0000)
committereap <eap@opencascade.com>
Tue, 18 May 2010 13:42:25 +0000 (13:42 +0000)
   * Check if blsurf vertex tag corresponds to a geom vertex id as there are same vertex tags for points on geom vertices, points of enforced vertices and points of attracted vertices

src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx

index 69947196809ac54bcde401094e577037f9bdd1f4..b627a7cbe7e1887b2a8f7026d4123aa21de167f0 100644 (file)
@@ -1242,15 +1242,18 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
     mesh_get_vertex_coordinates(msh, iv, xyz);
     mesh_get_vertex_tag(msh, iv, &tag);
     // Issue 0020656. Use vertex coordinates
-    // GDD: commented because enforced vertices
-    // are badly taken into account
-    //if ( tag ) {
-    //  gp_Pnt p = BRep_Tool::Pnt( TopoDS::Vertex(pmap(tag)));
-    //  xyz[0] = p.X(); xyz[1] = p.Y(); xyz[2] = p.Z();
-    //}
+    if ( tag > 0 && tag <= pmap.Extent() ) {
+      TopoDS_Vertex v = TopoDS::Vertex(pmap(tag));
+      double tol = BRep_Tool::Tolerance( v );
+      gp_Pnt p = BRep_Tool::Pnt( v );
+      if ( p.IsEqual( gp_Pnt( xyz[0], xyz[1], xyz[2]), 2*tol))
+        xyz[0] = p.X(), xyz[1] = p.Y(), xyz[2] = p.Z();
+      else
+        tag = 0; // enforced or attracted vertex
+    }
     nodes[iv] = meshDS->AddNode(xyz[0], xyz[1], xyz[2]);
     // internal point are tagged to zero
-    if(tag){
+    if(tag > 0 && tag <= pmap.Extent() ){
       meshDS->SetNodeOnVertex(nodes[iv], TopoDS::Vertex(pmap(tag)));
       tags[iv] = false;
     } else {