+ }//if validCentroid
+ }//if numPointsFace
+ }//for facesIdx
+
+}
+
+/**
+* Checks if the normal from firstPointId, secPointId and centroid points away
+* from the vector centroid to contrPointId.
+* Used to check that the order used to create the new polygons is correct.
+*/
+bool CreateMeshFromPoints::isPointingCorrectly( int firstPointId, int secPointId, double(¢roid)[3], int contrPointId) {
+
+ double firstPoint[3], secPoint[3], contrPoint[3];
+ points->GetPoint(firstPointId, firstPoint);
+ points->GetPoint(secPointId, secPoint);
+
+ double firstVect[3], secVect[3], normal[3], contrVect[3];
+
+ vtkMath::Subtract(firstPoint, centroid, firstVect);
+ vtkMath::Subtract(secPoint, centroid, secVect);
+
+ points->GetPoint(contrPointId, contrPoint);
+ vtkMath::Subtract(contrPoint, centroid, contrVect);
+
+ vtkMath::Cross(firstVect, secVect, normal);
+ double dotCalc;
+ dotCalc = vtkMath::Dot(normal, contrVect);
+
+ return dotCalc<0;
+}
+
+/**
+* Checks if points on each side of the shapes represent a curve.
+*/
+bool CreateMeshFromPoints::CheckLinePointOrder(){
+ int sizePoints = bbGetInputLstX().size();
+ std::vector<int> lstIndexs = bbGetInputLstIndexs();
+ double point1[3], point2[3], point3[3];
+ double center[3];
+ double firstRadiusSum = 0;
+ double secondRadiusSum = 0;
+ for(int i = 0; i < lstIndexs[0] && lstIndexs[0] > 3; i+=3){
+ if(i+3 <= lstIndexs[0]){
+ points->GetPoint(i, point1);
+ points->GetPoint(i+1, point2);
+ points->GetPoint(i+2, point3);
+ firstRadiusSum += vtkMath::Solve3PointCircle(point1, point2, point3, center);