From 1a5b6111398aa346bd621b19b4884cb0359a4ebf Mon Sep 17 00:00:00 2001 From: Pablo Garzon Date: Thu, 13 Apr 2023 12:10:50 +0200 Subject: [PATCH] #3502 Bug close surface in CreateMeshFromPoints --- bbtk_creaVtk_PKG/src/bbcreaVtkCreateMeshFromPoints.cxx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkCreateMeshFromPoints.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkCreateMeshFromPoints.cxx index 194c378..f32a210 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkCreateMeshFromPoints.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkCreateMeshFromPoints.cxx @@ -94,9 +94,6 @@ void CreateMeshFromPoints::Process() bool altFace1open = lstX[0] != lstX[firstId2] && lstY[0] != lstY[firstId2] && lstZ[0] != lstZ[firstId2]; bool altFace2open = lstX[lastId1] != lstX[lastId2] && lstY[lastId1] != lstY[lastId2] && lstZ[lastId1] != lstZ[lastId2]; - //bool closedLineOrd = !altFace1open && !altFace2open; - - //isClosedCont = !face1open && !face2open; isClosedCont = false; if(bbGetInputCloseSurface()) { @@ -151,8 +148,9 @@ void CreateMeshFromPoints::CloseContourSides(std::vector lstIndexs, bool uP int firstIndex, end, centroidId, numPointsFace, contraryId; int increment = uPointOrder?1:sizeLstIdexes; double centroid[3]; + int numProcessFaces = sizeLstIdexes > 1?2:1; - for(int facesIdx = 0; facesIdx < 2; facesIdx++){ + for(int facesIdx = 0; facesIdx < numProcessFaces; facesIdx++){ std::fill(std::begin(centroid), std::end(centroid), 0); if(facesIdx == 0) { @@ -186,8 +184,6 @@ void CreateMeshFromPoints::CloseContourSides(std::vector lstIndexs, bool uP triangleStrip1->GetPointIds()->SetId(triangleIndex+2,initial);//2 triangleStrip1->GetPointIds()->SetId(triangleIndex+3,centroidId);//3 } - //else{ - //} triangleIndex+=2; } cells->InsertNextCell(triangleStrip1); @@ -202,8 +198,6 @@ void CreateMeshFromPoints::CloseContourSides(std::vector lstIndexs, bool uP triangleStrip1->GetPointIds()->SetId(triangleIndex+2,triangleStripStart); triangleStrip1->GetPointIds()->SetId(triangleIndex+3,centroidId); } - //else{ - //} triangleIndex+=2; } cells->InsertNextCell(triangleStrip1); -- 2.47.1