![]() |
PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
|
#include <geomObjects.h>
Public Member Functions | |
| Triangle () | |
| Constructor. | |
| Triangle (double r, util::Point x=util::Point(0., 0., 0.), util::Point a=util::Point(1., 0., 0.), std::string description="uniform") | |
| Constructor. | |
| Triangle (util::Point v0, util::Point v1, util::Point v2, std::string description="vertices") | |
| Constructor from three vertices (arbitrary triangle, e.g. a V-notch). Params in decks: x1,y1,z1, x2,y2,z2, x3,y3,z3. | |
| Triangle (const Triangle &other) | |
| Copy constructor. | |
| Triangle & | operator= (const Triangle &other) |
| Assignment operator. | |
| void | transform (const util::Point &translation, const double &scale, const double &angle, const util::Point &axis, const util::Point *rotationPoint) override |
Similarity about pivot \(\mathbf p\) (default: old center d_x), then rigid displacement \(\mathbf t\) = translation: \(\mathbf y = \mathbf p + s\,\mathbf R(\mathbf x-\mathbf p) + \mathbf t\). When \(\theta=0\) and \(s=1\), \(\mathbf y = \mathbf x + \mathbf t\) for every point and the center. | |
| double | volume () const override |
| Computes the volume (area in 2d, length in 1d) of object. | |
| util::Point | center () const override |
| Computes the center of object. | |
| std::pair< util::Point, util::Point > | box () const override |
| Computes the bounding box of object. | |
| std::pair< util::Point, util::Point > | box (const double &tol) const override |
| Computes the bounding box of object. | |
| double | inscribedRadius () const override |
| Computes the radius of biggest circle/sphere completely within the object. | |
| double | boundingRadius () const override |
| Computes the radius of smallest circle/sphere such that object can be fit into it. | |
| std::string | printStr (int nt, int lvl) const override |
| Returns the string containing printable information about the object. | |
| void | print (int nt, int lvl) const override |
| Prints the information about the object. | |
| void | print () const override |
| Prints the information about the object. | |
Interaction with point | |
| bool | isInside (const util::Point &x) const override |
| Checks if point is inside this object. | |
| bool | isOutside (const util::Point &x) const override |
| Checks if point is outside of this object. | |
| bool | isNear (const util::Point &x, const double &tol) const override |
| Checks if point is within given distance of this object. | |
| bool | isNearBoundary (const util::Point &x, const double &tol, const bool &within) const override |
| cons | |
| bool | doesIntersect (const util::Point &x) const override |
| Checks if point lies exactly on the boundary. | |
Interaction with box | |
TODO Implement methods | |
| bool | isInside (const std::pair< util::Point, util::Point > &box) const override |
| Checks if box is completely inside. | |
| bool | isOutside (const std::pair< util::Point, util::Point > &box) const override |
| Checks if box is outside of the object. | |
| bool | isNear (const std::pair< util::Point, util::Point > &box, const double &tol) const override |
| Checks if box is within given distance of this object. | |
| bool | doesIntersect (const std::pair< util::Point, util::Point > &box) const override |
| Checks if box intersects this object. | |
Public Member Functions inherited from geom::GeomObject | |
| GeomObject (std::string name="", std::string description="") | |
| Constructor. | |
| virtual bool | wallContactQuery (const util::Point &x, WallContactHit &hit) const |
Closest-point / signed-gap query for analytical wall contact. Default: unsupported (returns false, clears hit). | |
Data Fields | |
| std::vector< util::Point > | d_vertices |
| Vertices. | |
| util::Point | d_x |
| Center. | |
| double | d_r |
| Distance between center and the farthest vertex of triangle. | |
| util::Point | d_a |
| Axis: defined as the vector pointing from center to the first vertex v2 +. | |
Data Fields inherited from geom::GeomObject | |
| const std::string | d_name |
| name of object | |
| const std::string | d_description |
| Further description of object. | |
| std::vector< std::string > | d_tags |
| Tags/attributes about the object. | |
Defines Triangle.
Definition at line 759 of file geomObjects.h.
|
inline |
Constructor.
Definition at line 790 of file geomObjects.h.
|
inline |
Constructor.
| r | Radius (distance of vertex from center) |
| x | Center point |
| a | Axis vector that will be rotated and scaled by r to find coordiantes of triangle vertices |
| description | Description of object (e.g., further classification or any tag) |
Definition at line 806 of file geomObjects.h.
References d_a, d_r, d_vertices, d_x, and util::rotate().
|
inline |
Constructor from three vertices (arbitrary triangle, e.g. a V-notch). Params in decks: x1,y1,z1, x2,y2,z2, x3,y3,z3.
Definition at line 826 of file geomObjects.h.
|
inline |
Copy constructor.
| other | Object to copy from |
Definition at line 852 of file geomObjects.h.
References geom::GeomObject::d_tags.
|
overridevirtual |
Computes the radius of smallest circle/sphere such that object can be fit into it.
Reimplemented from geom::GeomObject.
Definition at line 289 of file geomObjects.cpp.
References d_r.
|
overridevirtual |
Computes the bounding box of object.
Reimplemented from geom::GeomObject.
Definition at line 264 of file geomObjects.cpp.
References box().
Referenced by box(), doesIntersect(), isInside(), isNear(), isNear(), and isOutside().
|
overridevirtual |
Computes the bounding box of object.
| tol | Tolerance/padding used in creating bounding box |
Reimplemented from geom::GeomObject.
Definition at line 269 of file geomObjects.cpp.
References d_vertices, util::Point::d_x, util::Point::d_y, and util::Point::d_z.
|
overridevirtual |
Computes the center of object.
Reimplemented from geom::GeomObject.
Definition at line 260 of file geomObjects.cpp.
References d_x.
|
overridevirtual |
Checks if box intersects this object.
| box | Box |
Reimplemented from geom::GeomObject.
Definition at line 388 of file geomObjects.cpp.
References box(), geom::getCornerPoints(), and isInside().
|
overridevirtual |
Checks if point lies exactly on the boundary.
| x | Point |
Reimplemented from geom::GeomObject.
Definition at line 355 of file geomObjects.cpp.
References isNearBoundary().
|
overridevirtual |
Computes the radius of biggest circle/sphere completely within the object.
Reimplemented from geom::GeomObject.
Definition at line 284 of file geomObjects.cpp.
References d_r.
Referenced by isInside().
|
overridevirtual |
Checks if box is completely inside.
| box | Box |
Reimplemented from geom::GeomObject.
Definition at line 360 of file geomObjects.cpp.
References box(), geom::getCornerPoints(), and isInside().
|
overridevirtual |
Checks if point is inside this object.
| x | Point |
Reimplemented from geom::GeomObject.
Definition at line 294 of file geomObjects.cpp.
References d_r, d_vertices, d_x, inscribedRadius(), geom::triangleArea(), and volume().
Referenced by doesIntersect(), isInside(), isOutside(), and isOutside().
|
overridevirtual |
Checks if box is within given distance of this object.
| box | Box |
| tol | Tolerance used in checking the nearness |
Reimplemented from geom::GeomObject.
Definition at line 381 of file geomObjects.cpp.
References geom::areBoxesNear(), and box().
|
overridevirtual |
Checks if point is within given distance of this object.
| x | Point |
| tol | Tolerance used in checking the nearness |
Reimplemented from geom::GeomObject.
Definition at line 317 of file geomObjects.cpp.
References box(), and geom::isPointInsideBox().
Referenced by isNearBoundary().
|
overridevirtual |
cons
cons
Reimplemented from geom::GeomObject.
Definition at line 326 of file geomObjects.cpp.
References d_vertices, isNear(), geom::triangleArea(), and volume().
Referenced by doesIntersect().
|
overridevirtual |
Checks if box is outside of the object.
| box | Box |
Reimplemented from geom::GeomObject.
Definition at line 370 of file geomObjects.cpp.
References box(), geom::getCornerPoints(), and isInside().
|
overridevirtual |
Checks if point is outside of this object.
| x | Point |
Reimplemented from geom::GeomObject.
Definition at line 313 of file geomObjects.cpp.
References isInside().
Assignment operator.
| other | Object to copy from |
Definition at line 866 of file geomObjects.h.
References d_a, d_r, geom::GeomObject::d_tags, d_vertices, and d_x.
|
inlineoverridevirtual |
Prints the information about the object.
Reimplemented from geom::GeomObject.
Definition at line 1011 of file geomObjects.h.
References print().
Referenced by print().
|
inlineoverridevirtual |
Prints the information about the object.
| nt | Number of tabs to append before printing |
| lvl | Information level (higher means more information) |
Reimplemented from geom::GeomObject.
Definition at line 1004 of file geomObjects.h.
References printStr().
|
overridevirtual |
Returns the string containing printable information about the object.
| nt | Number of tabs to append before printing |
| lvl | Information level (higher means more information) |
Reimplemented from geom::GeomObject.
Definition at line 399 of file geomObjects.cpp.
References geom::GeomObject::d_name, d_r, d_vertices, d_x, util::io::getTabS(), util::io::printStr(), and util::Point::printStr().
Referenced by print().
|
inlineoverridevirtual |
Similarity about pivot \(\mathbf p\) (default: old center d_x), then rigid displacement \(\mathbf t\) = translation: \(\mathbf y = \mathbf p + s\,\mathbf R(\mathbf x-\mathbf p) + \mathbf t\). When \(\theta=0\) and \(s=1\), \(\mathbf y = \mathbf x + \mathbf t\) for every point and the center.
| translation | Rigid translation vector \(\mathbf t\) (added after rotate+scale about \(\mathbf p\)) |
| scale | Uniform scale factor |
| angle | Rotation angle (radians) |
| axis | Axis of rotation |
| rotationPoint | If non-null, use as \(\mathbf p\); if null, use old d_x as pivot. |
Reimplemented from geom::GeomObject.
Definition at line 880 of file geomObjects.h.
References d_a, d_r, d_vertices, d_x, geom::mapSimilarity(), and util::rotate().
|
overridevirtual |
Computes the volume (area in 2d, length in 1d) of object.
Reimplemented from geom::GeomObject.
Definition at line 255 of file geomObjects.cpp.
References d_vertices, and geom::triangleArea().
Referenced by isInside(), and isNearBoundary().
| util::Point geom::Triangle::d_a |
Axis: defined as the vector pointing from center to the first vertex v2 +.
o +
x v1
+
v3
Axis is a vector from x to v1
Definition at line 784 of file geomObjects.h.
Referenced by operator=(), transform(), and Triangle().
| double geom::Triangle::d_r |
Distance between center and the farthest vertex of triangle.
Definition at line 768 of file geomObjects.h.
Referenced by boundingRadius(), inscribedRadius(), isInside(), operator=(), printStr(), transform(), and Triangle().
| std::vector<util::Point> geom::Triangle::d_vertices |
Vertices.
Definition at line 762 of file geomObjects.h.
Referenced by box(), isInside(), isNearBoundary(), operator=(), printStr(), transform(), Triangle(), and volume().
| util::Point geom::Triangle::d_x |
Center.
Definition at line 765 of file geomObjects.h.
Referenced by center(), isInside(), operator=(), printStr(), transform(), and Triangle().