Geant4  10.00.p03
UTet.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * This Software is part of the AIDA Unified Solids Library package *
4 // * See: https://aidasoft.web.cern.ch/USolids *
5 // ********************************************************************
6 //
7 // $Id:$
8 //
9 // --------------------------------------------------------------------
10 //
11 // UTet
12 //
13 // 19.07.13 Tatiana Nikitina
14 // Created from original implementation in Geant4
15 // --------------------------------------------------------------------
16 
17 #include <cmath>
18 #include <iostream>
19 #include <sstream>
20 #include "UTet.hh"
21 #include "UUtils.hh"
22 
23 using namespace std;
24 
25 
27 //
28 // Constructor - create a tetrahedron
29 // This class is implemented separately from general polyhedra,
30 // because the simplex geometry can be computed very quickly,
31 // which may become important in situations imported from mesh generators,
32 // in which a very large number of UTets are created.
33 // A Tet has all of its geometrical information precomputed
34 
35 UTet::UTet(const std::string& name,
36  UVector3 anchor,
37  UVector3 p2,
38  UVector3 p3,
39  UVector3 p4, bool* degeneracyFlag)
40  : VUSolid(name), warningFlag(0)
41 {
42  // fV<x><y> is vector from vertex <y> to vertex <x>
43  //
44  UVector3 fV21 = p2 - anchor;
45  UVector3 fV31 = p3 - anchor;
46  UVector3 fV41 = p4 - anchor;
47 
48  // make sure this is a correctly oriented set of points for the tetrahedron
49  //
50  double signed_vol = fV21.Cross(fV31).Dot(fV41);
51  if (signed_vol < 0.0)
52  {
53  UVector3 temp(p4);
54  p4 = p3;
55  p3 = temp;
56  temp = fV41;
57  fV41 = fV31;
58  fV31 = temp;
59  }
60  fCubicVolume = std::fabs(signed_vol) / 6.;
61 
62  //UVector3 fV24=p2-p4;
63  UVector3 fV43 = p4 - p3;
64  UVector3 fV32 = p3 - p2;
65 
66  fXMin = std::min(std::min(std::min(anchor.x, p2.x), p3.x), p4.x);
67  fXMax = std::max(std::max(std::max(anchor.x, p2.x), p3.x), p4.x);
68  fYMin = std::min(std::min(std::min(anchor.y, p2.y), p3.y), p4.y);
69  fYMax = std::max(std::max(std::max(anchor.y, p2.y), p3.y), p4.y);
70  fZMin = std::min(std::min(std::min(anchor.z, p2.z), p3.z), p4.z);
71  fZMax = std::max(std::max(std::max(anchor.z, p2.z), p3.z), p4.z);
72 
73  fDx = (fXMax - fXMin) * 0.5;
74  fDy = (fYMax - fYMin) * 0.5;
75  fDz = (fZMax - fZMin) * 0.5;
76 
77  fMiddle = UVector3(fXMax + fXMin, fYMax + fYMin, fZMax + fZMin) * 0.5;
78  fMaxSize = std::max(std::max(std::max((anchor - fMiddle).Mag(),
79  (p2 - fMiddle).Mag()),
80  (p3 - fMiddle).Mag()),
81  (p4 - fMiddle).Mag());
82 
83  bool degenerate = std::fabs(signed_vol) < 1e-9 * fMaxSize * fMaxSize * fMaxSize;
84 
85  if (degeneracyFlag) *degeneracyFlag = degenerate;
86  else if (degenerate)
87  {
88  UUtils::Exception("UTet::UTet()", "GeomSolids0002", FatalErrorInArguments, 1,
89  "Degenerate tetrahedron not allowed.");
90  }
91 
92  fTol = 1e-9 * (std::fabs(fXMin) + std::fabs(fXMax) + std::fabs(fYMin)
93  + std::fabs(fYMax) + std::fabs(fZMin) + std::fabs(fZMax));
94  //fTol=kCarTolerance;
95 
96  fAnchor = anchor;
97  fP2 = p2;
98  fP3 = p3;
99  fP4 = p4;
100 
101  UVector3 fCenter123 = (anchor + p2 + p3) * (1.0 / 3.0); // face center
102  UVector3 fCenter134 = (anchor + p4 + p3) * (1.0 / 3.0);
103  UVector3 fCenter142 = (anchor + p4 + p2) * (1.0 / 3.0);
104  UVector3 fCenter234 = (p2 + p3 + p4) * (1.0 / 3.0);
105 
106  // compute area of each triangular face by cross product
107  // and sum for total surface area
108 
109  UVector3 normal123 = fV31.Cross(fV21);
110  UVector3 normal134 = fV41.Cross(fV31);
111  UVector3 normal142 = fV21.Cross(fV41);
112  UVector3 normal234 = fV32.Cross(fV43);
113 
114  fSurfaceArea = (
115  normal123.Mag() +
116  normal134.Mag() +
117  normal142.Mag() +
118  normal234.Mag()
119  ) / 2.0;
120 
121  fNormal123 = normal123.Unit();
122  fNormal134 = normal134.Unit();
123  fNormal142 = normal142.Unit();
124  fNormal234 = normal234.Unit();
125 
126  fCdotN123 = fCenter123.Dot(fNormal123);
127  fCdotN134 = fCenter134.Dot(fNormal134);
128  fCdotN142 = fCenter142.Dot(fNormal142);
129  fCdotN234 = fCenter234.Dot(fNormal234);
130 }
131 
133 //
134 // Fake default constructor - sets only member data and allocates memory
135 // for usage restricted to object persistency.
136 //
137 UTet::UTet( __void__& )
138  : VUSolid()
139 {
140 }
141 
143 //
144 // Destructor
145 
147 {
148 }
149 
151 //
152 // Copy constructor
153 
154 UTet::UTet(const UTet& rhs)
155  : VUSolid(rhs),
156  fCubicVolume(rhs.fCubicVolume), fSurfaceArea(rhs.fSurfaceArea),
157  fAnchor(rhs.fAnchor),
158  fP2(rhs.fP2), fP3(rhs.fP3), fP4(rhs.fP4), fMiddle(rhs.fMiddle),
159  fNormal123(rhs.fNormal123), fNormal142(rhs.fNormal142),
160  fNormal134(rhs.fNormal134), fNormal234(rhs.fNormal234),
161  warningFlag(rhs.warningFlag), fCdotN123(rhs.fCdotN123),
162  fCdotN142(rhs.fCdotN142), fCdotN134(rhs.fCdotN134),
163  fCdotN234(rhs.fCdotN234), fXMin(rhs.fXMin), fXMax(rhs.fXMax),
164  fYMin(rhs.fYMin), fYMax(rhs.fYMax), fZMin(rhs.fZMin), fZMax(rhs.fZMax),
165  fDx(rhs.fDx), fDy(rhs.fDy), fDz(rhs.fDz), fTol(rhs.fTol),
166  fMaxSize(rhs.fMaxSize)
167 {
168 }
169 
170 
172 //
173 // Assignment operator
174 
176 {
177  // Check assignment to self
178  //
179  if (this == &rhs)
180  {
181  return *this;
182  }
183 
184  // Copy base class data
185  //
186  VUSolid::operator=(rhs);
187 
188  // Copy data
189  //
192  fAnchor = rhs.fAnchor;
193  fP2 = rhs.fP2;
194  fP3 = rhs.fP3;
195  fP4 = rhs.fP4;
196  fMiddle = rhs.fMiddle;
197  fNormal123 = rhs.fNormal123;
198  fNormal142 = rhs.fNormal142;
199  fNormal134 = rhs.fNormal134;
200  fNormal234 = rhs.fNormal234;
201  warningFlag = rhs.warningFlag;
202  fCdotN123 = rhs.fCdotN123;
203  fCdotN142 = rhs.fCdotN142;
204  fCdotN134 = rhs.fCdotN134;
205  fCdotN234 = rhs.fCdotN234;
206  fXMin = rhs.fXMin;
207  fXMax = rhs.fXMax;
208  fYMin = rhs.fYMin;
209  fYMax = rhs.fYMax;
210  fZMin = rhs.fZMin;
211  fZMax = rhs.fZMax;
212  fDx = rhs.fDx;
213  fDy = rhs.fDy;
214  fDz = rhs.fDz;
215  fTol = rhs.fTol;
216  fMaxSize = rhs.fMaxSize;
217 
218  return *this;
219 }
220 
222 //
223 // Return whether point inside/outside/on surface, using tolerance
224 
226 {
227  double r123, r134, r142, r234;
228 
229  // this is written to allow if-statement truncation so the outside test
230  // (where most of the world is) can fail very quickly and efficiently
231 
232  if ((r123 = p.Dot(fNormal123) - fCdotN123) > fTol ||
233  (r134 = p.Dot(fNormal134) - fCdotN134) > fTol ||
234  (r142 = p.Dot(fNormal142) - fCdotN142) > fTol ||
235  (r234 = p.Dot(fNormal234) - fCdotN234) > fTol)
236  {
237  return eOutside; // at least one is out!
238  }
239  else if ((r123 < -fTol) && (r134 < -fTol) && (r142 < -fTol) && (r234 < -fTol))
240  {
241  return eInside; // all are definitively inside
242  }
243  else
244  {
245  return eSurface; // too close to tell
246  }
247 }
248 
250 //
251 // Calculate side nearest to p, and return normal
252 // If two sides are equidistant, normal of first side (x/y/z)
253 // encountered returned.
254 // This assumes that we are looking from the inside!
255 
256 bool UTet::Normal(const UVector3& p, UVector3& n) const
257 {
258  double r123 = std::fabs(p.Dot(fNormal123) - fCdotN123);
259  double r134 = std::fabs(p.Dot(fNormal134) - fCdotN134);
260  double r142 = std::fabs(p.Dot(fNormal142) - fCdotN142);
261  double r234 = std::fabs(p.Dot(fNormal234) - fCdotN234);
262 
263  static const double delta = 0.5 * fTol;
264  UVector3 sumnorm(0., 0., 0.);
265  int noSurfaces = 0;
266 
267  if (r123 <= delta)
268  {
269  noSurfaces ++;
270  sumnorm = fNormal123;
271  }
272 
273  if (r134 <= delta)
274  {
275  noSurfaces ++;
276  sumnorm += fNormal134;
277  }
278 
279  if (r142 <= delta)
280  {
281  noSurfaces ++;
282  sumnorm += fNormal142;
283  }
284  if (r234 <= delta)
285  {
286  noSurfaces ++;
287  sumnorm += fNormal234;
288  }
289 
290  if (noSurfaces > 0)
291  {
292  if (noSurfaces == 1)
293  {
294  n = sumnorm;
295  return true;
296  }
297  else
298  {
299  n = sumnorm.Unit();
300  return true;
301  }
302  }
303  else // Approximative Surface Normal
304  {
305 
306  if ((r123 <= r134) && (r123 <= r142) && (r123 <= r234))
307  {
308  n = fNormal123;
309  }
310  else if ((r134 <= r142) && (r134 <= r234))
311  {
312  n = fNormal134;
313  }
314  else if (r142 <= r234)
315  {
316  n = fNormal142;
317  }
318  n = fNormal234;
319  return false;
320  }
321 
322 
323 }
324 
326 //
327 // Calculate distance to box from an outside point
328 // - return kInfinity if no intersection.
329 // All this is very unrolled, for speed.
330 
331 double UTet::DistanceToIn(const UVector3& p,
332  const UVector3& v, double /*aPstep*/) const
333 {
334  UVector3 vu(v.Unit()), hp;
335  double vdotn, t, tmin = UUtils::kInfinity;
336 
337  double extraDistance = 10.0 * fTol; // a little ways into the solid
338 
339  vdotn = -vu.Dot(fNormal123);
340  if (vdotn > 1e-12)
341  {
342  // this is a candidate face, since it is pointing at us
343  t = (p.Dot(fNormal123) - fCdotN123) / vdotn; // # distance to intersection
344  if ((t >= -fTol) && (t < tmin))
345  {
346  // if not true, we're going away from this face or it's not close
347  hp = p + vu * (t + extraDistance); // a little beyond point of intersection
348  if ((hp.Dot(fNormal134) - fCdotN134 < 0.0) &&
349  (hp.Dot(fNormal142) - fCdotN142 < 0.0) &&
350  (hp.Dot(fNormal234) - fCdotN234 < 0.0))
351  {
352  tmin = t;
353  }
354  }
355  }
356 
357  vdotn = -vu.Dot(fNormal134);
358  if (vdotn > 1e-12)
359  {
360  // # this is a candidate face, since it is pointing at us
361  t = (p.Dot(fNormal134) - fCdotN134) / vdotn; // # distance to intersection
362  if ((t >= -fTol) && (t < tmin))
363  {
364  // if not true, we're going away from this face
365  hp = p + vu * (t + extraDistance); // a little beyond point of intersection
366  if ((hp.Dot(fNormal123) - fCdotN123 < 0.0) &&
367  (hp.Dot(fNormal142) - fCdotN142 < 0.0) &&
368  (hp.Dot(fNormal234) - fCdotN234 < 0.0))
369  {
370  tmin = t;
371  }
372  }
373  }
374 
375  vdotn = -vu.Dot(fNormal142);
376  if (vdotn > 1e-12)
377  {
378  // # this is a candidate face, since it is pointing at us
379  t = (p.Dot(fNormal142) - fCdotN142) / vdotn; // # distance to intersection
380  if ((t >= -fTol) && (t < tmin))
381  {
382  // if not true, we're going away from this face
383  hp = p + vu * (t + extraDistance); // a little beyond point of intersection
384  if ((hp.Dot(fNormal123) - fCdotN123 < 0.0) &&
385  (hp.Dot(fNormal134) - fCdotN134 < 0.0) &&
386  (hp.Dot(fNormal234) - fCdotN234 < 0.0))
387  {
388  tmin = t;
389  }
390  }
391  }
392 
393  vdotn = -vu.Dot(fNormal234);
394  if (vdotn > 1e-12)
395  {
396  // # this is a candidate face, since it is pointing at us
397  t = (p.Dot(fNormal234) - fCdotN234) / vdotn; // # distance to intersection
398  if ((t >= -fTol) && (t < tmin))
399  {
400  // if not true, we're going away from this face
401  hp = p + vu * (t + extraDistance); // a little beyond point of intersection
402  if ((hp.Dot(fNormal123) - fCdotN123 < 0.0) &&
403  (hp.Dot(fNormal134) - fCdotN134 < 0.0) &&
404  (hp.Dot(fNormal142) - fCdotN142 < 0.0))
405  {
406  tmin = t;
407  }
408  }
409  }
410 
411  return std::max(0.0, tmin);
412 }
413 
415 //
416 // Approximate distance to tet.
417 // returns distance to sphere centered on bounding box
418 // - If inside return 0
419 double UTet::SafetyFromOutside(const UVector3& p, bool /*aAccurate*/) const
420 
421 {
422  double dd = (p - fMiddle).Mag() - fMaxSize - fTol;
423  return std::max(0.0, dd);
424 }
425 
427 //
428 // Calcluate distance to surface of box from inside
429 // by calculating distances to box's x/y/z planes.
430 // Smallest distance is exact distance to exiting.
431 double UTet::DistanceToOut(const UVector3& p, const UVector3& v,
432  UVector3& n, bool& convex, double /*aPstep*/) const
433 {
434  UVector3 vu(v.Unit());
435  double t1 = UUtils::kInfinity, t2 = UUtils::kInfinity, t3 = UUtils::kInfinity, t4 = UUtils::kInfinity, vdotn, tt;
436 
437  vdotn = vu.Dot(fNormal123);
438  if (vdotn > 1e-12) // #we're heading towards this face, so it is a candidate
439  {
440  t1 = (fCdotN123 - p.Dot(fNormal123)) / vdotn; // # distance to intersection
441  }
442 
443  vdotn = vu.Dot(fNormal134);
444  if (vdotn > 1e-12) // #we're heading towards this face, so it is a candidate
445  {
446  t2 = (fCdotN134 - p.Dot(fNormal134)) / vdotn; // # distance to intersection
447  }
448 
449  vdotn = vu.Dot(fNormal142);
450  if (vdotn > 1e-12) // #we're heading towards this face, so it is a candidate
451  {
452  t3 = (fCdotN142 - p.Dot(fNormal142)) / vdotn; // # distance to intersection
453  }
454 
455  vdotn = vu.Dot(fNormal234);
456  if (vdotn > 1e-12) // #we're heading towards this face, so it is a candidate
457  {
458  t4 = (fCdotN234 - p.Dot(fNormal234)) / vdotn; // # distance to intersection
459  }
460 
461  tt = std::min(std::min(std::min(t1, t2), t3), t4);
462 
463  if (warningFlag && (tt == UUtils::kInfinity || tt < -fTol))
464  {
465  // DumpInfo();
466  std::ostringstream message;
467  message << "No good intersection found or already outside!?" << std::endl
468  << "p = " << p << std::endl
469  << "v = " << v << std::endl
470  << "t1, t2, t3, t4 "
471  << t1 << ", " << t2 << ", " << t3 << ", " << t4;
472 
473  UUtils::Exception("UTet::DistanceToOut(p,v,...)", "GeomSolids1002",
474  Warning, 1, message.str().c_str());
475  if (convex)
476  {
477  convex = false; // flag normal as meaningless
478  }
479  }
480  else
481  {
482  static UVector3 normal;
483  if (tt == t1)
484  {
485  normal = fNormal123;
486  }
487  else if (tt == t2)
488  {
489  normal = fNormal134;
490  }
491  else if (tt == t3)
492  {
493  normal = fNormal142;
494  }
495  else if (tt == t4)
496  {
497  normal = fNormal234;
498  }
499  n = normal;
500  if (convex)
501  {
502  convex = true;
503  }
504  }
505 
506  return std::max(tt, 0.0); // avoid tt<0.0 by a tiny bit
507  // if we are right on a face
508 }
509 
511 //
512 // Calculate exact shortest distance to any boundary from inside
513 // - If outside return 0
514 double UTet::SafetyFromInside(const UVector3& p, bool /*aAccurate*/) const
515 {
516  double t1, t2, t3, t4;
517  t1 = fCdotN123 - p.Dot(fNormal123); // distance to plane, positive if inside
518  t2 = fCdotN134 - p.Dot(fNormal134); // distance to plane
519  t3 = fCdotN142 - p.Dot(fNormal142); // distance to plane
520  t4 = fCdotN234 - p.Dot(fNormal234); // distance to plane
521 
522  // if any one of these is negative, we are outside,
523  // so return zero in that case
524 
525  double tmin = std::min(std::min(std::min(t1, t2), t3), t4);
526  return (tmin < fTol) ? 0 : tmin;
527 }
528 
529 
531 //
532 // Stream object contents to an output stream
533 
534 std::ostream& UTet::StreamInfo(std::ostream& os) const
535 {
536  int oldprc = os.precision(16);
537  os << "-----------------------------------------------------------\n"
538  << " *** Dump for solid - " << GetName() << " ***\n"
539  << " ===================================================\n"
540  << " Solid type: UTet\n"
541  << " Parameters: \n"
542  << " anchor: " << fAnchor << " \n"
543  << " p2: " << fP2 << " \n"
544  << " p3: " << fP3 << " \n"
545  << " p4: " << fP4 << " \n"
546  << " normal123: " << fNormal123 << " \n"
547  << " normal134: " << fNormal134 << " \n"
548  << " normal142: " << fNormal142 << " \n"
549  << " normal234: " << fNormal234 << " \n"
550  << "-----------------------------------------------------------\n";
551  os.precision(oldprc);
552 
553  return os;
554 }
555 
556 
558 //
559 // GetPointOnFace
560 //
561 // Auxiliary method for get point on surface
562 
564  UVector3 p3, double& area) const
565 {
566  double lambda1, lambda2;
567  UVector3 v, w;
568 
569  v = p3 - p1;
570  w = p1 - p2;
571 
572  lambda1 = UUtils::Random(0., 1.);
573  lambda2 = UUtils::Random(0., lambda1);
574 
575  area = 0.5 * (v.Cross(w)).Mag();
576  return (p2 + lambda1 * w + lambda2 * v);
577 }
578 
580 //
581 // GetPointOnSurface
582 
584 {
585  double chose, aOne, aTwo, aThree, aFour;
586  UVector3 p1, p2, p3, p4;
587 
588  p1 = GetPointOnFace(fAnchor, fP2, fP3, aOne);
589  p2 = GetPointOnFace(fAnchor, fP4, fP3, aTwo);
590  p3 = GetPointOnFace(fAnchor, fP4, fP2, aThree);
591  p4 = GetPointOnFace(fP4, fP3, fP2, aFour);
592 
593  chose = UUtils::Random(0., aOne + aTwo + aThree + aFour);
594  if ((chose >= 0.) && (chose < aOne))
595  {
596  return p1;
597  }
598  else if ((chose >= aOne) && (chose < aOne + aTwo))
599  {
600  return p2;
601  }
602  else if ((chose >= aOne + aTwo) && (chose < aOne + aTwo + aThree))
603  {
604  return p3;
605  }
606  return p4;
607 }
608 
610 //
611 // GetVertices
612 
613 std::vector<UVector3> UTet::GetVertices() const
614 {
615  std::vector<UVector3> vertices(4);
616  vertices[0] = fAnchor;
617  vertices[1] = fP2;
618  vertices[2] = fP3;
619  vertices[3] = fP4;
620 
621  return vertices;
622 }
623 //______________________________________________________________________________
624 void UTet::Extent(UVector3& aMin, UVector3& aMax) const
625 {
626  // Returns the full 3D cartesian extent of the solid.
627  aMin.x = -fDx;
628  aMax.x = fDx;
629  aMin.y = -fDy;
630  aMax.y = fDy;
631  aMin.z = -fDz;
632  aMax.z = fDz;
633 }
634 //______________________________________________________________________________
635 void UTet::GetParametersList(int, double* aArray) const
636 {
637  aArray[0] = fAnchor.x;
638  aArray[1] = fAnchor.y;
639  aArray[2] = fAnchor.z;
640  aArray[3] = fP2.x;
641  aArray[4] = fP2.y;
642  aArray[5] = fP2.z;
643  aArray[6] = fP3.x;
644  aArray[7] = fP3.y;
645  aArray[8] = fP3.z;
646  aArray[9] = fP4.x;
647  aArray[10] = fP4.y;
648  aArray[11] = fP4.z;
649 }
650 //______________________________________________________________________________
652 {
653  return new UTet(*this);
654 }
655 //______________________________________________________________________________
657 {
658  return "Tet";
659 }
660 //______________________________________________________________________________
662 {
663  return fCubicVolume;
664 }
665 //______________________________________________________________________________
667 {
668  return fSurfaceArea;
669 }
double fSurfaceArea
Definition: UTet.hh:104
UVector3 GetPointOnSurface() const
Definition: UTet.cc:583
UVector3 fNormal234
Definition: UTet.hh:113
double fZMax
Definition: UTet.hh:118
double fMaxSize
Definition: UTet.hh:119
double fXMin
Definition: UTet.hh:118
double fZMin
Definition: UTet.hh:118
const std::string & GetName() const
Definition: VUSolid.hh:103
UVector3 Cross(const UVector3 &) const
Definition: UVector3.hh:262
G4String name
Definition: TRTMaterials.hh:40
UGeometryType GetEntityType() const
Definition: UTet.cc:656
UVector3 fP3
Definition: UTet.hh:112
UVector3 fP4
Definition: UTet.hh:112
double DistanceToIn(const UVector3 &aPoint, const UVector3 &aDirection, double aPstep=UUtils::kInfinity) const
Definition: UTet.cc:331
UVector3 fNormal123
Definition: UTet.hh:113
virtual ~UTet()
Definition: UTet.cc:146
double x
Definition: UVector3.hh:136
void Extent(UVector3 &aMin, UVector3 &aMax) const
Definition: UTet.cc:624
double fTol
Definition: UTet.hh:119
UVector3 fP2
Definition: UTet.hh:112
static double normal(HepRandomEngine *eptr)
Definition: RandPoisson.cc:77
double SurfaceArea()
Definition: UTet.cc:666
double fCdotN123
Definition: UTet.hh:117
bool Normal(const UVector3 &aPoint, UVector3 &aNormal) const
Definition: UTet.cc:256
static const double kInfinity
Definition: UUtils.hh:53
double fXMax
Definition: UTet.hh:118
UVector3 fAnchor
Definition: UTet.hh:112
double fCdotN234
Definition: UTet.hh:117
double SafetyFromOutside(const UVector3 &aPoint, bool aAccurate=false) const
Definition: UTet.cc:419
double Capacity()
Definition: UTet.cc:661
std::ostream & StreamInfo(std::ostream &os) const
Definition: UTet.cc:534
double fCdotN142
Definition: UTet.hh:117
double DistanceToOut(const UVector3 &aPoint, const UVector3 &aDirection, UVector3 &aNormalVector, bool &aConvex, double aPstep=UUtils::kInfinity) const
Definition: UTet.cc:431
UVector3 fNormal134
Definition: UTet.hh:113
double fYMin
Definition: UTet.hh:118
UVector3 fMiddle
Definition: UTet.hh:112
UVector3 fNormal142
Definition: UTet.hh:113
EnumInside
Definition: VUSolid.hh:23
UTet & operator=(const UTet &rhs)
Definition: UTet.cc:175
const G4int n
double Dot(const UVector3 &) const
Definition: UVector3.hh:257
double SafetyFromInside(const UVector3 &aPoint, bool aAccurate=false) const
Definition: UTet.cc:514
void GetParametersList(int aNumber, double *aArray) const
Definition: UTet.cc:635
double Mag() const
Definition: UVector3.cc:48
std::vector< UVector3 > GetVertices() const
Definition: UTet.cc:613
bool warningFlag
Definition: UTet.hh:115
double fDx
Definition: UTet.hh:119
T max(const T t1, const T t2)
brief Return the largest of the two arguments
UVector3 GetPointOnFace(UVector3 p1, UVector3 p2, UVector3 p3, double &area) const
Definition: UTet.cc:563
UVector3 Unit() const
Definition: UVector3.cc:80
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
double fYMax
Definition: UTet.hh:118
std::string UGeometryType
Definition: UTypes.hh:39
double fDy
Definition: UTet.hh:119
VUSolid * Clone() const
Definition: UTet.cc:651
void Exception(const char *originOfException, const char *exceptionCode, ExceptionSeverity severity, int level, const char *description)
Definition: UUtils.cc:122
double z
Definition: UVector3.hh:138
double fDz
Definition: UTet.hh:119
UTet(const std::string &name, UVector3 anchor, UVector3 p2, UVector3 p3, UVector3 p4, bool *degeneracyFlag=0)
Definition: UTet.cc:35
EnumInside Inside(const UVector3 &p) const
Definition: UTet.cc:225
double Random(double min=0.0, double max=1.0)
Definition: UUtils.cc:69
Definition: UTet.hh:27
double y
Definition: UVector3.hh:137
double fCubicVolume
Definition: UTet.hh:104
double fCdotN134
Definition: UTet.hh:117