26 float sinCalc = sin(angle);
27 float cosCalc = cos(angle);
34 newPoly.
vertices[idx] = (x * cosCalc) + (y * sinCalc);
35 newPoly.
vertices[idx+1] = (x * -sinCalc) + (y * cosCalc);
86 if (!(std::abs(xProd[0]) <
eps && std::abs(xProd[1]) <
eps && std::abs(xProd[2]) <
eps)) {
89 double sin = sqrt(xProd[0]*xProd[0] + xProd[1]*xProd[1] + xProd[2]*xProd[2]);
91 double v[9] = {0, -xProd[2], xProd[1], xProd[2], 0, -xProd[0], -xProd[1], xProd[0], 0};
92 double scalar = (1.0f-cos)/(sin*sin);
95 vSquared[0] = (v[0]*v[0] + v[1]*v[3] + v[2]*v[6])*scalar;
96 vSquared[1] = (v[0]*v[1] + v[1]*v[4] + v[2]*v[7])*scalar;
97 vSquared[2] = (v[0]*v[2] + v[1]*v[5] + v[2]*v[8])*scalar;
98 vSquared[3] = (v[3]*v[0] + v[4]*v[3] + v[5]*v[6])*scalar;
99 vSquared[4] = (v[3]*v[1] + v[4]*v[4] + v[5]*v[7])*scalar;
100 vSquared[5] = (v[3]*v[2] + v[4]*v[5] + v[5]*v[8])*scalar;
101 vSquared[6] = (v[6]*v[0] + v[7]*v[3] + v[8]*v[6])*scalar;
102 vSquared[7] = (v[6]*v[1] + v[7]*v[4] + v[8]*v[7])*scalar;
103 vSquared[8] = (v[6]*v[2] + v[7]*v[5] + v[8]*v[8])*scalar;
105 double *R =
new double[9];
106 R[0] = 1 + v[0] + vSquared[0];
107 R[1] = 0 + v[1] + vSquared[1];
108 R[2] = 0 + v[2] + vSquared[2];
109 R[3] = 0 + v[3] + vSquared[3];
110 R[4] = 1 + v[4] + vSquared[4];
111 R[5] = 0 + v[5] + vSquared[5];
112 R[6] = 0 + v[6] + vSquared[6];
113 R[7] = 0 + v[7] + vSquared[7];
114 R[8] = 1 + v[8] + vSquared[8];
120 double *R =
new double[9];
157 if (!(std::abs(xProd[0]) <
eps && std::abs(xProd[1]) <
eps && std::abs(xProd[2]) <
eps )) {
166 vertices[0] = newPoly.
vertices[idx] * R[0]
169 vertices[1] = newPoly.
vertices[idx] * R[3]
172 vertices[2] = newPoly.
vertices[idx] * R[6]
176 newPoly.
vertices[idx] = vertices[0];
177 newPoly.
vertices[idx+1] = vertices[1];
178 newPoly.
vertices[idx+2] = vertices[2];
211 double normalB[3] = { 0, 0, 1 };
218 if (!(std::abs(xProd[0]) <
eps && std::abs(xProd[1]) <
eps && std::abs(xProd[2]) <
eps )) {
230 if (newPoly.XYPlane != 1) {
231 for (
int i = 0; i < newPoly.numberOfNodes; i++) {
235 vertices[0] = newPoly.vertices[idx] * R[0]
236 + newPoly.vertices[idx+1] * R[1]
237 + newPoly.vertices[idx+2] * R[2];
239 vertices[1] = newPoly.vertices[idx] * R[3]
240 + newPoly.vertices[idx+1] * R[4]
241 + newPoly.vertices[idx+2] * R[5];
243 vertices[2] = newPoly.vertices[idx] * R[6]
244 + newPoly.vertices[idx+1] * R[7]
245 + newPoly.vertices[idx+2] * R[8];
248 newPoly.vertices[idx] = vertices[0];
249 newPoly.vertices[idx+1] = vertices[1];
250 newPoly.vertices[idx+2] = vertices[2];
255 tempIntpts.
x1 = intersection.
x1 * R[0]
256 + intersection.
y1 * R[1]
257 + intersection.
z1 * R[2];
259 tempIntpts.
y1 = intersection.
x1 * R[3]
260 + intersection.
y1 * R[4]
261 + intersection.
z1 * R[5];
263 tempIntpts.
z1 = intersection.
x1 * R[6]
264 + intersection.
y1 * R[7]
265 + intersection.
z1 * R[8];
267 tempIntpts.
x2 = intersection.
x2 * R[0]
268 + intersection.
y2 * R[1]
269 + intersection.
z2 * R[2];
271 tempIntpts.
y2 = intersection.
x2 * R[3]
272 + intersection.
y2 * R[4]
273 + intersection.
z2 * R[5];
275 tempIntpts.
z2 = intersection.
x2 * R[6]
276 + intersection.
y2 * R[7]
277 + intersection.
z2 * R[8];
294 tempTripPts.push_back(tmpPt);
299 for (
unsigned int i = 0; i < intersection.
triplePointsIdx.size(); i++) {
301 tempTripPts.push_back(triplePoints[idx]);
303 tempIntpts.
x1 = intersection.
x1;
304 tempIntpts.
y1 = intersection.
y1;
305 tempIntpts.
z1 = intersection.
z1;
306 tempIntpts.
x2 = intersection.
x2;
307 tempIntpts.
y2 = intersection.
y2;
308 tempIntpts.
z2 = intersection.
z2;
324 double maxX, minX, maxY, minY, maxZ, minZ;
335 else if (minX > newPoly.
vertices[idx]) {
339 if (maxY < newPoly.
vertices[idx+1]) {
342 else if (minY > newPoly.
vertices[idx+1]) {
346 if (maxZ < newPoly.
vertices[idx+2]) {
349 else if (minZ > newPoly.
vertices[idx+2]) {
366 std::cout<<
"\nBounding Box:\n";
423 for (
int jj = 0; jj<2; jj++) {
434 int index = (nVertices2-1) * 3;
438 temp[0] = F2->
vertices[index] - vertex1[0];
439 temp[1] = F2->
vertices[index+1] - vertex1[1];
440 temp[2] = F2->
vertices[index+2] - vertex1[2];
445 for (
int i = 0; i < nVertices2; i++) {
449 temp[0] = F2->
vertices[idx] - vertex1[0];
450 temp[1] = F2->
vertices[idx+1] - vertex1[1];
451 temp[2] = F2->
vertices[idx+2] - vertex1[2];
454 if (std::abs(prevdist) <
eps) {
464 int countidx = count*3;
465 inters2[countidx] = F2->
vertices[idx];
466 inters2[countidx+1] = F2->
vertices[idx+1];
467 inters2[countidx+2] = F2->
vertices[idx+2];
472 double currTimesPrev = currdist * prevdist;
473 if (std::abs(currTimesPrev) <
eps) {
477 if (currTimesPrev < 0) {
481 double c = std::abs(prevdist)/(std::abs(currdist)+std::abs(prevdist));
482 int countidx = count * 3;
484 inters2[countidx] = F2->
vertices[index]
486 inters2[countidx+1] = F2->
vertices[index+1]
488 inters2[countidx+2] = F2->
vertices[index+2]
495 inters2[countidx] = F2->
vertices[idx]
497 inters2[countidx+1] = F2->
vertices[idx+1]
499 inters2[countidx+2] = F2->
vertices[idx+2]
514 inters2[3] = inters2[0];
515 inters2[4] = inters2[1];
516 inters2[5] = inters2[2];
519 for (
int k = 0; k<6; k++) {
520 if (std::abs(inters2[k]) <
eps) {
526 inters[jindx] = inters2[0];
527 inters[jindx+1] = inters2[1];
528 inters[jindx+2] = inters2[2];
529 inters[jindx+3] = inters2[3];
530 inters[jindx+4] = inters2[4];
531 inters[jindx+5] = inters2[5];
542 if (count >2) { std::cout<<
"Error in findIntersections()\n"; }
549 double tempAry[4] = {inters[o], inters[o+3], inters[o+6], inters[o+9]};
553 if (!(s[0] + s[1] == 1 || s[0] + s[1] == 5)) {
560 intPts.
x1 = inters[idx1];
561 intPts.
y1 = inters[idx1+1];
562 intPts.
z1 = inters[idx1+2];
563 intPts.
x2 = inters[idx2];
564 intPts.
y2 = inters[idx2+1];
565 intPts.
z2 = inters[idx2+2];
568 if (s[1] + s[2] == 1) {
570 else if (s[1] + s[2] == 5 ) {
607 int FRAM(
IntPoints &intPts,
unsigned int count, std::vector<IntPoints> &intPtsList,
Poly &newPoly,
Poly &poly2,
Stats &pstats, std::vector<TriplePtTempData> &tempData, std::vector<Point> &triplePoints, std::vector<IntPoints> &tempIntPts) {
619 double shrinkLimit = 0.9 *
magnitude(intPts.
x1 - intPts.
x2, intPts.
y1 - intPts.
y2, intPts.
z1 - intPts.
z2);
681 double intersection[6] = {intPts.
x1, intPts.
y1, intPts.
z1, intPts.
x2, intPts.
y2, intPts.
z2};
685 for (
int i = 0; i < intSize; i ++) {
691 if (dist < (minDistance-
eps) && dist >
eps) {
714 int intSize = tempIntPts.size();
715 double intersection[6] = {intPts.
x1, intPts.
y1, intPts.
z1, intPts.
x2, intPts.
y2, intPts.
z2};
718 for (
int i = 0; i < intSize; i ++) {
720 double int2[6] = {tempIntPts[i].x1, tempIntPts[i].y1, tempIntPts[i].z1,
721 tempIntPts[i].x2, tempIntPts[i].y2, tempIntPts[i].z2};
725 if (dist < minDistance && dist >
eps) {
728 else if (dist < eps) {
732 int size = tempTriPts.size();
733 for (
int i = 0; i < size; i++) {
735 if (std:: abs(pt.
x - tempTriPts[i].triplePoint.x) < eps
736 && std::abs(pt.
y - tempTriPts[i].triplePoint.y) < eps
737 && std::abs(pt.
z - tempTriPts[i].triplePoint.z) < eps) {
742 if (reject ==
true) {
772 double vect[3] = {(intPts.
x2-intPts.
x1), (intPts.
y2-intPts.
y1), (intPts.
z2-intPts.
z1)};
773 double dist =
magnitude(vect[0], vect[1], vect[2]);
776 int n = std::ceil(2 * dist /
h);
777 double stepSize = 1 / (double)n;
779 double pt[3] = {intPts.
x1, intPts.
y1, intPts.
z1};
785 for (
int i = 0; i < 2; i++) {
799 while (nodeCount <= n) {
812 if (firstPt ==
true && (dist > firstNodeMinDist)) {
813 if (firstPtDistToEdge < eps || firstPtDistToEdge >= minDist) {
821 if (dist > minDist) {
823 intPts.
x1 = ptOnIntersection.
x;
824 intPts.
y1 = ptOnIntersection.
y;
825 intPts.
z1 = ptOnIntersection.
z;
828 intPts.
x2 = ptOnIntersection.
x;
829 intPts.
y2 = ptOnIntersection.
y;
830 intPts.
z2 = ptOnIntersection.
z;
836 if (nodeCount >= n) {
870 int intersectionChecking(
struct Poly &newPoly, std::vector<Poly> &acceptedPoly, std::vector<IntPoints> &intPtsList,
struct Stats &pstats, std::vector<Point> &triplePoints) {
875 std::vector<unsigned int> tempIntersectList;
876 std::vector<IntPoints> tempIntPts;
877 std::vector<IntPoints> tempOriginalIntersection;
879 int newPolyIndex = acceptedPoly.size();
881 int intPtsIndex = intPtsList.size();
882 std::vector<unsigned int> encounteredGroups;
884 unsigned int count = 0;
885 std::vector<TriplePtTempData> tempData;
888 unsigned int size = acceptedPoly.size();
889 for (
unsigned int ii = 0; ii < size; ii++) {
900 tempOriginalIntersection.push_back(intersection);
905 int rejectCode =
FRAM(intersection, count, intPtsList, newPoly, acceptedPoly[ii], pstats, tempData, triplePoints, tempIntPts);
908 if (rejectCode == 0) {
912 intersection.
fract2 = newPolyIndex;
915 tempIntersectList.push_back(ii);
921 tempIntPts.push_back(intersection);
926 newPoly.
groupNum = acceptedPoly[ii].groupNum;
928 else if (newPoly.
groupNum != acceptedPoly[ii].groupNum) {
929 encounteredGroups.push_back(acceptedPoly[ii].groupNum);
955 intPtsList.insert(intPtsList.end(),tempIntPts.begin(),tempIntPts.end());
958 for (
unsigned int i = 0; i < tempIntersectList.size(); i++) {
961 acceptedPoly[tempIntersectList[i]].intersectionIndex.push_back(intPtsIndex + i);
971 unsigned int tripIndex = triplePoints.size();
972 for (
unsigned int j = 0; j < tempData.size(); j++) {
974 triplePoints.push_back(tempData[j].triplePoint);
977 for (
unsigned int ii = 0; ii < tempData[j].intIndex.size(); ii++) {
978 unsigned int idx = tempData[j].intIndex[ii];
979 intPtsList[idx].triplePointsIdx.push_back(tripIndex + j);
987 updateGroups(newPoly, acceptedPoly, encounteredGroups, pstats, newPolyIndex);
993 for (
unsigned int i = 0; i < tempIntPts.size(); i++) {
994 double length =
magnitude(tempOriginalIntersection[i].
x1 - tempOriginalIntersection[i].
x2,
995 tempOriginalIntersection[i].
y1 - tempOriginalIntersection[i].
y2,
996 tempOriginalIntersection[i].
z1 - tempOriginalIntersection[i].
z2);
1003 double newLength =
magnitude(tempIntPts[i].
x1 - tempIntPts[i].x2,
1004 tempIntPts[i].
y1 - tempIntPts[i].y2,
1005 tempIntPts[i].
z1 - tempIntPts[i].z2);
1027 double line[6] = {intPts.
x1, intPts.
y1, intPts.
z1, intPts.
x2, intPts.
y2, intPts.
z2};
1030 for (
int i = 1; i < nNodes; i++) {
1038 if (dist < minDist && dist >
eps) {
1055 const double sqrLineLen =
sqrMagnitude(line[0]-line[3], line[1]-line[4], line[2]-line[5]);
1056 if (sqrLineLen <
eps) {
1058 return magnitude(point[0]-line[0], point[1]-line[1], point[2]-line[2]);
1061 double pL1[3] = { point[0]-line[0], point[1]-line[1], point[2]-line[2] };
1062 double L1L2[3] = { line[3]-line[0], line[4]-line[1], line[5]-line[2] };
1065 const double t = std::max(0.0, std::min(1.0,
dotProduct(pL1, L1L2) / sqrLineLen));
1067 double projection[3] = { t * L1L2[0], t * L1L2[1], t * L1L2[2] };
1068 projection[0] += line[0];
1069 projection[1] += line[1];
1070 projection[2] += line[2];
1072 return magnitude(projection[0]-point[0], projection[1]-point[1], projection[2]-point[2]);
1080 const double sqrLineLen =
sqrMagnitude(line[0]-line[3], line[1]-line[4], line[2]-line[5]);
1081 if (sqrLineLen <
eps) {
1083 return magnitude(point.
x-line[0], point.
y-line[1], point.
z-line[2]);
1086 double pL1[3] = { point.
x-line[0], point.
y-line[1], point.
z-line[2] };
1087 double L1L2[3] = { line[3]-line[0], line[4]-line[1], line[5]-line[2] };
1090 const double t = std::max(0.0, std::min(1.0,
dotProduct(pL1, L1L2) / sqrLineLen));
1092 double projection[3] = { t * L1L2[0], t * L1L2[1], t * L1L2[2] };
1093 projection[0] += line[0];
1094 projection[1] += line[1];
1095 projection[2] += line[2];
1097 return magnitude(projection[0]-point.
x, projection[1]-point.
y, projection[2]-point.
z);
1115 double temp[3] = { line[3]-line[0], line[4]-line[1], line[5]-line[2] };
1117 double endPttoEndPt_Dist = std::sqrt(temp[0] * temp[0] + temp[1] * temp[1] + temp[2] * temp[2]);
1120 temp[0] = pt[0] - line[0];
1121 temp[1] = pt[1] - line[1];
1122 temp[2] = pt[2] - line[2];
1124 double endPtToPt_Dist = std::sqrt(temp[0] * temp[0] + temp[1] * temp[1] + temp[2] * temp[2]);
1127 temp[0] = line[3] - pt[0];
1128 temp[1] = line[4] - pt[1];
1129 temp[2] = line[5] - pt[2];
1131 double ptToEndPt_Dist = std::sqrt(temp[0] * temp[0] + temp[1] * temp[1] + temp[2] * temp[2]);
1135 double result = endPtToPt_Dist + ptToEndPt_Dist - endPttoEndPt_Dist;
1136 if (-
eps < result && result <
eps) {
1158 double temp[3] = { line[3]-line[0], line[4]-line[1], line[5]-line[2] };
1160 double endPttoEndPt_Dist = std::sqrt(temp[0] * temp[0] + temp[1] * temp[1] + temp[2] * temp[2]);
1163 temp[0] = pt.
x - line[0];
1164 temp[1] = pt.
y - line[1];
1165 temp[2] = pt.
z - line[2];
1167 double endPtToPt_Dist = std::sqrt(temp[0] * temp[0] + temp[1] * temp[1] + temp[2] * temp[2]);
1170 temp[0] = line[3] - pt.
x;
1171 temp[1] = line[4] - pt.
y;
1172 temp[2] = line[5] - pt.
z;
1174 double ptToEndPt_Dist = std::sqrt(temp[0] * temp[0] + temp[1] * temp[1] + temp[2] * temp[2]);
1178 double result = endPtToPt_Dist + ptToEndPt_Dist - endPttoEndPt_Dist;
1179 if (-
eps < result && result <
eps) {
1200 double line[6] = {intPts.
x1, intPts.
y1, intPts.
z1, intPts.
x2, intPts.
y2, intPts.
z2};
1210 int onEdgeCount = 0;
1233 std::sort(endPtsToEdge, endPtsToEdge + 4);
1237 if ((endPtsToEdge[0] <
h && endPtsToEdge[1] <
h) && endPtsToEdge[0] >
eps) {
1244 if (dist < minDist && dist >
eps) {
1252 else if (dist < eps) {
1260 const static double minDist2 = 0.4 *
h;
1272 if (onEdgeCount >= 2) {
1281 #ifdef DISABLESHORTENINGINT 1306 double v1xv2[3] = {(v1[1]*v2[2])-(v1[2]*v2[1]), (v1[2]*v2[0])-(v1[0]*v2[2]), (v1[0]*v2[1])-(v1[1]*v2[0])};
1308 double v21[3] = {p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]};
1309 double v21xv2[3] = {(v21[1]*v2[2])-(v21[2]*v2[1]), (v21[2]*v2[0])-(v21[0]*v2[2]), (v21[0]*v2[1])-(v21[1]*v2[0])};
1312 double temp3 = temp2/denom;
1313 temp[0] = v1[0]*temp3;
1314 temp[1] = v1[1]*temp3;
1315 temp[2] = v1[2]*temp3;
1318 pt.
x = temp[0] + p1[0];
1319 pt.
y = temp[1] + p1[1];
1320 pt.
z = temp[2] + p1[2];
1341 const double p1[3] = {line1[0], line1[1], line1[2]};
1342 const double p2[3] = {line2[0], line2[1], line2[2]};
1344 v1[0] = line1[0] - line1[3];
1345 v1[1] = line1[1] - line1[4];
1346 v1[2] = line1[2] - line1[5];
1348 v2[0] = line2[0] - line2[3];
1349 v2[1] = line2[1] - line2[4];
1350 v2[2] = line2[2] - line2[5];
1352 double p1p2[3] = {p1[0]-p2[0], p1[1]-p2[1], p1[2]-p2[2]};
1370 double temp[3] = {pt.
x, pt.
y, pt.
z};
1393 if (dist < temp)
return dist;
1415 double minDist = 1.5*
h;
1416 double intEndPts[6] = {intPts.
x1, intPts.
y1, intPts.
z1, intPts.
x2, intPts.
y2, intPts.
z2};
1421 for (
int i = 0; i < n; i++) {
1423 unsigned int intersectionIndex2 = intPtsList.size() + count;
1425 double line[6] = {intPtsList[intersectionIndex].x1, intPtsList[intersectionIndex].y1, intPtsList[intersectionIndex].z1, intPtsList[intersectionIndex].x2, intPtsList[intersectionIndex].y2, intPtsList[intersectionIndex].z2};
1437 if (dist1 >
eps && dist1 <
h) {
1445 double U[3] = {line[3]-line[0], line[4]-line[1], line[5]-line[2]};
1446 double V[3] = {intPts.
x2 - intPts.
x1, intPts.
y2 - intPts.
y1, intPts.
z2 - intPts.
z1};
1452 if (dotProd < -0.68199836 || dotProd > 0.68199836) {
1458 double point[3] = {pt.
x, pt.
y, pt.
z};
1461 if (dist1 <
h || dist2 <
h) {
1466 if (dist1 <
h || dist2 <
h) {
1471 for(
unsigned int k = 0; k < intPtsList[intersectionIndex].triplePointsIdx.size(); k++) {
1472 unsigned int idx = intPtsList[intersectionIndex].triplePointsIdx[k];
1473 double triplePt[3] = {triplePoints[idx].x, triplePoints[idx].y,triplePoints[idx].z};
1475 if (dist1 < minDist) {
1487 for (k = 0; k < tempData.size(); k++) {
1488 if (std::abs(pt.
x - tempData[k].triplePoint.x) <
eps 1489 && std::abs(pt.
y - tempData[k].triplePoint.y) <
eps 1490 && std::abs(pt.
z - tempData[k].triplePoint.z) <
eps) {
1497 if (duplicate == 1) {
1503 tempData[k].intIndex.push_back(intersectionIndex2);
1509 localTemp.
intIndex.push_back(intersectionIndex);
1510 localTemp.
intIndex.push_back(intersectionIndex2);
1511 tempData.push_back(localTemp);
1518 unsigned int tripSize = tempData.size();
1521 if (tripSize != 0 ) {
1522 unsigned int y = tripSize-1;
1524 for (
unsigned int k = 0; k < y ; k++ ) {
1525 double point1[3] = {tempData[k].triplePoint.x, tempData[k].triplePoint.y, tempData[k].triplePoint.z};
1526 for (
unsigned int j = k+1; j < tripSize; j++) {
1527 double point2[3] = {tempData[j].triplePoint.x, tempData[j].triplePoint.y, tempData[j].triplePoint.z};
1529 if ( dist < minDist && dist >
eps ) {
void translate(Poly &newPoly, double *translation)
double euclideanDistance(double *A, double *B)
bool checkDistToNewIntersections(std::vector< IntPoints > &tempIntPts, IntPoints &intPts, std::vector< TriplePtTempData > &tempTriPts, double minDistance)
struct IntPoints polyAndIntersection_RotationToXY(struct IntPoints &intersection, Poly &newPoly, std::vector< Point > &triplePoints, std::vector< Point > &tempTripPts)
T magnitude(T x, T y, T z)
int * sortedIndex(const double *v, int n)
unsigned long long int shortIntersection
unsigned long long int closeToNode
unsigned long long int closeToEdge
unsigned long long int triple
double lineSegToLineSeg(const double *line1, const double *line2, Point &pt)
unsigned int intersectionsShortened
unsigned long long int interCloseToInter
void assignGroup(Poly &newPoly, Stats &pstats, int newPolyIndex)
bool parallel(double *v1, double *v2)
bool pointOnLineSeg(const double *pt, const double *line)
struct RejectionReasons rejectionReasons
bool checkDistanceFromNodes(struct Poly &poly, IntPoints &intPts, double minDist, Stats &pstats)
bool checkBoundingBox(Poly &poly1, Poly &poly2)
void updateGroups(Poly &newPoly, std::vector< Poly > &acceptedPoly, std::vector< unsigned int > &encounteredGroups, Stats &pstats, int newPolyIndex)
int FRAM(IntPoints &intPts, unsigned int count, std::vector< IntPoints > &intPtsList, Poly &newPoly, Poly &poly2, Stats &pstats, std::vector< TriplePtTempData > &tempData, std::vector< Point > &triplePoints, std::vector< IntPoints > &tempIntPts)
Point lineIntersection3D(const double *p1, double *v1, const double *p2, double *v2)
bool checkCloseEdge(Poly &poly1, IntPoints &intPts, double shrinkLimit, Stats &pstats)
double pointToLineSeg(const double *point, const double *line)
void applyRotation3D(Poly &newPoly, double *normalB)
int maxElmtIdx(double *v, int n)
void printBoundingBox(struct Poly &newPoly)
double * projection(const double *v1, const double *v2)
int checkForTripleIntersections(IntPoints &intPts, unsigned int count, std::vector< IntPoints > &intPtsList, Poly &newPoly, Poly &poly2, std::vector< TriplePtTempData > &tempData, std::vector< Point > &triplePoints)
T dotProduct(const T *A, const T *B)
std::vector< unsigned int > triplePointsIdx
void createBoundingBox(struct Poly &newPoly)
bool checkDistToOldIntersections(std::vector< IntPoints > &intPtsList, IntPoints &intPts, Poly &poly2, double minDistance)
struct IntPoints findIntersections(short &flag, Poly &poly1, Poly &poly2)
std::vector< unsigned int > intersectionIndex
double lineSegToLineSegSep(const double *line1, const double *line2)
T sqrMagnitude(T x, T y, T z)
int intersectionChecking(struct Poly &newPoly, std::vector< Poly > &acceptedPoly, std::vector< IntPoints > &intPtsList, struct Stats &pstats, std::vector< Point > &triplePoints)
bool intersectionShortened
bool shrinkIntersection(IntPoints &intPts, double *edge, double shrinkLimit, double firstNodeMinDist, double minDist)
Point lineFunction3D(double *v, double *point, double t)
T * crossProduct(const T *v1, const T *v2)
std::vector< int > intIndex
void applyRotation2D(Poly &newPoly, float angle)
double * sumDevAry3(double *v)
double * rotationMatrix(double *normalA, double *normalB)