]> Creatis software - creaVtk.git/commitdiff
#3502 Bug close surface in CreateMeshFromPoints
authorPablo Garzon <garzon@ei-pfe-706.creatis.insa-lyon.fr>
Thu, 13 Apr 2023 10:10:50 +0000 (12:10 +0200)
committerPablo Garzon <garzon@ei-pfe-706.creatis.insa-lyon.fr>
Thu, 13 Apr 2023 10:10:50 +0000 (12:10 +0200)
bbtk_creaVtk_PKG/src/bbcreaVtkCreateMeshFromPoints.cxx

index 194c3780f0940395ea86a8af42385f6282240920..f32a210e5feb9fcdc472de48bfa62047257574a4 100644 (file)
@@ -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<int> 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<int> 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<int> lstIndexs, bool uP
                                                        triangleStrip1->GetPointIds()->SetId(triangleIndex+2,triangleStripStart);
                                                        triangleStrip1->GetPointIds()->SetId(triangleIndex+3,centroidId);
                                                }
-                                               //else{
-                                               //}
                                                triangleIndex+=2;
                                        }
                                        cells->InsertNextCell(triangleStrip1);