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];
+
+ //bool closedLineOrd = !altFace1open && !altFace2open;
+
+ //isClosedCont = !face1open && !face2open;
+ isClosedCont = false;
if(bbGetInputCloseSurface())
{
//false = Open Contour
//true = Closed Contour
if(!face1open && !face2open)
- {
+ {
+ isClosedCont = true;
CloseContourSides(lstIndexs, true);
- }else{
+ }
+ else if(!altFace1open && !altFace2open)
+ {
+ isClosedCont = true;
+ CloseContourSides(lstIndexs, false);
+ }
+ else{
CloseOpenContourSurface(lstIndexs);
}
}
bool normalOrder = isPointingCorrectly(firstIndex, firstIndex+increment, centroid, contraryId);
centroidId = points->InsertNextPoint(centroid[0], centroid[1], centroid[2]);
vtkSmartPointer<vtkTriangleStrip> triangleStrip1 = vtkSmartPointer<vtkTriangleStrip>::New();
- triangleStrip1->GetPointIds()->SetNumberOfIds(numPointsFace*2+1);
+ triangleStrip1->GetPointIds()->SetNumberOfIds(numPointsFace*2 + (!isClosedCont?2:0));
if( normalOrder )
{
int initial = firstIndex;
int triangleIndex = 0;
for(int index = initial; index < end; index+=increment){
triangleStrip1->GetPointIds()->SetId(triangleIndex,index);
- if(index+increment >= end){
- triangleStrip1->GetPointIds()->SetId(triangleIndex+1,initial);//2
- triangleStrip1->GetPointIds()->SetId(triangleIndex+2,centroidId);//3
- }
- else{
- triangleStrip1->GetPointIds()->SetId(triangleIndex+1,centroidId);//1
+ triangleStrip1->GetPointIds()->SetId(triangleIndex+1,centroidId);//1
+ if(index+increment >= end && !isClosedCont){
+ triangleStrip1->GetPointIds()->SetId(triangleIndex+2,initial);//2
+ triangleStrip1->GetPointIds()->SetId(triangleIndex+3,centroidId);//3
}
+ //else{
+ //}
triangleIndex+=2;
}
cells->InsertNextCell(triangleStrip1);
int triangleStripStart = end-1;
for(int index = triangleStripStart; index > initial; index-=increment){
triangleStrip1->GetPointIds()->SetId(triangleIndex,index);
- if(index-increment <= initial){
- triangleStrip1->GetPointIds()->SetId(triangleIndex+1,triangleStripStart);
- triangleStrip1->GetPointIds()->SetId(triangleIndex+2,centroidId);
- }else{
- triangleStrip1->GetPointIds()->SetId(triangleIndex+1,centroidId);
+ triangleStrip1->GetPointIds()->SetId(triangleIndex+1,centroidId);
+ if(index-increment <= initial && !isClosedCont){
+ triangleStrip1->GetPointIds()->SetId(triangleIndex+2,triangleStripStart);
+ triangleStrip1->GetPointIds()->SetId(triangleIndex+3,centroidId);
}
+ //else{
+ //}
triangleIndex+=2;
}
cells->InsertNextCell(triangleStrip1);
secondRadiusSum += vtkMath::Solve3PointCircle(point1, point2, point3, center);
}
}
- //cout << firstRadiusSum << endl;
- //cout << secondRadiusSum << endl;
+
return firstRadiusSum > secondRadiusSum;
}
// Here we initialize the input 'In' to 0
// bbSetInputIn(0);
bbSetInputCloseSurface(false);
+ isClosedCont = NULL;
points = NULL;
cells = NULL;
polydata = NULL;