36 const std::vector<UVector2>& vertices)
86 fDz(rhs.fDz), fVertices(rhs.fVertices),
87 fIsTwisted(rhs.fIsTwisted), fTessellatedSolid(0),
88 fMinBBoxVector(rhs.fMinBBoxVector), fMaxBBoxVector(rhs.fMaxBBoxVector),
89 fVisSubdivisions(rhs.fVisSubdivisions), fBoundBox(0),
90 fSurfaceArea(rhs.fSurfaceArea), fCubicVolume(rhs.fCubicVolume)
92 for (
size_t i=0; i<4; ++i) {
fTwist[i] = rhs.
fTwist[i]; }
106 if (
this == &rhs) {
return *
this; }
110 VUSolid::operator=(rhs);
119 for (
size_t i=0; i<4; ++i) {
fTwist[i] = rhs.
fTwist[i]; }
133 const double min_length = 5 * 1.e-6;
136 std::string errorDescription =
"InvalidSetup in \" ";
138 errorDescription +=
"\"";
167 for (
int i = 0; i < 4; ++i)
171 for (
int i = 0; i < 4; ++i)
179 for (
int j = 0; j < 2; j++)
181 for (
int i = 1; i < 4; ++i)
187 std::ostringstream message;
188 message <<
"Length segment is too small." << std::endl
189 <<
"Distance between " <<
fVertices[k - 1] <<
" and "
190 <<
fVertices[k] <<
" is only " << length <<
" mm !"
191 <<
"Vertices will be collapsed.";
193 UWarning, 1, message.str().c_str());
201 for (
int i = 0; i < 4; i++)
233 for (
int i = 0; i < 4; i++)
237 cross = (p.
x() - poly[i].
x) * (poly[j].y - poly[i].y) -
238 (p.
y() - poly[i].
y) * (poly[j].x - poly[i].x);
241 len2 = (poly[i] - poly[j]).mag2();
244 if (cross * cross <= len2 * halfCarTolerance * halfCarTolerance)
248 if (poly[i].y > poly[j].y)
259 if (poly[k].x != poly[l].x)
261 test = (p.
x() - poly[l].
x) / (poly[k].x - poly[l].x)
262 * (poly[k].
y - poly[l].
y) + poly[l].y;
271 if ((test >= (poly[l].y - halfCarTolerance))
272 && (test <= (poly[k].y + halfCarTolerance)))
296 if ((std::fabs(p.
x() - poly[0].
x) + std::fabs(p.
y() - poly[0].
y)) > halfCarTolerance)
318 double slope = ((l2.
y - l1.
y) / (l2.
x - l1.
x));
319 double predy = l1.
y + slope * (p.
x - l1.
x);
320 double dy = p.
y - predy;
330 bool squareComp = (dy * dy < (1 + slope * slope) * tol * tol);
373 if (std::fabs(p.
z()) <=
fDz + halfCarTolerance)
377 double cf = 0.5 * (
fDz - p.
z()) /
fDz;
378 for (
int i = 0; i < 4; i++)
387 if (std::fabs(p.
z()) >
fDz - halfCarTolerance)
412 UVector3 lnorm, sumnorm(0., 0., 0.), apprnorm(0., 0., 1.),
413 p0,
p1,
p2, r1, r2, r3, r4;
415 double distxy, distz;
416 bool zPlusSide =
false;
418 distz =
fDz - std::fabs(p.
z());
419 if (distz < halfCarTolerance)
436 double cf = 0.5 * (
fDz - p.
z()) /
fDz;
437 for (
int i = 0; i < 4; i++)
445 for (
int q = 0; q < 4; q++)
447 p0 =
UVector3(vertices[q].x, vertices[q].y, p.
z());
456 p2 =
UVector3(vertices[(q + 1) % 4].x, vertices[(q + 1) % 4].y, p.
z());
471 lnorm = (p1 -
p0).Cross(p2 - p0);
472 lnorm = lnorm.
Unit();
482 double normP = (p2 -
p0).Mag();
485 double proj = (p -
p0).Dot(p2 - p0) / normP;
499 r1 = r1 + proj * (r2 - r1) / normP;
500 r3 = r3 + proj * (r4 - r3) / normP;
502 r4 = r2.
Cross(p2 - p0);
508 distxy = std::fabs((p0 - p).Dot(lnorm));
509 if (distxy < halfCarTolerance)
515 sumnorm = sumnorm + lnorm;
533 UWarning, 1,
"Point p is not on surface !?");
536 std::cout <<
"Point is not on Surface, confirmed by Inside()" << p << std::endl;
542 else if (noSurfaces == 1)
548 sumnorm = sumnorm.
Unit();
552 return noSurfaces != 0 ;
572 double distz =
fDz - p.
z();
577 double cf = 0.5 * (
fDz - p.
z()) /
fDz;
587 if (std::fabs(distz) < halfCarTolerance)
602 if (std::fabs(p.
z() +
fDz) > halfCarTolerance)
611 lnorm = -(p1 -
p0).Cross(p2 - p0);
612 if (distz > -halfCarTolerance)
614 lnorm = -lnorm.
Unit();
618 lnorm = lnorm.
Unit();
625 double normP = (p2 -
p0).Mag();
628 double proj = (p -
p0).Dot(p2 - p0) / normP;
642 r1 = r1 + proj * (r2 - r1) / normP;
643 r3 = r3 + proj * (r4 - r3) / normP;
645 r4 = r2.
Cross(p2 - p0);
667 double xa, xb, xc, xd, ya, yb, yc, yd;
669 int j = (ipl + 1) % 4;
680 double dz2 = 0.5 /
fDz;
681 double tx1 = dz2 * (xb - xa);
682 double ty1 = dz2 * (yb - ya);
683 double tx2 = dz2 * (xd - xc);
684 double ty2 = dz2 * (yd - yc);
685 double dzp =
fDz + p.
z();
686 double xs1 = xa + tx1 * dzp;
687 double ys1 = ya + ty1 * dzp;
688 double xs2 = xc + tx2 * dzp;
689 double ys2 = yc + ty2 * dzp;
690 double dxs = xs2 - xs1;
691 double dys = ys2 - ys1;
692 double dtx = tx2 - tx1;
693 double dty = ty2 - ty1;
695 double a = (dtx * v.
y() - dty * v.
x() + (tx1 * ty2 - tx2 * ty1) * v.
z()) * v.
z();
696 double b = dxs * v.
y() - dys * v.
x() + (dtx * p.
y() - dty * p.
x() + ty2 * xs1 - ty1 * xs2
697 + tx1 * ys2 - tx2 * ys1) * v.
z();
698 double c = dxs * p.
y() - dys * p.
x() + xs1 * ys2 - xs2 * ys1;
700 double x1, x2, y1, y2, xp, yp, zi;
712 if (q > -halfCarTolerance)
714 if (q < halfCarTolerance)
731 zi = p.
z() + q * v.
z();
732 if (std::fabs(zi) <
fDz)
734 x1 = xs1 + tx1 * v.
z() * q;
735 x2 = xs2 + tx2 * v.
z() * q;
736 xp = p.
x() + q * v.
x();
737 y1 = ys1 + ty1 * v.
z() * q;
738 y2 = ys2 + ty2 * v.
z() * q;
739 yp = p.
y() + q * v.
y();
740 zi = (xp - x1) * (xp - x2) + (yp - y1) * (yp - y2);
741 if (zi <= halfCarTolerance)
749 double d = b * b - 4 * a * c;
754 q = 0.5 * (-b - std::sqrt(d)) / a;
758 q = 0.5 * (-b + std::sqrt(d)) / a;
763 if (q > -halfCarTolerance)
765 if (q < halfCarTolerance)
778 q = 0.5 * (-b + std::sqrt(d)) / a;
782 q = 0.5 * (-b - std::sqrt(d)) / a;
784 if (q <= halfCarTolerance)
792 zi = p.
z() + q * v.
z();
793 if (std::fabs(zi) <
fDz)
795 x1 = xs1 + tx1 * v.
z() * q;
796 x2 = xs2 + tx2 * v.
z() * q;
797 xp = p.
x() + q * v.
x();
798 y1 = ys1 + ty1 * v.
z() * q;
799 y2 = ys2 + ty2 * v.
z() * q;
800 yp = p.
y() + q * v.
y();
801 zi = (xp - x1) * (xp - x2) + (yp - y1) * (yp - y2);
802 if (zi <= halfCarTolerance)
810 q = 0.5 * (-b + std::sqrt(d)) / a;
814 q = 0.5 * (-b - std::sqrt(d)) / a;
819 if (q > -halfCarTolerance)
821 if (q < halfCarTolerance)
834 q = 0.5 * (-b - std::sqrt(d)) / a;
838 q = 0.5 * (-b + std::sqrt(d)) / a;
840 if (q <= halfCarTolerance)
848 zi = p.
z() + q * v.
z();
849 if (std::fabs(zi) <
fDz)
851 x1 = xs1 + tx1 * v.
z() * q;
852 x2 = xs2 + tx2 * v.
z() * q;
853 xp = p.
x() + q * v.
x();
854 y1 = ys1 + ty1 * v.
z() * q;
855 y2 = ys2 + ty2 * v.
z() * q;
856 yp = p.
y() + q * v.
y();
857 zi = (xp - x1) * (xp - x2) + (yp - y1) * (yp - y2);
858 if (zi <= halfCarTolerance)
888 for (i = 0; i < 4; i++)
896 if (std::fabs(p.
z()) >
fDz - halfCarTolerance)
903 dist[4] = (
fDz - p.
z()) / v.
z();
907 dist[4] = (-
fDz - p.
z()) / v.
z();
909 if (dist[4] < -halfCarTolerance)
915 if (dist[4] < halfCarTolerance)
934 pt = p + dist[4] * v;
942 double distmin = dist[0];
943 for (i = 1; i < 5; i++)
945 if (dist[i] < distmin)
951 if (distmin < halfCarTolerance)
972 double safz = std::fabs(p.
z()) -
fDz;
982 for (iseg = 0; iseg < 4; iseg++)
1008 safe = (p -
p1).Dot(norm);
1017 const UVector3& v,
const int ipl)
const
1025 int j = (ipl + 1) % 4;
1028 double zab = 2 *
fDz;
1031 if ((std::fabs(xa - xc) + std::fabs(ya - yc)) < halfCarTolerance)
1040 if ((std::fabs(xb - xc) + std::fabs(yb - yc)) < halfCarTolerance)
1045 double a = (yb - ya) * zac - (yc - ya) * zab;
1046 double b = (xc - xa) * zab - (xb - xa) * zac;
1047 double c = (xb - xa) * (yc - ya) - (xc - xa) * (yb - ya);
1048 double d = -xa * a - ya * b +
fDz * c;
1049 double t = a * v.
x() + b * v.
y() + c * v.
z();
1053 t = -(a * p.
x() + b * p.
y() + c * p.
z() + d) / t;
1055 if ((t < halfCarTolerance) && (t > -halfCarTolerance))
1076 UVector3& aNormalVector,
bool& aConvex,
double)
const
1087 bool lateral_cross =
false;
1094 distmin = (-
fDz - p.
z()) / v.
z();
1096 aNormalVector.
Set(0, 0, -1);
1102 distmin = (
fDz - p.
z()) / v.
z();
1104 aNormalVector.
Set(0, 0, 1);
1112 double dz2 = 0.5 /
fDz;
1113 double xa, xb, xc, xd;
1114 double ya, yb, yc, yd;
1116 for (
int ipl = 0; ipl < 4; ipl++)
1118 int j = (ipl + 1) % 4;
1128 if (((std::fabs(xb - xd) + std::fabs(yb - yd)) < halfCarTolerance)
1129 || ((std::fabs(xa - xc) + std::fabs(ya - yc)) < halfCarTolerance))
1132 if ((q >= 0) && (q < distmin))
1135 lateral_cross =
true;
1136 side =
ESide(ipl + 1);
1140 double tx1 = dz2 * (xb - xa);
1141 double ty1 = dz2 * (yb - ya);
1142 double tx2 = dz2 * (xd - xc);
1143 double ty2 = dz2 * (yd - yc);
1144 double dzp =
fDz + p.
z();
1145 double xs1 = xa + tx1 * dzp;
1146 double ys1 = ya + ty1 * dzp;
1147 double xs2 = xc + tx2 * dzp;
1148 double ys2 = yc + ty2 * dzp;
1149 double dxs = xs2 - xs1;
1150 double dys = ys2 - ys1;
1151 double dtx = tx2 - tx1;
1152 double dty = ty2 - ty1;
1153 double a = (dtx * v.
y() - dty * v.
x() + (tx1 * ty2 - tx2 * ty1) * v.
z()) * v.
z();
1154 double b = dxs * v.
y() - dys * v.
x() + (dtx * p.
y() - dty * p.
x() + ty2 * xs1 - ty1 * xs2
1155 + tx1 * ys2 - tx2 * ys1) * v.
z();
1156 double c = dxs * p.
y() - dys * p.
x() + xs1 * ys2 - xs2 * ys1;
1169 if ((q > -halfCarTolerance) && (q < distmin))
1171 if (q < halfCarTolerance)
1179 lateral_cross =
true;
1180 side =
ESide(ipl + 1);
1184 double d = b * b - 4 * a * c;
1189 q = 0.5 * (-b - std::sqrt(d)) / a;
1193 q = 0.5 * (-b + std::sqrt(d)) / a;
1198 if (q > -halfCarTolerance)
1202 if (q < halfCarTolerance)
1208 q = 0.5 * (-b + std::sqrt(d)) / a;
1212 q = 0.5 * (-b - std::sqrt(d)) / a;
1214 if ((q > halfCarTolerance) && (q < distmin))
1217 lateral_cross =
true;
1218 side =
ESide(ipl + 1);
1224 lateral_cross =
true;
1225 side =
ESide(ipl + 1);
1232 q = 0.5 * (-b + std::sqrt(d)) / a;
1236 q = 0.5 * (-b - std::sqrt(d)) / a;
1241 if ((q > -halfCarTolerance) && (q < distmin))
1243 if (q < halfCarTolerance)
1249 q = 0.5 * (-b - std::sqrt(d)) / a;
1253 q = 0.5 * (-b + std::sqrt(d)) / a;
1255 if ((q > halfCarTolerance) && (q < distmin))
1258 lateral_cross =
true;
1259 side =
ESide(ipl + 1);
1265 lateral_cross =
true;
1266 side =
ESide(ipl + 1);
1289 for (
int j = 0; j < 4; j++)
1302 aNormalVector.
Set(0, 0, 1);
1307 aNormalVector.
Set(0, 0, -1);
1342 aNormalVector.
Set(0, 0, 1);
1345 aNormalVector.
Set(0, 0, -1);
1349 std::ostringstream message;
1350 int oldprc = message.precision(16);
1351 message <<
"Undefined side for valid surface normal to solid." << std::endl
1352 <<
"Position:" << std::endl
1353 <<
" p.x() = " << p.
x() <<
" mm" << std::endl
1354 <<
" p.y() = " << p.
y() <<
" mm" << std::endl
1355 <<
" p.z() = " << p.
z() <<
" mm" << std::endl
1356 <<
"Direction:" << std::endl
1357 <<
" v.x() = " << v.
x() << std::endl
1358 <<
" v.y() = " << v.
y() << std::endl
1359 <<
" v.z() = " << v.
z() << std::endl
1360 <<
"Proposed distance :" << std::endl
1361 <<
" distmin = " << distmin <<
" mm";
1362 message.precision(oldprc);
1364 "GeomSolids1002",
UWarning, 1, message.str().c_str());
1368 if (distmin < halfCarTolerance)
1387 double safz =
fDz - std::fabs(p.
z());
1394 double safxy = safz;
1396 for (
int iseg = 0; iseg < 4; iseg++)
1415 pTransform, pMin, pMax);
1438 int oldprc = os.precision(16);
1439 os <<
"-----------------------------------------------------------\n"
1440 <<
" *** Dump for solid - " <<
GetName() <<
" *** \n"
1441 <<
" =================================================== \n"
1443 <<
" half length Z: " <<
fDz <<
" mm \n"
1444 <<
" list of vertices:\n";
1448 os << std::setw(5) <<
"#" << i
1450 <<
" vy = " <<
fVertices[i].y <<
" mm" << std::endl;
1452 os.precision(oldprc);
1471 double rand, area, chose, cf, lambda0, lambda1, alfa, beta, zp;
1474 std::vector<UVector3> vertices;
1475 for (
int i = 0; i < 4; i++)
1479 for (
int i = 4; i < 8; i++)
1487 vertices[2], vertices[3]);
1489 vertices[5], vertices[4]);
1491 vertices[4], vertices[7]);
1493 vertices[7], vertices[6]);
1495 vertices[5], vertices[6]);
1497 vertices[6], vertices[7]);
1499 area = Surface0 + Surface1 + Surface2 + Surface3 + Surface4 + Surface5;
1500 chose = rand * area;
1502 if ((chose < Surface0)
1503 || (chose > (Surface0 + Surface1 + Surface2 + Surface3 + Surface4)))
1508 if (chose < Surface0)
1524 lambda1 = alfa * beta;
1525 lambda0 = alfa - lambda1;
1528 v = u + lambda0 * v + lambda1 * w;
1532 if (chose < Surface0 + Surface1)
1536 else if (chose < Surface0 + Surface1 + Surface2)
1540 else if (chose < Surface0 + Surface1 + Surface2 + Surface3)
1550 cf = 0.5 * (fDz - zp) / fDz;
1585 std::vector<UVector3> vertices;
1586 for (
int i = 0; i < 4; i++)
1590 for (
int i = 4; i < 8; i++)
1598 vertices[2], vertices[3]);
1600 vertices[5], vertices[4]);
1602 vertices[4], vertices[7]);
1604 vertices[7], vertices[6]);
1606 vertices[5], vertices[6]);
1608 vertices[6], vertices[7]);
1615 + fSurface3 + fSurface4 + fSurface5;
1643 aOne = 0.5 * Area.
Mag();
1646 aTwo = 0.5 * Area.
Mag();
1658 bool twisted =
false;
1659 double dx1, dy1, dx2, dy2;
1662 for (
int i = 0; i < 4; i++)
1666 if ((dx1 == 0) && (dy1 == 0))
1674 if (dx2 == 0 && dy2 == 0)
1678 double twist_angle = std::fabs(dy1 * dx2 - dx1 * dy2);
1688 twist_angle = std::acos((dx1 * dx2 + dy1 * dy2)
1689 / (std::sqrt(dx1 * dx1 + dy1 * dy1)
1690 * std::sqrt(dx2 * dx2 + dy2 * dy2)));
1694 std::ostringstream message;
1695 message <<
"Twisted Angle is bigger than 90 degrees - " <<
GetName()
1697 <<
" Potential problem of malformed Solid !" << std::endl
1698 <<
" TwistANGLE = " << twist_angle
1699 <<
"*rad for lateral plane N= " << i;
1701 UWarning, 4, message.str().c_str());
1715 bool clockwise_order =
true;
1720 for (
int i = 0; i < 4; i++)
1723 sum1 += vertices[i].x * vertices[j].y - vertices[j].x * vertices[i].y;
1724 sum2 += vertices[i + 4].x * vertices[j + 4].y
1725 - vertices[j + 4].x * vertices[i + 4].y;
1729 std::ostringstream message;
1730 message <<
"Lower/upper faces defined with opposite clockwise - "
1736 if ((sum1 > 0.) || (sum2 > 0.))
1738 std::ostringstream message;
1739 message <<
"Vertices must be defined in clockwise XY planes - "
1742 UWarning, 1, message.str().c_str());
1743 clockwise_order =
false;
1748 bool illegal_cross =
false;
1750 vertices[1], vertices[5]);
1755 vertices[3], vertices[7]);
1761 vertices[2], vertices[3]);
1766 vertices[1], vertices[2]);
1771 vertices[6], vertices[7]);
1776 vertices[5], vertices[6]);
1781 std::ostringstream message;
1782 message <<
"Malformed polygone with opposite sides - " <<
GetName();
1786 return clockwise_order;
1795 std::vector<UVector3> oldVertices(vertices);
1797 for (
int i = 0; i < int (oldVertices.size()); ++i)
1799 vertices[i] = oldVertices[oldVertices.size() - 1 - i];
1811 bool stand1 =
false;
1812 bool stand2 =
false;
1813 double dx1, dx2, xm = 0., ym = 0.,
a1 = 0.,
a2 = 0.,
b1 = 0.,
b2 = 0.;
1827 a1 = (b.
x * a.
y - a.
x * b.
y) / dx1;
1828 b1 = (b -
a).y / dx1;
1832 a2 = (d.
x * c.
y - c.
x * d.
y) / dx2;
1833 b2 = (d - c).y / dx2;
1835 if (stand1 && stand2)
1900 double check = (xm - a.
x) * (xm - b.
x) + (ym - a.
y) * (ym - b.
y);
1905 check = (xm - c.
x) * (xm - d.
x) + (ym - c.
y) * (ym - d.
y);
1952 det = dv.
x() * v1.
y() * v2.
z() + dv.
y() * v1.
z() * v2.
x()
1953 - dv.
x() * v1.
z() * v2.
y() - dv.
y() * v1.
x() * v2.
z();
1957 temp1 = v1.
Cross(v2);
1958 temp2 = (p2 -
p1).Cross(v2);
1959 if (temp1.
Dot(temp2) < 0)
1969 q = ((dv).Cross(v2)).Mag() / q;
1983 int ind1,
int ind2,
int ind3)
const
1989 if ((fromVertices[ind1] == fromVertices[ind2]) ||
1990 (fromVertices[ind2] == fromVertices[ind3]) ||
1991 (fromVertices[ind1] == fromVertices[ind3]))
1996 std::vector<UVector3> vertices;
1997 vertices.push_back(fromVertices[ind1]);
1998 vertices.push_back(fromVertices[ind2]);
1999 vertices.push_back(fromVertices[ind3]);
2003 UVector3 cross = (vertices[1] - vertices[0]).Cross(vertices[2] - vertices[1]);
2005 if (cross.
z() > 0.0)
2009 std::ostringstream message;
2010 message <<
"Vertices in wrong order - " <<
GetName();
2022 int ind1,
int ind2,
int ind3)
const
2029 if ((fromVertices[ind1] == fromVertices[ind2]) ||
2030 (fromVertices[ind2] == fromVertices[ind3]) ||
2031 (fromVertices[ind1] == fromVertices[ind3]))
2036 std::vector<UVector3> vertices;
2037 vertices.push_back(fromVertices[ind1]);
2038 vertices.push_back(fromVertices[ind2]);
2039 vertices.push_back(fromVertices[ind3]);
2043 UVector3 cross = (vertices[1] - vertices[0]).Cross(vertices[2] - vertices[1]);
2045 if (cross.
z() < 0.0)
2049 std::ostringstream message;
2050 message <<
"Vertices in wrong order - " <<
GetName();
2069 if ((downVertex0 == downVertex1) && (upVertex0 == upVertex1))
2074 if (downVertex0 == downVertex1)
2079 if (upVertex0 == upVertex1)
2095 std::vector<UVector3> downVertices;
2096 for (
int i = 0; i < nv; i++)
2102 std::vector<UVector3> upVertices;
2103 for (
int i = nv; i < 2 * nv; i++)
2112 = (downVertices[1] - downVertices[0]).Cross(downVertices[2] - downVertices[1]);
2114 = (upVertices[1] - upVertices[0]).Cross(upVertices[2] - upVertices[1]);
2115 if ((cross.
z() > 0.0) || (cross1.
z() > 0.0))
2147 for (
int i = 0; i < nv; ++i)
2149 int j = (i + 1) % nv;
2151 upVertices[i], upVertices[j]);
2161 return tessellatedSolid;
2170 double minX, maxX, minY, maxY;
VUFacet * MakeDownFacet(const std::vector< UVector3 > &fromVertices, int ind1, int ind2, int ind3) const
bool IsSameLineSegment(const UVector2 &p, const UVector2 &l1, const UVector2 &l2) const
double DistanceToOut(const UVector3 &aPoint, const UVector3 &aDirection, UVector3 &aNormalVector, bool &aConvex, double aPstep=UUtils::kInfinity) const
virtual double SurfaceArea()=0
std::ostream & StreamInfo(std::ostream &os) const
double SafetyFromInside(const UVector3 &aPoint, bool aAccurate=false) const
const std::string & GetName() const
static double fgTolerance
double DistToPlane(const UVector3 &p, const UVector3 &v, const int ipl) const
UVector3 Cross(const UVector3 &) const
void Extent(UVector3 &aMin, UVector3 &aMax) const
bool AddFacet(VUFacet *aFacet)
bool CheckOrder(const std::vector< UVector2 > &vertices) const
static const int fgkNofVertices
EnumInside InsidePolygone(const UVector3 &p, const UVector2 *poly) const
void SetTwistAngle(int index, double twist)
bool Normal(const UVector3 &aPoint, UVector3 &aNormal) const
virtual double DistanceToIn(const UVector3 &p, const UVector3 &v, double aPstep=UUtils::kInfinity) const
void Initialise(const std::vector< UVector2 > &vertices)
UTessellatedSolid * fTessellatedSolid
static double normal(HepRandomEngine *eptr)
double DistToTriangle(const UVector3 &p, const UVector3 &v, const int ipl) const
double SafetyToFace(const UVector3 &p, const int iseg) const
UGenericTrap & operator=(const UGenericTrap &rhs)
std::vector< UVector2 > fVertices
static const double kInfinity
double SafetyFromOutside(const UVector3 &aPoint, bool aAccurate=false) const
void ReorderVertices(std::vector< UVector3 > &vertices) const
bool IsSegCrossing(const UVector2 &a, const UVector2 &b, const UVector2 &c, const UVector2 &d) const
double DistanceToIn(const UVector3 &aPoint, const UVector3 &aDirection, double aPstep=UUtils::kInfinity) const
virtual VUSolid::EnumInside Inside(const UVector3 &p) const
double Dot(const UVector3 &) const
UVector3 NormalToPlane(const UVector3 &p, const int ipl) const
double DistanceToIn(const UVector3 &aPoint, const UVector3 &aDirection, double aPstep=UUtils::kInfinity) const
VUFacet * MakeUpFacet(const std::vector< UVector3 > &fromVertices, int ind1, int ind2, int ind3) const
bool IsSameLine(const UVector2 &p, const UVector2 &l1, const UVector2 &l2) const
void Exception(const char *originOfException, const char *exceptionCode, UExceptionSeverity severity, int level, const char *description)
static const double fgkTolerance
void Set(double xx, double yy, double zz)
UGeometryType GetEntityType() const
EnumInside Inside(const UVector3 &aPoint) const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
UVector3 GetMaximumBBox() const
double GetTwistAngle(int index) const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
double SafetyFromOutside(const UVector3 &aPoint, bool aAccurate=false) const
EnumInside Inside(const UVector3 &aPoint) const
void SetSolidClosed(const bool t)
UTessellatedSolid * CreateTessellatedSolid() const
VUFacet * MakeSideFacet(const UVector3 &downVertex0, const UVector3 &downVertex1, const UVector3 &upVertex1, const UVector3 &upVertex0) const
double Random(double min=0.0, double max=1.0)
double GetFaceSurfaceArea(const UVector3 &p0, const UVector3 &p1, const UVector3 &p2, const UVector3 &p3) const
virtual double DistanceToOut(const UVector3 &p, const UVector3 &v, UVector3 &aNormalVector, bool &aConvex, double aPstep=UUtils::kInfinity) const
UVector3 GetPointOnSurface() const
UVector3 GetMinimumBBox() const
bool IsSegCrossingZ(const UVector2 &a, const UVector2 &b, const UVector2 &c, const UVector2 &d) const
virtual double Capacity()=0