25 start1 = p1->at(0).Position;
26 end1 = p1->at(p1->size() - 1).Position;
27 start2 = p2->at(0).Position;
28 end2 = p2->at(p2->size() - 1).Position;
37 if (pPath->size() < 2)
39 printf(
"ERROR: path is too short\n");
45 for (
auto element : *pPath)
48 element.Position = res;
50 pResulting->push_back(element);
61 if (pPath->size() < 2)
63 printf(
"ERROR: path is too short\n");
69 for (
auto element : *pPath)
72 element.Position = res;
74 pResulting->push_back(element);
87 Eigen::Vector3d betaAxis;
98 Eigen::Vector3d end1_transformed_v, start2_v, end2_v;
99 convert(end1_transformed, end1_transformed_v);
104 Eigen::Vector3d zero = Eigen::Vector3d::Zero();
108 line1 -= end1_transformed_v;
124 Eigen::Vector3d rotated_ab_v;
126 convert(rotated_ab, rotated_ab_v);
130 rotated_ab_v = rot.matrix() * rotated_ab_v;
133 convert(rotated_ab_v, rotated);
140 Eigen::Vector3d sc_v;
145 sc_v = rot.matrix() * sc_v;
158 Eigen::Vector3d vector1, vector2;
163 Eigen::Vector3d vector1_xy, vector2_xy;
165 vector1_xy = vector1;
166 vector2_xy = vector2;
172 Eigen::Vector3d normal = Eigen::Vector3d::UnitZ();
174 if (vector1_xy.norm() == 0.0 || vector2_xy.norm() == 0)
184 Eigen::Vector3d rotated1, rotated_y;
191 Eigen::AngleAxisd rotation(fAlpha, Eigen::Vector3d::UnitZ());;
192 Eigen::AngleAxisd rotation_yaxis(sc2.
fTheta, Eigen::Vector3d::UnitZ());
195 rotated_y << 0.0, 1.0, 0.0;
200 rotated1 = rotation.matrix() * rotated1;
202 rotated_y = rotation_yaxis.matrix() * rotated_y;
204 betaAxis = rotated_y;
209 fAlpha *= 180.0 /
M_PI;
210 fBeta *= 180.0 /
M_PI;
216 Eigen::Vector3d vector1, vector1_rotated;
220 Eigen::AngleAxisd rotation_alpha(fAlpha / 180.0 *
M_PI, Eigen::Vector3d::UnitZ());
223 vector1_rotated = rotation_alpha.matrix() * vector1;
225 Eigen::AngleAxisd rot(-fBeta / 180.0 *
M_PI, betaAxis);
227 vector1_rotated = rot.matrix() * vector1_rotated;
229 convert(vector1_rotated, result);
236 Eigen::Vector3d vector1;
240 Eigen::AngleAxisd rot(fBeta / 180.0 *
M_PI, betaAxis);
241 vector1 = rot.matrix() * vector1;
244 Eigen::AngleAxisd rotation_alpha(-fAlpha / 180.0 *
M_PI, Eigen::Vector3d::UnitZ());
247 vector1 = rotation_alpha * vector1;
260 float u1, v1, u2, v2;
267 return u1 * v2 - v1 * u2;
313 float dx =
float(p1(0) - p2(0));
314 float dy =
float(p1(1) - p2(1));
329 float z =
float(dx - (m1(0) * dy) / m1(1));
330 float n =
float(m2(0) - (m1(0) * m2(1)) / m1(1));
343 res(0) = p2(0) + c2 * m2(0);
344 res(1) = p2(1) + c2 * m2(1);
357 Eigen::Vector3d axis = vector1.cross(vector2);
362 double c = normal.dot(vector1);
365 double d = normal.dot(axis) -
c;
370 return 2 *
M_PI - fAngle;
373 return (
float) fAngle;
380 Eigen::Vector3d plane_normal = linevector;
381 float d = (
float) - plane_normal.dot(point);
384 float z =
float(- plane_normal(0) * linepoint(0) - plane_normal(1) * linepoint(1) - plane_normal(2) * linepoint(2) - d);
385 float n =
float(plane_normal(0) * linevector(0) + plane_normal(1) * linevector(1) + plane_normal(2) * linevector(2));
390 linevector = k * linevector;
391 linevector += linepoint;
412 Eigen::Vector3d vector = Eigen::Vector3d::UnitZ();
413 Eigen::AngleAxisd rotation_y(in.
fPhi, Eigen::Vector3d::UnitY());
414 Eigen::AngleAxisd rotation_z(in.
fTheta, Eigen::Vector3d::UnitZ());
418 vector = rotation_y.matrix() * vector;
421 vector = rotation_z.matrix() * vector;
437 out = vec.cast<
float>();
474 if (out.
fPhi > 180.0)
483 Eigen::Vector3d vec(in(0), in(1), in(2));