13 #if !defined(OBB_CLASS_H_DEFINED )
14 #define OBB_CLASS_H_DEFINED
75 template<std::
size_t TDim>
96 static constexpr
double ZeroTolerance = std::numeric_limits<double>::epsilon();
137 const double BoundingBoxFactor,
138 const bool BuildFromBoundingBox =
true
143 mPointCenter(
rhs.mPointCenter),
144 mOrientationVectors(
rhs.mOrientationVectors),
145 mHalfLength(
rhs.mHalfLength)
208 bool HasIntersection(
238 virtual std::string
Info()
const
240 std::stringstream string_out_coordinates;
241 for (std::size_t
i = 0;
i < TDim; ++
i) {
242 string_out_coordinates
243 << std::setiosflags(std::ios::scientific)
244 << std::setprecision(3)
246 <<
"\t" << mPointCenter[
i];
249 std::stringstream string_out_orientation_vectors;
250 for (std::size_t
i = 0;
i < TDim; ++
i) {
251 string_out_orientation_vectors <<
"\nThe orientation axis " <<
i <<
" is: ";
252 for (std::size_t
j = 0;
j < TDim; ++
j) {
253 string_out_orientation_vectors
254 << std::setiosflags(std::ios::scientific)
255 << std::setprecision(3)
257 <<
"\t" << mOrientationVectors[
i][
j];
261 std::stringstream string_out_half_length;
262 for (std::size_t
i = 0;
i < TDim; ++
i) {
263 string_out_half_length
264 << std::setiosflags(std::ios::scientific)
265 << std::setprecision(3)
267 <<
"\t" << mHalfLength[
i];
270 return "OrientedBoundingBox in " + std::to_string(TDim) +
"D space" +
"\nWhich center is:" + string_out_coordinates.str() +
"\nThe orientation axis are: " + string_out_orientation_vectors.str() +
"\nThe half lengths are: " + string_out_half_length.str();
276 rOStream <<
Info() << std::endl;
282 rOStream <<
Info() << std::endl;
351 bool SeparatingAxisTheoremHasIntersection(
const OrientedBoundingBox& rOtherOrientedBoundingBox)
const;
359 bool GetSeparatingPlane(
371 bool GetSeparatingPlane2D(
383 bool GetSeparatingPlane3D(
418 bool CheckIsInside3D(
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Geometry base class.
Definition: geometry.h:71
An eight node hexahedra geometry with linear shape functions.
Definition: hexahedra_3d_8.h:55
Definition: amatrix_interface.h:41
This class defines the node.
Definition: node.h:65
This class defines the Oriented bounding box class.
Definition: oriented_bounding_box.h:77
~OrientedBoundingBox()
Destructor.
Definition: oriented_bounding_box.h:150
KRATOS_CLASS_POINTER_DEFINITION(OrientedBoundingBox)
Counted pointer of OrientedBoundingBox.
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: oriented_bounding_box.h:274
void GetEquivalentRotatedGeometry(OutputType &rGeometry)
This method egnerates an equiavelent geometry (debugging)
Geometry< NodeType > GeometryType
Definition of geometries.
Definition: oriented_bounding_box.h:87
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: oriented_bounding_box.h:280
OutputType GetEquivalentGeometry() const
This method egnerates an equiavelent geometry (debugging)
Node NodeType
Definition: oriented_bounding_box.h:84
bool IsInside(const OrientedBoundingBox &rOtherOrientedBoundingBox) const
Computes the intersection between two OrientedBoundingBox (current and new)
virtual std::string Info() const
Turn back information as a string.
Definition: oriented_bounding_box.h:238
OrientedBoundingBox(const GeometryType &rGeometry, const double BoundingBoxFactor, const bool BuildFromBoundingBox=true)
Default constructors (with geometry)
std::size_t SizeType
Size type definition.
Definition: oriented_bounding_box.h:93
std::conditional< TDim==2, Quadrilateral2D4< Point >, Hexahedra3D8< Point > >::type OutputType
Definition of the output type.
Definition: oriented_bounding_box.h:99
OrientedBoundingBox(const OrientedBoundingBox &rhs)
Copy constructor (not really required)
Definition: oriented_bounding_box.h:142
std::size_t IndexType
Index type definition.
Definition: oriented_bounding_box.h:90
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
OBBHasIntersectionType
This enum defines the different types of checks that can be done for the HasIntersection:
Definition: oriented_bounding_box.h:47
rhs
Definition: generate_frictional_mortar_condition.py:297
type
Definition: generate_gid_list_file.py:35
int j
Definition: quadrature.py:648
integer i
Definition: TensorModule.f:17