From 886a97a2e4a10cdec093bc2555a12b709a357512 Mon Sep 17 00:00:00 2001 From: eap Date: Sat, 6 May 2006 08:16:25 +0000 Subject: [PATCH] fix QuadToTri() on quadratic elements not bound to shape --- src/SMESH/SMESH_MeshEditor.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index d54b9a8b4..4f335dcd4 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -879,7 +879,9 @@ bool SMESH_MeshEditor::QuadToTri (map & theElems, // get surface elem is on if ( aShapeId != helper.GetSubShapeID() ) { surface.Nullify(); - TopoDS_Shape shape = aMesh->IndexToShape( aShapeId ); + TopoDS_Shape shape; + if ( aShapeId > 0 ) + shape = aMesh->IndexToShape( aShapeId ); if ( !shape.IsNull() && shape.ShapeType() == TopAbs_FACE ) { TopoDS_Face face = TopoDS::Face( shape ); surface = BRep_Tool::Surface( face ); @@ -1102,7 +1104,9 @@ bool SMESH_MeshEditor::QuadToTri (std::map & theEle int aShapeId = FindShape( elem ); if ( aShapeId != helper.GetSubShapeID() ) { surface.Nullify(); - TopoDS_Shape shape = aMesh->IndexToShape( aShapeId ); + TopoDS_Shape shape; + if ( aShapeId > 0 ) + shape = aMesh->IndexToShape( aShapeId ); if ( !shape.IsNull() && shape.ShapeType() == TopAbs_FACE ) { TopoDS_Face face = TopoDS::Face( shape ); surface = BRep_Tool::Surface( face ); -- 2.39.2