EBGeometry  1.0
EBGeometry_CSG.hpp
Go to the documentation of this file.
1 /* EBGeometry
2  * Copyright © 2022 Robert Marskar
3  * Please refer to Copyright.txt and LICENSE in the EBGeometry root directory.
4  */
5 
12 #ifndef EBGeometry_CSG
13 #define EBGeometry_CSG
14 
15 // Std includes
16 #include <vector>
17 #include <type_traits>
18 
19 // Our includes
22 
28 template <class T, class P = ImplicitFunction<T>>
29 std::shared_ptr<ImplicitFunction<T>>
30 Union(const std::vector<std::shared_ptr<P>>& a_implicitFunctions) noexcept;
31 
38 template <class T, class P1, class P2>
39 std::shared_ptr<ImplicitFunction<T>>
40 Union(const std::shared_ptr<P1>& a_implicitFunctionA, const std::shared_ptr<P2>& a_implicitFunctionB) noexcept;
41 
48 template <class T, class P = ImplicitFunction<T>>
49 std::shared_ptr<ImplicitFunction<T>>
50 SmoothUnion(const std::vector<std::shared_ptr<P>>& a_implicitFunctions, const T a_smooth) noexcept;
51 
59 template <class T, class P1, class P2>
60 std::shared_ptr<ImplicitFunction<T>>
61 SmoothUnion(const std::shared_ptr<P1>& a_implicitFunctionA,
62  const std::shared_ptr<P2>& a_implicitFunctionB,
63  const T a_smooth) noexcept;
64 
71 template <class T, class P, class BV, size_t K>
72 std::shared_ptr<ImplicitFunction<T>>
73 FastUnion(const std::vector<std::shared_ptr<P>>& a_implicitFunctions,
74  const std::vector<BV>& a_boundingVolumes) noexcept;
75 
83 template <class T, class P, class BV, size_t K>
84 std::shared_ptr<ImplicitFunction<T>>
85 FastSmoothUnion(const std::vector<std::shared_ptr<P>>& a_implicitFunctions,
86  const std::vector<BV>& a_boundingVolumes,
87  const T a_smoothLen) noexcept;
88 
94 template <class T, class P>
95 std::shared_ptr<ImplicitFunction<T>>
96 Intersection(const std::vector<std::shared_ptr<P>>& a_implicitFunctions) noexcept;
97 
104 template <class T, class P1, class P2>
105 std::shared_ptr<ImplicitFunction<T>>
106 Intersection(const std::shared_ptr<std::shared_ptr<P1>>& a_implicitFunctionA,
107  const std::shared_ptr<std::shared_ptr<P2>>& a_implicitFunctionB) noexcept;
108 
115 template <class T, class P>
116 std::shared_ptr<ImplicitFunction<T>>
117 SmoothIntersection(const std::vector<std::shared_ptr<P>>& a_implicitFunctions, const T a_smooth) noexcept;
118 
126 template <class T, class P1, class P2>
127 std::shared_ptr<ImplicitFunction<T>>
128 SmoothIntersection(const std::shared_ptr<P1>& a_implicitFunctionA,
129  const std::shared_ptr<P2>& a_implicitFunctionB,
130  const T a_smooth) noexcept;
131 
138 template <class T, class P1 = ImplicitFunction<T>, class P2 = ImplicitFunction<T>>
139 std::shared_ptr<ImplicitFunction<T>>
140 Difference(const std::shared_ptr<P1>& a_implicitFunctionA, const std::shared_ptr<P2>& a_implicitFunctionB) noexcept;
141 
149 template <class T, class P1 = ImplicitFunction<T>, class P2 = ImplicitFunction<T>>
150 std::shared_ptr<ImplicitFunction<T>>
151 SmoothDifference(const std::shared_ptr<P1>& a_implicitFunctionA,
152  const std::shared_ptr<P2>& a_implicitFunctionB,
153  const T a_smoothLen) noexcept;
154 
163 template <class T, class P = ImplicitFunction<T>>
164 std::shared_ptr<ImplicitFunction<T>>
165 FiniteRepetition(const std::shared_ptr<P>& a_implicitFunction,
166  const Vec3T<T>& a_period,
167  const Vec3T<T>& a_repeatLo,
168  const Vec3T<T>& a_repeatHi) noexcept;
169 
176 template <class T>
177 std::function<T(const T& a, const T& b, const T& s)> expMin = [](const T& a, const T& b, const T& s) -> T {
178  T ret = exp(-a / s) + exp(-b / s);
179 
180  return -log(ret) * s;
181 };
182 
189 template <class T>
190 std::function<T(const T& a, const T& b, const T& s)> smoothMin = [](const T& a, const T& b, const T& s) -> T {
191  const T h = std::max(s - std::abs(a - b), 0.0) / s;
192 
193  return std::min(a, b) - 0.25 * h * h * s;
194 };
195 
202 template <class T>
203 std::function<T(const T& a, const T& b, const T& s)> smoothMax = [](const T& a, const T& b, const T& s) -> T {
204  const T h = std::max(s - std::abs(a - b), 0.0) / s;
205 
206  return std::max(a, b) + 0.25 * h * h * s;
207 };
208 
212 template <class T>
213 class UnionIF : public ImplicitFunction<T>
214 {
215 public:
219  UnionIF() = delete;
220 
225  UnionIF(const std::vector<std::shared_ptr<ImplicitFunction<T>>>& a_implicitFunctions) noexcept;
226 
230  virtual ~UnionIF() = default;
231 
236  T
237  value(const Vec3T<T>& a_point) const noexcept override;
238 
239 protected:
243  std::vector<std::shared_ptr<const ImplicitFunction<T>>> m_implicitFunctions;
244 };
245 
249 template <class T>
251 {
252 public:
256  SmoothUnionIF() = delete;
257 
264  SmoothUnionIF(const std::vector<std::shared_ptr<ImplicitFunction<T>>>& a_implicitFunctions,
265  const T a_smoothLen,
266  const std::function<T(const T& a, const T& b, const T& s)> a_smoothMin = smoothMin<T>) noexcept;
267 
271  virtual ~SmoothUnionIF() = default;
272 
277  T
278  value(const Vec3T<T>& a_point) const noexcept override;
279 
280 protected:
284  std::vector<std::shared_ptr<const ImplicitFunction<T>>> m_implicitFunctions;
285 
290 
294  std::function<T(const T&, const T&, const T&)> m_smoothMin;
295 };
296 
300 template <class T, class P, class BV, size_t K>
301 class FastUnionIF : public ImplicitFunction<T>
302 {
303 public:
304  static_assert(std::is_base_of<EBGeometry::ImplicitFunction<T>, P>::value,
305  "FastUnionIF requires an implicit function");
306 
310  using Root = typename EBGeometry::BVH::LinearBVH<T, P, BV, K>;
311 
315  using Node = typename Root::LinearNode;
316 
320  FastUnionIF() = delete;
321 
326  FastUnionIF(const std::vector<std::pair<std::shared_ptr<const P>, BV>>& a_primsAndBVs) noexcept;
327 
333  FastUnionIF(const std::vector<std::shared_ptr<P>>& a_primitives, const std::vector<BV>& a_boundingVolumes) noexcept;
334 
338  virtual ~FastUnionIF() = default;
339 
344  virtual T
345  value(const Vec3T<T>& a_point) const noexcept override;
346 
350  const BV&
351  getBoundingVolume() const noexcept;
352 
353 protected:
357  std::shared_ptr<EBGeometry::BVH::LinearBVH<T, P, BV, K>> m_bvh;
358 
364  inline void
365  buildTree(const std::vector<std::pair<std::shared_ptr<const P>, BV>>& a_primsAndBVs,
366  const BVH::Build a_build = BVH::Build::TopDown) noexcept;
367 };
368 
374 template <class T, class P, class BV, size_t K>
375 class FastSmoothUnionIF : public FastUnionIF<T, P, BV, K>
376 {
377 public:
378  static_assert(std::is_base_of<EBGeometry::ImplicitFunction<T>, P>::value,
379  "FastSmoothUnionIF requires an implicit function");
380 
384  using Root = typename EBGeometry::BVH::LinearBVH<T, P, BV, K>;
385 
389  using Node = typename Root::LinearNode;
390 
394  FastSmoothUnionIF() = delete;
395 
403  FastSmoothUnionIF(const std::vector<std::shared_ptr<P>>& a_distanceFunctions,
404  const std::vector<BV>& a_boundingVolumes,
405  const T a_smoothLen,
406  const std::function<T(const T&, const T&, const T&)> a_smoothMin = smoothMin<T>) noexcept;
407 
411  virtual ~FastSmoothUnionIF() = default;
412 
417  virtual T
418  value(const Vec3T<T>& a_point) const noexcept override;
419 
420 protected:
425 
429  std::function<T(const T&, const T&, const T&)> m_smoothMin;
430 };
431 
435 template <class T>
437 {
438 public:
442  IntersectionIF() = delete;
443 
448  IntersectionIF(const std::vector<std::shared_ptr<ImplicitFunction<T>>>& a_implicitFunctions) noexcept;
449 
453  virtual ~IntersectionIF() = default;
454 
459  T
460  value(const Vec3T<T>& a_point) const noexcept override;
461 
462 protected:
466  std::vector<std::shared_ptr<const ImplicitFunction<T>>> m_implicitFunctions;
467 };
468 
472 template <class T>
474 {
475 public:
480 
488  SmoothIntersectionIF(const std::shared_ptr<ImplicitFunction<T>>& a_implicitFunctionA,
489  const std::shared_ptr<ImplicitFunction<T>>& a_implicitFunctionB,
490  const T a_smoothLen,
491  const std::function<T(const T& a, const T& b, const T& s)>& a_smoothMax = smoothMax<T>) noexcept;
492 
499  SmoothIntersectionIF(const std::vector<std::shared_ptr<ImplicitFunction<T>>>& a_implicitFunctions,
500  const T a_smoothLen,
501  const std::function<T(const T& a, const T& b, const T& s)>& a_smoothMax = smoothMax<T>) noexcept;
502 
506  virtual ~SmoothIntersectionIF() = default;
507 
512  T
513  value(const Vec3T<T>& a_point) const noexcept override;
514 
515 protected:
519  std::vector<std::shared_ptr<const ImplicitFunction<T>>> m_implicitFunctions;
520 
525 
529  std::function<T(const T& a, const T& b, const T& s)> m_smoothMax;
530 };
531 
535 template <class T>
537 {
538 public:
542  DifferenceIF() = delete;
543 
549  DifferenceIF(const std::shared_ptr<ImplicitFunction<T>>& a_implicitFunctionA,
550  const std::shared_ptr<ImplicitFunction<T>>& a_implicitFunctionB) noexcept;
551 
557  DifferenceIF(const std::shared_ptr<ImplicitFunction<T>>& a_implicitFunctionA,
558  const std::vector<std::shared_ptr<ImplicitFunction<T>>>& a_implicitFunctionsB) noexcept;
559 
563  virtual ~DifferenceIF() = default;
564 
569  T
570  value(const Vec3T<T>& a_point) const noexcept override;
571 
572 protected:
576  std::shared_ptr<ImplicitFunction<T>> m_implicitFunctionA;
577 
581  std::shared_ptr<ImplicitFunction<T>> m_implicitFunctionB;
582 };
583 
587 template <class T>
589 {
590 public:
594  SmoothDifferenceIF() = delete;
595 
603  SmoothDifferenceIF(const std::shared_ptr<ImplicitFunction<T>>& a_implicitFunctionA,
604  const std::shared_ptr<ImplicitFunction<T>>& a_implicitFunctionB,
605  const T a_smoothLen,
606  const std::function<T(const T& a, const T& b, const T& s)>& a_smoothMax = smoothMax<T>) noexcept;
607 
615  SmoothDifferenceIF(const std::shared_ptr<ImplicitFunction<T>>& a_implicitFunctionA,
616  const std::vector<std::shared_ptr<ImplicitFunction<T>>>& a_implicitFunctionsB,
617  const T a_smoothLen,
618  const std::function<T(const T& a, const T& b, const T& s)>& a_smoothMax = smoothMax<T>) noexcept;
619 
623  virtual ~SmoothDifferenceIF() = default;
624 
629  T
630  value(const Vec3T<T>& a_point) const noexcept override;
631 
632 protected:
636  std::shared_ptr<SmoothIntersectionIF<T>> m_smoothIntersectionIF;
637 };
638 
644 template <class T>
646 {
647 public:
651  FiniteRepetitionIF() = delete;
652 
660  FiniteRepetitionIF(const std::shared_ptr<ImplicitFunction<T>>& a_implicitFunction,
661  const Vec3T<T>& a_period,
662  const Vec3T<T>& a_repeatLo,
663  const Vec3T<T>& a_repeatHi) noexcept;
664 
668  virtual ~FiniteRepetitionIF() = default;
669 
674  T
675  value(const Vec3T<T>& a_point) const noexcept override;
676 
677 protected:
682 
687 
692 
696  std::shared_ptr<ImplicitFunction<T>> m_implicitFunction;
697 };
698 
700 
701 #include "EBGeometry_CSGImplem.hpp"
702 
703 #endif
std::function< T(const T &a, const T &b, const T &s)> expMin
Exponential minimum function for CSG.
Definition: EBGeometry_CSG.hpp:177
std::shared_ptr< ImplicitFunction< T > > FastSmoothUnion(const std::vector< std::shared_ptr< P >> &a_implicitFunctions, const std::vector< BV > &a_boundingVolumes, const T a_smoothLen) noexcept
Convenience function for taking the BVH-accelerated union of a bunch of a implicit functions.
std::shared_ptr< ImplicitFunction< T > > Intersection(const std::vector< std::shared_ptr< P >> &a_implicitFunctions) noexcept
Convenience function for taking the intersection of a bunch of a implicit functions.
std::shared_ptr< ImplicitFunction< T > > SmoothIntersection(const std::vector< std::shared_ptr< P >> &a_implicitFunctions, const T a_smooth) noexcept
Convenience function for taking the smooth intersection of a bunch of a implicit functions.
std::shared_ptr< ImplicitFunction< T > > SmoothDifference(const std::shared_ptr< P1 > &a_implicitFunctionA, const std::shared_ptr< P2 > &a_implicitFunctionB, const T a_smoothLen) noexcept
Convenience function for taking the smooth CSG difference.
std::shared_ptr< ImplicitFunction< T > > Union(const std::vector< std::shared_ptr< P >> &a_implicitFunctions) noexcept
Convenience function for taking the union of a bunch of a implicit functions.
std::shared_ptr< ImplicitFunction< T > > FiniteRepetition(const std::shared_ptr< P > &a_implicitFunction, const Vec3T< T > &a_period, const Vec3T< T > &a_repeatLo, const Vec3T< T > &a_repeatHi) noexcept
Convenience function for creating a periodically repeated implicit function (FiniteRepetitionIF).
std::shared_ptr< ImplicitFunction< T > > FastUnion(const std::vector< std::shared_ptr< P >> &a_implicitFunctions, const std::vector< BV > &a_boundingVolumes) noexcept
Convenience function for taking the BVH-accelerated union of a bunch of a implicit functions.
std::function< T(const T &a, const T &b, const T &s)> smoothMin
Smooth minimum function for CSG.
Definition: EBGeometry_CSG.hpp:190
std::shared_ptr< ImplicitFunction< T > > Difference(const std::shared_ptr< P1 > &a_implicitFunctionA, const std::shared_ptr< P2 > &a_implicitFunctionB) noexcept
Convenience function for taking the CSG difference.
std::shared_ptr< ImplicitFunction< T > > SmoothUnion(const std::vector< std::shared_ptr< P >> &a_implicitFunctions, const T a_smooth) noexcept
Convenience function for taking the union of a bunch of a implicit functions.
std::function< T(const T &a, const T &b, const T &s)> smoothMax
Smooth maximum function for CSG.
Definition: EBGeometry_CSG.hpp:203
Abstract base class for representing an implicit function.
Vec2T< T > max(const Vec2T< T > &u, const Vec2T< T > &v) noexcept
Maximum function. Returns new vector with component-wise minimums.
Vec2T< T > min(const Vec2T< T > &u, const Vec2T< T > &v) noexcept
Minimum function. Returns new vector with component-wise minimums.
CSG difference between two implicit functions.
Definition: EBGeometry_CSG.hpp:537
DifferenceIF(const std::shared_ptr< ImplicitFunction< T >> &a_implicitFunctionA, const std::vector< std::shared_ptr< ImplicitFunction< T >>> &a_implicitFunctionsB) noexcept
Full constructor. Computes the CSG difference between A and the union of the B's.
std::shared_ptr< ImplicitFunction< T > > m_implicitFunctionA
First implicit function.
Definition: EBGeometry_CSG.hpp:576
virtual ~DifferenceIF()=default
Destructor (does nothing)
DifferenceIF(const std::shared_ptr< ImplicitFunction< T >> &a_implicitFunctionA, const std::shared_ptr< ImplicitFunction< T >> &a_implicitFunctionB) noexcept
Full constructor. Computes the CSG difference.
DifferenceIF()=delete
Disallowed, use the full constructor.
std::shared_ptr< ImplicitFunction< T > > m_implicitFunctionB
Subtracted implicit function.
Definition: EBGeometry_CSG.hpp:581
T value(const Vec3T< T > &a_point) const noexcept override
Value function.
Implicit function smoothed union using BVHs.
Definition: EBGeometry_CSG.hpp:376
FastSmoothUnionIF()=delete
Disallowed, use the full constructor.
T m_smoothLen
Smoothing length.
Definition: EBGeometry_CSG.hpp:424
virtual ~FastSmoothUnionIF()=default
Destructor (does nothing)
std::function< T(const T &, const T &, const T &)> m_smoothMin
Smooth min operator.
Definition: EBGeometry_CSG.hpp:429
FastSmoothUnionIF(const std::vector< std::shared_ptr< P >> &a_distanceFunctions, const std::vector< BV > &a_boundingVolumes, const T a_smoothLen, const std::function< T(const T &, const T &, const T &)> a_smoothMin=smoothMin< T >) noexcept
Full constructor - constructs bounding volumes in place.
virtual T value(const Vec3T< T > &a_point) const noexcept override
Value function.
Implicit function union using BVHs.
Definition: EBGeometry_CSG.hpp:302
FastUnionIF()=delete
Disallowed, use the full constructor.
std::shared_ptr< EBGeometry::BVH::LinearBVH< T, P, BV, K > > m_bvh
Root node for linearized BVH tree.
Definition: EBGeometry_CSG.hpp:357
FastUnionIF(const std::vector< std::shared_ptr< P >> &a_primitives, const std::vector< BV > &a_boundingVolumes) noexcept
Full constructor - constructs bounding volumes in place.
typename EBGeometry::BVH::LinearBVH< T, P, BV, K > Root
Alias for linear BVH type.
Definition: EBGeometry_CSG.hpp:310
FastUnionIF(const std::vector< std::pair< std::shared_ptr< const P >, BV >> &a_primsAndBVs) noexcept
Full constructor - constructs bounding volumes in place.
typename Root::LinearNode Node
Alias for linear BVH node.
Definition: EBGeometry_CSG.hpp:315
void buildTree(const std::vector< std::pair< std::shared_ptr< const P >, BV >> &a_primsAndBVs, const BVH::Build a_build=BVH::Build::TopDown) noexcept
Build BVH tree for the input objects.
virtual T value(const Vec3T< T > &a_point) const noexcept override
Value function.
const BV & getBoundingVolume() const noexcept
Get the bounding volume.
virtual ~FastUnionIF()=default
Destructor (does nothing)
Class which creates a periodic repetition of an implicit function.
Definition: EBGeometry_CSG.hpp:646
virtual ~FiniteRepetitionIF()=default
Destructor (does nothing)
std::shared_ptr< ImplicitFunction< T > > m_implicitFunction
Underlying implicit function.
Definition: EBGeometry_CSG.hpp:696
Vec3T< T > m_repeatLo
Number of repetition over increasing coordinate direction.
Definition: EBGeometry_CSG.hpp:691
FiniteRepetitionIF(const std::shared_ptr< ImplicitFunction< T >> &a_implicitFunction, const Vec3T< T > &a_period, const Vec3T< T > &a_repeatLo, const Vec3T< T > &a_repeatHi) noexcept
Full constructor.
Vec3T< T > m_repeatHi
Number of repetition over increasing coordinate direction.
Definition: EBGeometry_CSG.hpp:686
T value(const Vec3T< T > &a_point) const noexcept override
Value function.
FiniteRepetitionIF()=delete
Disallowed - use the full constructor.
Vec3T< T > m_period
Repetition period.
Definition: EBGeometry_CSG.hpp:681
Abstract representation of an implicit function function (not necessarily signed distance).
Definition: EBGeometry_ImplicitFunction.hpp:27
CSG intersection. Computes the maximum value of all input primitives.
Definition: EBGeometry_CSG.hpp:437
T value(const Vec3T< T > &a_point) const noexcept override
Value function.
IntersectionIF()=delete
Disallowed, use the full constructor.
IntersectionIF(const std::vector< std::shared_ptr< ImplicitFunction< T >>> &a_implicitFunctions) noexcept
Full constructor. Computes the CSG intersection.
std::vector< std::shared_ptr< const ImplicitFunction< T > > > m_implicitFunctions
List of primitives.
Definition: EBGeometry_CSG.hpp:466
virtual ~IntersectionIF()=default
Destructor (does nothing)
CSG difference between two implicit functions.
Definition: EBGeometry_CSG.hpp:589
virtual ~SmoothDifferenceIF()=default
Destructor (does nothing)
SmoothDifferenceIF()=delete
Disallowed, use the full constructor.
T value(const Vec3T< T > &a_point) const noexcept override
Value function.
SmoothDifferenceIF(const std::shared_ptr< ImplicitFunction< T >> &a_implicitFunctionA, const std::vector< std::shared_ptr< ImplicitFunction< T >>> &a_implicitFunctionsB, const T a_smoothLen, const std::function< T(const T &a, const T &b, const T &s)> &a_smoothMax=smoothMax< T >) noexcept
Full constructor. Computes the CSG difference between A and the union of the B's.
SmoothDifferenceIF(const std::shared_ptr< ImplicitFunction< T >> &a_implicitFunctionA, const std::shared_ptr< ImplicitFunction< T >> &a_implicitFunctionB, const T a_smoothLen, const std::function< T(const T &a, const T &b, const T &s)> &a_smoothMax=smoothMax< T >) noexcept
Full constructor. Computes the smooth CSG difference.
std::shared_ptr< SmoothIntersectionIF< T > > m_smoothIntersectionIF
Resulting smooth intersection.
Definition: EBGeometry_CSG.hpp:636
Smooth intersection.
Definition: EBGeometry_CSG.hpp:474
std::vector< std::shared_ptr< const ImplicitFunction< T > > > m_implicitFunctions
List of primitives.
Definition: EBGeometry_CSG.hpp:519
SmoothIntersectionIF(const std::vector< std::shared_ptr< ImplicitFunction< T >>> &a_implicitFunctions, const T a_smoothLen, const std::function< T(const T &a, const T &b, const T &s)> &a_smoothMax=smoothMax< T >) noexcept
Full constructor. Computes the CSG intersection.
std::function< T(const T &a, const T &b, const T &s)> m_smoothMax
Smooth max operator.
Definition: EBGeometry_CSG.hpp:529
SmoothIntersectionIF()=delete
Disallowed, use the full constructor.
T m_smoothLen
Smoothing parameter.
Definition: EBGeometry_CSG.hpp:524
T value(const Vec3T< T > &a_point) const noexcept override
Value function.
SmoothIntersectionIF(const std::shared_ptr< ImplicitFunction< T >> &a_implicitFunctionA, const std::shared_ptr< ImplicitFunction< T >> &a_implicitFunctionB, const T a_smoothLen, const std::function< T(const T &a, const T &b, const T &s)> &a_smoothMax=smoothMax< T >) noexcept
Full constructor. Computes the CSG intersection.
virtual ~SmoothIntersectionIF()=default
Destructor (does nothing)
Smooth CSG union. Computes the minimum value of all input primitives.
Definition: EBGeometry_CSG.hpp:251
T value(const Vec3T< T > &a_point) const noexcept override
Value function.
SmoothUnionIF()=delete
Disallowed, use the full constructor.
std::vector< std::shared_ptr< const ImplicitFunction< T > > > m_implicitFunctions
List of primitives.
Definition: EBGeometry_CSG.hpp:284
std::function< T(const T &, const T &, const T &)> m_smoothMin
Function for taking the smooth minimum.
Definition: EBGeometry_CSG.hpp:294
T m_smoothLen
Smoothing parameter.
Definition: EBGeometry_CSG.hpp:289
SmoothUnionIF(const std::vector< std::shared_ptr< ImplicitFunction< T >>> &a_implicitFunctions, const T a_smoothLen, const std::function< T(const T &a, const T &b, const T &s)> a_smoothMin=smoothMin< T >) noexcept
Full constructor. Computes the CSG union.
virtual ~SmoothUnionIF()=default
Destructor (does nothing)
CSG union. Computes the minimum value of all input primitives.
Definition: EBGeometry_CSG.hpp:214
UnionIF(const std::vector< std::shared_ptr< ImplicitFunction< T >>> &a_implicitFunctions) noexcept
Full constructor. Computes the CSG union.
virtual ~UnionIF()=default
Destructor (does nothing)
std::vector< std::shared_ptr< const ImplicitFunction< T > > > m_implicitFunctions
List of primitives.
Definition: EBGeometry_CSG.hpp:243
UnionIF()=delete
Disallowed, use the full constructor.
T value(const Vec3T< T > &a_point) const noexcept override
Value function.
Three-dimensional vector class with arithmetic operators.
Definition: EBGeometry_Vec.hpp:218
Namespace for various bounding volume hierarchy (BVH) functionality.
Definition: EBGeometry_BVH.hpp:30
Build
Enum for specifying whether or not the construction is top-down or bottom-up.
Definition: EBGeometry_BVH.hpp:36
Name space for all of EBGeometry.
Definition: EBGeometry.hpp:21