25 double haley,
double halez)
38 double haley,
double halez,
39 double alpha,
double beta)
47 double gamma = (alpha > beta) ? (alpha - 0.5 * M_PI) : (beta - 0.5 * M_PI);
61 Vector3 trapezoidX(trapezoidRotation.col(0));
62 Vector3 trapezoidY(trapezoidRotation.col(1));
63 Vector3 trapezoidZ(trapezoidRotation.col(2));
64 Vector3 trapezoidCenter(transform.translation());
67 auto nzTransform = transform *
Translation3(0., 0., -
get(eHalfLengthZ));
69 Surface::makeShared<PlaneSurface>(nzTransform, m_faceXYTrapezoidBounds);
72 auto pzTransform = transform *
Translation3(0., 0.,
get(eHalfLengthZ));
73 sf = Surface::makeShared<PlaneSurface>(pzTransform, m_faceXYTrapezoidBounds);
76 double poshOffset =
get(eHalfLengthY) / std::tan(
get(eAlpha));
77 double neghOffset =
get(eHalfLengthY) / std::tan(
get(eBeta));
78 double topShift = poshOffset + neghOffset;
82 Vector3 fbPosition(-
get(eHalfLengthXnegY) + neghOffset, 0., 0.);
83 auto fbTransform = transform *
Translation3(fbPosition) *
87 Surface::makeShared<PlaneSurface>(fbTransform, m_faceBetaRectangleBounds);
91 Vector3 faPosition(
get(eHalfLengthXnegY) + poshOffset, 0., 0.);
95 sf = Surface::makeShared<PlaneSurface>(faTransform,
96 m_faceAlphaRectangleBounds);
103 sf = Surface::makeShared<PlaneSurface>(nxTransform,
104 m_faceZXRectangleBoundsBottom);
109 sf = Surface::makeShared<PlaneSurface>(pxTransform,
110 m_faceZXRectangleBoundsTop);
117 m_faceXYTrapezoidBounds = std::make_shared<const TrapezoidBounds>(
118 get(eHalfLengthXnegY),
get(eHalfLengthXposY),
get(eHalfLengthY));
120 m_faceAlphaRectangleBounds = std::make_shared<const RectangleBounds>(
121 get(eHalfLengthY) / cos(
get(eAlpha) - 0.5 * M_PI),
get(eHalfLengthZ));
123 m_faceBetaRectangleBounds = std::make_shared<const RectangleBounds>(
124 get(eHalfLengthY) / cos(
get(eBeta) - 0.5 * M_PI),
get(eHalfLengthZ));
126 m_faceZXRectangleBoundsBottom = std::make_shared<const RectangleBounds>(
127 get(eHalfLengthZ),
get(eHalfLengthXnegY));
129 m_faceZXRectangleBoundsTop = std::make_shared<const RectangleBounds>(
130 get(eHalfLengthZ),
get(eHalfLengthXposY));
134 if (std::abs(pos.z()) >
get(eHalfLengthZ) + tol) {
137 if (std::abs(pos.y()) >
get(eHalfLengthY) + tol) {
140 Vector2 locp(pos.x(), pos.y());
141 bool inside(m_faceXYTrapezoidBounds->inside(
147 return dumpT<std::ostream>(sl);
152 const Volume* entity)
const {
153 double minx =
get(eHalfLengthXnegY);
154 double maxx =
get(eHalfLengthXposY);
155 double haley =
get(eHalfLengthY);
156 double halez =
get(eHalfLengthZ);
158 std::array<Vector3, 8>
vertices = {{{-minx, -haley, -halez},
159 {+minx, -haley, -halez},
160 {-maxx, +haley, -halez},
161 {+maxx, +haley, -halez},
162 {-minx, -haley, +halez},
163 {+minx, -haley, +halez},
164 {-maxx, +haley, +halez},
165 {+maxx, +haley, +halez}}};
168 if (trf !=
nullptr) {
172 Vector3 vmin = transform * vertices[0];
173 Vector3 vmax = transform * vertices[0];
175 for (
size_t i = 1;
i < 8;
i++) {
176 const Vector3 vtx = transform * vertices[
i];
177 vmin = vmin.cwiseMin(vtx);
178 vmax = vmax.cwiseMax(vtx);
181 return {entity, vmin - envelope, vmax + envelope};