std::vector<double> lstY = bbGetInputLstY();
std::vector<double> lstZ = bbGetInputLstZ();
std::vector<int> lstIndexs = bbGetInputLstIndexs();
- if ( (lstIndexs.size()<=1) || (lstX.size()==0) || (lstX.size()!=lstY.size()) || (lstY.size()!=lstZ.size()) )
+ if ( (lstIndexs.size()<1) || (lstX.size()==0) || (lstX.size()!=lstY.size()) || (lstY.size()!=lstZ.size()) )
{
printf("Warning! CreateMeshFromPoints::Process: List of points X Y Z and LstIndexes is not correct\n");
bbSetOutputOut(NULL);
triangleStrip->GetPointIds()->SetId(ii*2+1,iSeg2);
iSeg1++;
iSeg2++;
- if (iSeg1>=maxSegment1) { iSeg1=maxSegment1-1; }
- if (iSeg2>=maxSegment2) { iSeg2=maxSegment2-1; }
+ if (iSeg1>=maxSegment1) { iSeg1=maxSegment1-1; }
+ if (iSeg2>=maxSegment2) { iSeg2=maxSegment2-1; }
} // for ii
iGeneral=iGeneral+sizeSegment1;
cells->InsertNextCell(triangleStrip);
} //for LstIndexs
- int lastId1 = lstIndexs[0]-1;
- int lastId2 = sizeLstX - 1;
- int firstId2 = sizeLstX - lstIndexs[sizeLstIdexes - 1];
- bool face1open = lstX[0] != lstX[lastId1] && lstY[0] != lstY[lastId1] && lstZ[0] != lstZ[lastId1];
- bool face2open = lstX[firstId2] != lstX[lastId2] && lstY[firstId2] != lstY[lastId2] && lstZ[firstId2] != lstZ[lastId2];
-
- 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];
-
- isClosedCont = false;
if(bbGetInputCloseSurface())
{
+ int lastId1 = lstIndexs[0]-1;
+ int lastId2 = sizeLstX - 1;
+ int firstId2 = sizeLstX - lstIndexs[sizeLstIdexes - 1];
+ bool face1open = lstX[0] != lstX[lastId1] && lstY[0] != lstY[lastId1] && lstZ[0] != lstZ[lastId1];
+ bool face2open = lstX[firstId2] != lstX[lastId2] && lstY[firstId2] != lstY[lastId2] && lstZ[firstId2] != lstZ[lastId2];
+
+ 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];
+
+ isClosedCont = false;
//false = Open Contour
//true = Closed Contour
if(!face1open && !face2open)
}// if listXYZ size
//printf("PG CreateMeshFromPoints::Process: End\n");
}
-
/**
* Closes the sides of the contour
* iterates in one way or the other, depending on the order of the points and calculated vectors.
int increment = uPointOrder?1:sizeLstIdexes;
double centroid[3];
int numProcessFaces = sizeLstIdexes > 1?2:1;
-
for(int facesIdx = 0; facesIdx < numProcessFaces; facesIdx++){
std::fill(std::begin(centroid), std::end(centroid), 0);
if(facesIdx == 0)
bool samePoint = true;
int splineMidPoint = numPoints/2;
bool collinear = true;
-
+
points->GetPoint(start, firstPoint);
points->GetPoint(splineMidPoint, middlePoint);
vtkMath::Subtract(middlePoint, firstPoint, vector1);
-
+
for(int i = start; i < end; i+=increment){
points->GetPoint(i, currPoint);
if(samePoint && i > start && (currPoint[0] != prevPoint[0] || currPoint[1] != prevPoint[1] || currPoint[2] != prevPoint[2])){