23 double haley,
double halez)
36 double haley,
double halez,
37 double alpha,
double beta)
45 double gamma = (alpha > beta) ? (alpha - 0.5 *
M_PI) : (beta - 0.5 *
M_PI);
59 Vector3D trapezoidX(trapezoidRotation.col(0));
60 Vector3D trapezoidY(trapezoidRotation.col(1));
61 Vector3D trapezoidZ(trapezoidRotation.col(2));
62 Vector3D trapezoidCenter(transform.translation());
65 auto nzTransform = transform *
Translation3D(0., 0., -
get(eHalfLengthZ));
67 Surface::makeShared<PlaneSurface>(nzTransform, m_faceXYTrapezoidBounds);
70 auto pzTransform = transform *
Translation3D(0., 0.,
get(eHalfLengthZ));
71 sf = Surface::makeShared<PlaneSurface>(pzTransform, m_faceXYTrapezoidBounds);
74 double poshOffset =
get(eHalfLengthY) / std::tan(
get(eAlpha));
75 double neghOffset =
get(eHalfLengthY) / std::tan(
get(eBeta));
76 double topShift = poshOffset + neghOffset;
80 Vector3D fbPosition(-
get(eHalfLengthXnegY) + neghOffset, 0., 0.);
85 Surface::makeShared<PlaneSurface>(fbTransform, m_faceBetaRectangleBounds);
89 Vector3D faPosition(
get(eHalfLengthXnegY) + poshOffset, 0., 0.);
93 sf = Surface::makeShared<PlaneSurface>(faTransform,
94 m_faceAlphaRectangleBounds);
101 sf = Surface::makeShared<PlaneSurface>(nxTransform,
102 m_faceZXRectangleBoundsBottom);
107 sf = Surface::makeShared<PlaneSurface>(pxTransform,
108 m_faceZXRectangleBoundsTop);
115 m_faceXYTrapezoidBounds = std::make_shared<const TrapezoidBounds>(
116 get(eHalfLengthXnegY),
get(eHalfLengthXposY),
get(eHalfLengthY));
118 m_faceAlphaRectangleBounds = std::make_shared<const RectangleBounds>(
119 get(eHalfLengthY) /
cos(
get(eAlpha) - 0.5 *
M_PI),
get(eHalfLengthZ));
121 m_faceBetaRectangleBounds = std::make_shared<const RectangleBounds>(
122 get(eHalfLengthY) /
cos(
get(eBeta) - 0.5 *
M_PI),
get(eHalfLengthZ));
124 m_faceZXRectangleBoundsBottom = std::make_shared<const RectangleBounds>(
125 get(eHalfLengthZ),
get(eHalfLengthXnegY));
127 m_faceZXRectangleBoundsTop = std::make_shared<const RectangleBounds>(
128 get(eHalfLengthZ),
get(eHalfLengthXposY));
133 if (
std::abs(pos.z()) >
get(eHalfLengthZ) + tol) {
136 if (
std::abs(pos.y()) >
get(eHalfLengthY) + tol) {
140 bool inside(m_faceXYTrapezoidBounds->inside(
146 return dumpT<std::ostream>(sl);
151 const Volume* entity)
const {
152 double minx =
get(eHalfLengthXnegY);
153 double maxx =
get(eHalfLengthXposY);
154 double haley =
get(eHalfLengthY);
155 double halez =
get(eHalfLengthZ);
157 std::array<Vector3D, 8> vertices = {{{-minx, -haley, -halez},
158 {+minx, -haley, -halez},
159 {-maxx, +haley, -halez},
160 {+maxx, +haley, -halez},
161 {-minx, -haley, +halez},
162 {+minx, -haley, +halez},
163 {-maxx, +haley, +halez},
164 {+maxx, +haley, +halez}}};
167 if (trf !=
nullptr) {
171 Vector3D vmin = transform * vertices[0];
172 Vector3D vmax = transform * vertices[0];
174 for (
size_t i = 1; i < 8; i++) {
176 vmin = vmin.cwiseMin(vtx);
177 vmax = vmax.cwiseMax(vtx);
180 return {entity, vmin - envelope, vmax + envelope};