PolyDiM
C++ library for POLYtopal DIscretization Methods
Loading...
Searching...
No Matches
Gedim::GeometryUtilities Class Referencefinal

The GeometryUtilities class intersects 3D segments. More...

#include <GeometryUtilities.hpp>

Classes

struct  AlignedPolyhedronEdgesResult
 
struct  CircleDivisionByPolygonResult
 
struct  IntersectionPolygonCircleResult
 
struct  IntersectionPolyhedronLineResult
 
struct  IntersectionPolyhedronPlaneResult
 
struct  IntersectionPolyhedronsSegmentResult
 
struct  IntersectionSegmentCircleResult
 
struct  IntersectionSegmentPlaneResult
 
struct  IntersectionSegmentSegmentResult
 
struct  LinePolygonPositionResult
 
struct  MergePolyhedronsInput
 
struct  MergePolyhedronsResult
 
struct  PointPolygonPositionResult
 
struct  PointPolyhedronPositionResult
 
struct  PolygonDivisionByAngleQuadrantResult
 
struct  PolygonDivisionByCircleResult
 
struct  Polyhedron
 
struct  SegmentPolyhedronPositionResult
 
struct  SplitPolygonInput
 
struct  SplitPolygonWithCircleResult
 
struct  SplitPolygonWithPlaneResult
 
struct  SplitPolygonWithSegmentResult
 
struct  SplitPolyhedronWithPlaneResult
 

Public Types

enum struct  CompareTypes { Unknown = 0 , FirstBeforeSecond = 1 , Coincident = 2 , SecondBeforeFirst = 3 }
 
enum struct  PolygonTypes {
  Unknown = 0 , Triangle = 1 , Quadrilateral_Convex = 2 , Quadrilateral_Concave = 3 ,
  Generic_Convex = 4 , Generic_Concave = 5
}
 
enum struct  PolygonOrientations { Unknown = 0 , Clockwise = 1 , CounterClockwise = 2 }
 
enum struct  PointSegmentPositionTypes {
  Unknown = 0 , OnSegmentLineBeforeOrigin = 1 , OnSegmentOrigin = 2 , InsideSegment = 3 ,
  OnSegmentEnd = 4 , OnSegmentLineAfterEnd = 5 , LeftTheSegment = 6 , RightTheSegment = 7
}
 
enum struct  PointPlanePositionTypes { Unknown = 0 , Negative = 1 , OnPlane = 2 , Positive = 3 }
 
enum struct  PolygonCirclePositionTypes {
  Unknown = 0 , PolygonOutsideCircleNoIntersection = 1 , PolygonOutsideCircleOneIntersectionOnVertex = 2 , PolygonOutsideCircleOneIntersectionTangentOnEdge = 3 ,
  CircleInsidePolygonNoIntersection = 4 , CircleInsidePolygonOneIntersectionTangentOnEdge = 5 , PolygonInsideCircleNoIntersection = 6 , PolygonInsideCircleOneVertexIntersection = 7 ,
  PolygonInsideCircleIntersectionOnlyOnVertices = 8 , CirclePolygonMultipleIntersections = 9
}
 
enum struct  PointCirclePositionResult { Unknown = 0 , Outside = 1 , OnBorder = 2 , Inside = 3 }
 

Public Member Functions

 GeometryUtilities (const GeometryUtilitiesConfig &configuration)
 
 ~GeometryUtilities ()
 
double Tolerance1D () const
 
double Tolerance1DSquared () const
 
double Tolerance2D () const
 
double Tolerance3D () const
 
double RelativeDifference (const double &first, const double &second, const double &tolerance) const
 
CompareTypes CompareValues (const double &first, const double &second, const double &tolerance) const
 Compare two values according to tolerance.
 
bool AreValuesEqual (const double &first, const double &second, const double &tolerance) const
 Check if two values are equal according to tolerance.
 
bool IsValueGreater (const double &first, const double &second, const double &tolerance) const
 
bool IsValueGreaterOrEqual (const double &first, const double &second, const double &tolerance) const
 
bool IsValueLower (const double &first, const double &second, const double &tolerance) const
 
bool IsValueLowerOrEqual (const double &first, const double &second, const double &tolerance) const
 
bool IsValuePositive (const double &value, const double &tolerance) const
 
bool IsValueNegative (const double &value, const double &tolerance) const
 
bool IsValueZero (const double &value, const double &tolerance) const
 
Eigen::MatrixXd fibonacci_sphere (const unsigned int num_points) const
 
Eigen::MatrixXd generate_uniform_random_points_in_sphere (const unsigned int num_points, const double radius=1.0) const
 
std::vector< doubleEquispaceCoordinates (const double &step, const bool &insertExtremes) const
 
std::vector< doubleEquispaceCoordinates (const unsigned int &size, const double &origin, const double &end, const bool &insertExtremes) const
 
std::vector< doubleRandomCoordinates (const unsigned int size, const bool insertExtremes, const double &minDistance, const unsigned int seed=time(nullptr)) const
 
double PolarAngle (const Eigen::Vector3d &v_prev, const Eigen::Vector3d &v, const Eigen::Vector3d &v_next, const double &norm_v_prev_v, const double &norm_v_next_v) const
 
double Angle (const Eigen::Vector3d &v_prev, const Eigen::Vector3d &v, const Eigen::Vector3d &v_next, const double &norm_v_prev_v, const double &norm_v_next_v) const
 
double AngleRadiansToDegree (const double &rad_angle) const
 
double AngleDegreeToRadians (const double &deg_angle) const
 
double PointDistance (const Eigen::Vector3d &firstPoint, const Eigen::Vector3d &secondPoint) const
 compute the Point distance
 
Eigen::VectorXd PointDistances (const Eigen::MatrixXd &points, const Eigen::Vector3d &point) const
 compute the distance between a point and a list of points
 
Eigen::MatrixXd PointsDistance (const Eigen::MatrixXd &points) const
 
Eigen::MatrixXd PointsBoundingBox (const Eigen::MatrixXd &points) const
 
bool IsPointInBoundingBox (const Eigen::Vector3d &point, const Eigen::MatrixXd &boudingBox) const
 
bool BoundingBoxesIntersects (const Eigen::MatrixXd &boudingBox_1, const Eigen::MatrixXd &boudingBox_2) const
 
double PointsMaxDistance (const Eigen::MatrixXd &points) const
 
bool IsPointZero (const Eigen::Vector3d &point) const
 
bool PointsAreCoincident (const Eigen::Vector3d &firstPoint, const Eigen::Vector3d &secondPoint) const
 
std::vector< unsigned intFindPointInPoints (const Eigen::MatrixXd &points, const Eigen::Vector3d &point) const
 Find a point in point list.
 
double PointLineDistance (const Eigen::Vector3d &point, const Eigen::Vector3d &lineOrigin, const Eigen::Vector3d &normalToLine) const
 Compute the distance between a point and a line.
 
bool PointIs2D (const Eigen::Vector3d &point) const
 
bool PointsAre2D (const Eigen::MatrixXd &points) const
 
double PointCurvilinearCoordinate (const Eigen::Vector3d &point, const Eigen::Vector3d &segmentOrigin, const Eigen::Vector3d &segmentEnd) const
 compute the Point Curvilinear Coordinate of segment
 
double PointLineCurvilinearCoordinate (const Eigen::Vector3d &point, const Eigen::Vector3d &lineOrigin, const Eigen::Vector3d &lineTangent, const double &lineTangentSquaredLength) const
 compute the Point Curvilinear Coordinate of line
 
bool IsPointOnLine (const Eigen::Vector3d &point, const Eigen::Vector3d &lineOrigin, const Eigen::Vector3d &lineTangent, const double &lineTangentSquaredLength) const
 
PointSegmentPositionTypes PointSegmentPosition (const Eigen::Vector3d &point, const Eigen::Vector3d &segmentOrigin, const Eigen::Vector3d &segmentEnd) const
 Compute point position respect to a segment.
 
PointSegmentPositionTypes PointSegmentPosition (const double &curvilinearCoordinate) const
 Compute point position on a segment line given the curvilinear Coordinate.
 
double PointSegmentProjection (const Eigen::Vector3d &point, const Eigen::Vector3d &segmentOrigin, const Eigen::Vector3d &segmentEnd) const
 Project point on a segment line.
 
double PointPlaneDistance (const Eigen::Vector3d &point, const std::array< Eigen::Vector3d, 3 > &planePoints) const
 Compute point position respect to a plane formed by 3 points.
 
double PointPlaneDistance (const Eigen::Vector3d &point, const Eigen::Vector3d &planeNormal, const Eigen::Vector3d &planeOrigin) const
 Compute point position respect to a plane normal.
 
PointPlanePositionTypes PointPlanePosition (const double &pointPlaneDistance) const
 Compute point position respect to a plane.
 
bool IsPointOnPlane (const double &pointPlaneDistance) const
 
bool IsPointOnPlane (const Eigen::Vector3d &point, const Eigen::Vector3d &planeNormal, const Eigen::Vector3d &planeOrigin) const
 
double SegmentLength (const Eigen::Vector3d &segmentOrigin, const Eigen::Vector3d &segmentEnd) const
 
Eigen::Vector3d SegmentTangent (const Eigen::Vector3d &segmentOrigin, const Eigen::Vector3d &segmentEnd) const
 
Eigen::Vector3d SegmentNormal (const Eigen::Vector3d &segmentOrigin, const Eigen::Vector3d &segmentEnd) const
 
double SegmentSlope (const Eigen::Vector3d &segmentOrigin, const Eigen::Vector3d &segmentEnd) const
 Compute the segment slope m of line y = m * x + q.
 
double SegmentIntercept (const Eigen::Vector3d &segmentOrigin, const Eigen::Vector3d &segmentEnd) const
 Compute the segment intercept q of line y = m * x + q.
 
Eigen::MatrixXi MakeConcatenation (const Eigen::MatrixXi &segments, const unsigned int starting_vertex) const
 
bool CheckNoSpheresIntersection (const Eigen::Vector3d &firstSphereCenter, const Eigen::Vector3d &secondSphereCenter, const double &firstSphereDiameter, const double &secondSphereDiameter) const
 Check if two spheres do not intersect.
 
bool CheckTrianglesIntersection (const Eigen::MatrixX3d &triangle_one, const Eigen::MatrixX3d &triangle_two, const bool admit_boundary=true) const
 
bool AreLineCoplanar (const Eigen::Vector3d &firstLineOrigin, const Eigen::Vector3d &firstLineTangent, const Eigen::Vector3d &secondLineOrigin, const Eigen::Vector3d &secondLineTangent) const
 
bool IsPolygonCoplanar (const Eigen::Vector3d &planeNormal, const Eigen::Vector3d &planeOrigin, const Eigen::MatrixXd &polygonVertices, const std::vector< unsigned int > &polygonUnalignedVertices) const
 verify if the polygon is in the coplana to a plane
 
IntersectionSegmentSegmentResult IntersectionSegmentSegment (const Eigen::Vector3d &firstSegmentOrigin, const Eigen::Vector3d &firstSegmentEnd, const Eigen::Vector3d &secondSegmentOrigin, const Eigen::Vector3d &secondSegmentEnd) const
 Compute the intersection between the two segments.
 
std::vector< std::list< double > > IntersectionsBetweenSegments (const std::vector< Eigen::MatrixXd > &segmentsVertices, const std::vector< Eigen::Vector3d > &segmentsTangent, const std::vector< Eigen::Vector3d > &segmentsBarycenter, const std::vector< double > &segmentsLength) const
 Compute the intersection between a collection of segments.
 
Gedim::GeometryUtilities::IntersectionSegmentCircleResult IntersectionSegmentCircle (const Eigen::Vector3d &segmentOrigin, const Eigen::Vector3d &segmentEnd, const Eigen::Vector3d &circleCenter, const double &circleRadius) const
 Compute the intersection between the a segment and a circle.
 
Gedim::GeometryUtilities::IntersectionSegmentPlaneResult IntersectionSegmentPlane (const Eigen::Vector3d &segmentOrigin, const Eigen::Vector3d &segmentEnd, const Eigen::Vector3d &planeNormal, const Eigen::Vector3d &planeOrigin) const
 Intersection between a Segment, represented by origin and end and a plane represented by the normal and a point.
 
Gedim::GeometryUtilities::IntersectionPolyhedronPlaneResult IntersectionPolyhedronPlane (const Eigen::MatrixXd &polyhedronVertices, const Eigen::MatrixXi &polyhedronEdges, const std::vector< Eigen::MatrixXi > &polyhedronFaces, const Eigen::Vector3d &planeNormal, const Eigen::Vector3d &planeOrigin, const Eigen::Matrix3d &planeRotationMatrix, const Eigen::Vector3d &planeTranslation) const
 Intersection between a Polyhedron and a Plane.
 
Gedim::GeometryUtilities::SplitPolyhedronWithPlaneResult SplitPolyhedronWithPlane (const Eigen::MatrixXd &polyhedronVertices, const Eigen::MatrixXi &polyhedronEdges, const std::vector< Eigen::MatrixXi > &polyhedronFaces, const std::vector< Eigen::MatrixXd > &polyhedronFaceVertices, const std::vector< Eigen::MatrixXd > &polyhedronFaceEdgeTangents, const std::vector< Eigen::Vector3d > &polyhedronFaceTranslations, const std::vector< Eigen::Matrix3d > &polyhedronFaceRotationMatrices, const Eigen::Vector3d &planeNormal, const Eigen::Vector3d &planeOrigin, const Eigen::Matrix3d &planeRotationMatrix, const Eigen::Vector3d &planeTranslation) const
 
std::vector< GeometryUtilities::PolyhedronSplitPolyhedronWithPlaneResultToPolyhedra (const SplitPolyhedronWithPlaneResult &result) const
 
IntersectionPolyhedronLineResult IntersectionPolyhedronLine (const Eigen::MatrixXd &polyhedronVertices, const Eigen::MatrixXi &polyhedronEdges, const std::vector< Eigen::MatrixXi > &polyhedronFaces, const std::vector< Eigen::Vector3d > &polyhedronFaceNormals, const std::vector< bool > &polyhedronFaceNormalDirections, const Eigen::Vector3d &lineTangent, const Eigen::Vector3d &lineOrigin) const
 Intersection between a Polyhedron and a line.
 
Gedim::GeometryUtilities::IntersectionPolyhedronLineResult IntersectionPolyhedronSegment (const Eigen::MatrixXd &polyhedronVertices, const Eigen::MatrixXi &polyhedronEdges, const std::vector< Eigen::MatrixXi > &polyhedronFaces, const Eigen::Vector3d &segmentOrigin, const Eigen::Vector3d &segmentEnd, const Eigen::Vector3d &segmentTangent, const IntersectionPolyhedronLineResult &polyhedronLineIntersections) const
 Intersection between a Polyhedron and a segment.
 
Gedim::GeometryUtilities::IntersectionPolyhedronsSegmentResult IntersectionPolyhedronsSegment (const std::vector< Polyhedron > &polyhedrons, const std::vector< std::vector< Eigen::Vector3d > > &polyhedronFaceNormals, const std::vector< std::vector< bool > > &polyhedronFaceNormalDirections, const Eigen::Vector3d &segmentOrigin, const Eigen::Vector3d &segmentEnd, const Eigen::Vector3d &segmentTangent) const
 Intersection between a collectio of Polyhedrons and a segment.
 
Gedim::GeometryUtilities::PointPolygonPositionResult PointPolygonPosition (const Eigen::Vector3d &point, const Eigen::MatrixXd &polygonVertices) const
 Check if point is inside a polygon.
 
Gedim::GeometryUtilities::PointPolygonPositionResult PointPolygonPosition_RayCasting (const Eigen::Vector3d &point, const Eigen::MatrixXd &polygonVertices) const
 
bool IsPointInsidePolygon (const Eigen::Vector3d &point, const Eigen::MatrixXd &polygonVertices) const
 
bool IsPointInsidePolygon_RayCasting (const Eigen::Vector3d &point, const Eigen::MatrixXd &polygonVertices) const
 IsPointInsidePolygon using RayCasting algorithm (see https://en.wikipedia.org/wiki/Point_in_polygon)
 
LinePolygonPositionResult LinePolygonPosition (const Eigen::Vector3d &lineTangent, const Eigen::Vector3d &lineOrigin, const Eigen::MatrixXd &polygonVertices) const
 
Gedim::GeometryUtilities::PointPolyhedronPositionResult PointPolyhedronPosition (const Eigen::Vector3d &point, const std::vector< Eigen::MatrixXi > &polyhedronFaces, const std::vector< Eigen::MatrixXd > &polyhedronFaceVertices, const std::vector< Eigen::MatrixXd > &polyhedronFaceRotatedVertices, const std::vector< Eigen::Vector3d > &polyhedronFaceNormals, const std::vector< bool > &polyhedronFaceNormalDirections, const std::vector< Eigen::Vector3d > &polyhedronFaceTranslations, const std::vector< Eigen::Matrix3d > &polyhedronFaceRotationMatrices) const
 Check if point is inside a polygon.
 
Gedim::GeometryUtilities::PointPolyhedronPositionResult PointPolyhedronPosition (const Eigen::Vector3d &point, const std::vector< Eigen::MatrixXi > &polyhedron_faces, const std::vector< Eigen::MatrixXd > &polyhedron_faces_3D_vertices, const std::vector< Eigen::MatrixXd > &polyhedron_faces_2D_vertices, const std::vector< Eigen::Vector3d > &polyhedron_faces_normals, const std::vector< bool > &polyhedron_faces_normal_direction, const std::vector< Eigen::Vector3d > &polyhedron_faces_translation, const std::vector< Eigen::Matrix3d > &polyhedron_faces_rotation_matrix, const std::vector< Eigen::MatrixXd > &polyhedron_tetrahedrons) const
 Check if point is inside a polyhedron.
 
bool IsPointInsideTetrahedron (const Eigen::MatrixXd &tetrahedron, const Eigen::Vector3d &point) const
 
PointCirclePositionResult PointCirclePosition (const Eigen::Vector3d &point, const Eigen::Vector3d &circleCenter, const double &circleRadius) const
 Check if point is inside a circle.
 
std::vector< PointCirclePositionResultPointCirclePositions (const Eigen::MatrixXd &points, const Eigen::Vector3d &circleCenter, const double &circleRadius) const
 Check if points are inside a circle.
 
Gedim::GeometryUtilities::PolygonCirclePositionTypes PolygonCirclePosition (const Eigen::MatrixXd &polygonVertices, const Eigen::Vector3d &circleCenter, const double &circleRadius, const std::vector< PointCirclePositionResult > &vertexPositions, const IntersectionPolygonCircleResult &polygonCircleIntersections) const
 
Gedim::GeometryUtilities::IntersectionPolygonCircleResult IntersectionPolygonCircle (const Eigen::MatrixXd &polygonVertices, const Eigen::Vector3d &circleCenter, const double &circleRadius) const
 
std::vector< unsigned intPolygonTriangulationByFirstVertex (const Eigen::MatrixXd &polygonVertices) const
 Convex Polygon simple Triangulation from the first vertex.
 
std::vector< unsigned intPolygonTriangulationByEarClipping (const Eigen::MatrixXd &polygonVertices) const
 Concave Polygon Triangulation with ear clipping algorithm.
 
std::vector< unsigned intPolygonTriangulationByInternalPoint (const Eigen::MatrixXd &polygonVertices, const Eigen::Vector3d &internalPoint) const
 Convex Polygon simple Triangulation from an internal point.
 
PolygonDivisionByAngleQuadrantResult PolygonOutsideCircleDivisionByAngleQuadrant (const Eigen::MatrixXd &polygonVertices, const Eigen::MatrixXd &polygonEdgeTangents, const Eigen::Vector3d &circleCenter, const double &circleRadius, const unsigned int &curvedEdgeIndex) const
 Convex Polygon sub division by angle quadrant which intersects a polygon in a curved edge.
 
PolygonDivisionByAngleQuadrantResult PolygonInsideCircleDivisionByAngleQuadrant (const Eigen::MatrixXd &polygonVertices, const Eigen::MatrixXd &polygonEdgeTangents, const Eigen::Vector3d &circleCenter, const double &circleRadius, const unsigned int &curvedEdgeIndex) const
 Convex Polygon sub division by angle quadrant which intersects a polygon in a curved edge.
 
PolygonDivisionByCircleResult PolygonDivisionByCircle (const Eigen::MatrixXd &polygonVertices, const Eigen::MatrixXd &polygonEdgeTangents, const Eigen::Vector3d &circleCenter, const double &circleRadius, const unsigned int &curvedEdgeIndex) const
 Convex Polygon sub division from a circle which intersects a polygon in a curved edge.
 
CircleDivisionByPolygonResult CircleDivisionByPolygon (const Eigen::MatrixXd &polygonVertices, const Eigen::MatrixXd &polygonEdgeTangents, const Eigen::Vector3d &circleCenter, const double &circleRadius, const unsigned int &curvedEdgeIndex) const
 Circle division from Convex Polygon sub division which intersects a polygon in a curved edge.
 
double PolygonArea (const Eigen::MatrixXd &polygonVertices) const
 
double PolygonArea3D (const Eigen::MatrixXd &polygonVertices) const
 
Eigen::Matrix2d PolygonMass (const Eigen::Vector3d &polygonCentroid, const std::vector< Eigen::Matrix3d > &polygonTriangulationPoints) const
 
Eigen::Matrix3d PolygonInertia (const Eigen::Vector3d &polygonCentroid, const std::vector< Eigen::Matrix3d > &polygonTriangulationPoints) const
 
Gedim::GeometryUtilities::SplitPolygonWithSegmentResult SplitPolygonWithSegment (const SplitPolygonInput &input) const
 Split a polygon with n vertices numbered from 0 to n counterclockwise given a segment contained inside.
 
Gedim::GeometryUtilities::SplitPolygonWithCircleResult SplitPolygonWithCircle (const Eigen::MatrixXd &polygonVertices, const Eigen::Vector3d &circleCenter, const double &circleRadius, const std::vector< PointCirclePositionResult > &vertexPositions, const IntersectionPolygonCircleResult &polygonCircleIntersections, const PolygonCirclePositionTypes &polygonCirclePosition) const
 Split a polygon with n vertices numbered from 0 to n counterclockwise given a cirle.
 
Eigen::MatrixXd SplitPolygonWithCircleBuildSubPolygon (const SplitPolygonWithCircleResult &splitResult, const unsigned int &subPolygonIndex, const Eigen::MatrixXd &polygonVertices, const Gedim::GeometryUtilities::IntersectionPolygonCircleResult &polygonCircleIntersections) const
 Build the subpolygon coordinates from split result.
 
Gedim::GeometryUtilities::SplitPolygonWithPlaneResult SplitPolygonWithPlane (const Eigen::MatrixXd &polygonVertices, const Eigen::MatrixXd &polygonEdgeTangents, const Eigen::Vector3d &planeNormal, const Eigen::Vector3d &planeOrigin, const Eigen::Vector3d &polygonTranslation, const Eigen::Matrix3d &polygonRotationMatrix) const
 Split 3d Polygon With Plane.
 
Eigen::Vector3d PolygonNormal (const Eigen::MatrixXd &polygonVertices) const
 Compute the Polygon tridimensional normalized Normal.
 
std::array< Eigen::Vector3d, 2 > PolygonTangents (const Eigen::MatrixXd &polygonVertices, const Eigen::Vector3d &polygonNormal) const
 
Eigen::MatrixXd PolygonEdgesCentroid (const Eigen::MatrixXd &polygonVertices) const
 Compute the Polygon edges centroid.
 
Eigen::VectorXd PolygonEdgeLengths (const Eigen::MatrixXd &polygonVertices) const
 Compute the Polygon edge lengths.
 
Eigen::MatrixXd PolygonEdgeTangents (const Eigen::MatrixXd &polygonVertices) const
 Compute the Polygon edge tangents.
 
Eigen::MatrixXd PolygonEdgeNormals (const Eigen::MatrixXd &polygonVertices) const
 Compute the Polygon edge normals outgoing the polygon.
 
Eigen::Vector3d SimplexBarycenter (const Eigen::MatrixXd &vertices) const
 Compute the simplex barycenter as a mean of all vertices.
 
double SimplexMeasure (const Eigen::MatrixXd &vertices) const
 
Eigen::Vector3d SegmentBarycenter (const Eigen::Vector3d &segmentOrigin, const Eigen::Vector3d &segmentEnd) const
 Compute the segment barycenter as a mean of all vertices.
 
Eigen::Vector3d PolygonBarycenter (const Eigen::MatrixXd &polygonVertices) const
 Compute the Polygon barycenter as a mean of all vertices.
 
Eigen::Vector3d PolyhedronBarycenter (const Eigen::MatrixXd &polyhedronVertices) const
 Compute the polyhedron barycenter as a mean of all vertices.
 
Eigen::Vector3d PolygonCentroid (const Eigen::MatrixXd &polygonVertices, const double &polygonArea) const
 Compute the Polygon centroid as described in https://en.wikipedia.org/wiki/Centroid.
 
Eigen::Vector3d PolygonCentroid (const Eigen::MatrixXd &subPolygonCentroids, const Eigen::VectorXd &subPolygonAreas, const double &polygonArea) const
 Compute the Polygon centroid using polygon sub-division.
 
double PolygonAreaByBoundaryIntegral (const Eigen::MatrixXd &polygonVertices, const Eigen::VectorXd &edgeLengths, const Eigen::MatrixXd &edgeTangents, const Eigen::MatrixXd &edgeNormals, const Eigen::MatrixXd &referenceQuadraturePoints=(Eigen::MatrixXd(3, 1)<< 0.5, 0.0, 0.0).finished(), const Eigen::VectorXd &referenceQuadratureWeights=Eigen::VectorXd::Ones(1)) const
 Polygon Area By Integral on edges.
 
double PolygonAreaByInternalIntegral (const std::vector< Eigen::Matrix3d > &polygonTriangulationPoints, const Eigen::VectorXd &referenceQuadratureWeights=Eigen::VectorXd::Constant(1, 0.5)) const
 Polygon Area By Internal Integral.
 
Eigen::Vector3d PolygonCentroidByIntegral (const Eigen::MatrixXd &polygonVertices, const Eigen::VectorXd &edgeLengths, const Eigen::MatrixXd &edgeTangents, const Eigen::MatrixXd &edgeNormals, const double &polygonArea) const
 Polygon Area By Integral on edges.
 
Eigen::VectorXd PolygonCentroidEdgesDistance (const Eigen::MatrixXd &polygonVertices, const Eigen::Vector3d &polygonCentroid, const Eigen::MatrixXd &polygonEdgeNormals) const
 
Eigen::VectorXd PolygonCentroidVerticesDistance (const Eigen::MatrixXd &polygonVertices, const Eigen::Vector3d &polygonCentroid) const
 
double PolygonInRadius (const Eigen::VectorXd &polygonCentroidEdgesDistance) const
 
double PolygonAspectRatio (const double &polygonDiameter, const double &polygonInRadius) const
 
double PolygonDiameter (const Eigen::MatrixXd &polygonVertices) const
 Compute the Polygon diameter defined as the maximum distance between the vertices.
 
Eigen::Vector3d PolygonTranslation (const Eigen::MatrixXd &polygonVertices) const
 Compute the translation vector of a tridimensional Polygon.
 
Eigen::Matrix3d PolygonRotationMatrix (const Eigen::MatrixXd &polygonVertices, const Eigen::Vector3d &polygonNormal, const Eigen::Vector3d &polygonTranslation) const
 Compute the rotation matrix and translation vector of a tridimensional Polygon.
 
bool PolygonIsConvex (const Eigen::MatrixXd &polygonVertices, const Eigen::MatrixXd &convexHull) const
 Check if Polygon is Convex.
 
PolygonTypes PolygonType (const unsigned int &numPolygonVertices, const bool &isPolygonConvex) const
 
PolygonOrientations PolygonOrientation (const std::vector< unsigned int > &convexHull) const
 
std::vector< unsigned intChangePolygonOrientation (const unsigned int numPolygonVertices) const
 
Eigen::Matrix3d PlaneRotationMatrix (const Eigen::Vector3d &planeNormal) const
 Compute the rotation matrix of a plane from 2D to 3D.
 
Eigen::Vector3d PlaneTranslation (const Eigen::Vector3d &planeOrigin) const
 Compute the translation vector of a plane from 2D to 3D.
 
Eigen::Matrix3d PlaneReflectionMatrix (const Eigen::Vector3d &plane_normal) const
 
Eigen::Vector3d PlaneReflectionTranslation (const Eigen::Vector3d &plane_normal, const Eigen::Vector3d &planeOrigin) const
 
Eigen::MatrixXd PlaneToPolygon (const Eigen::Vector3d &plane_normal, const Eigen::Vector3d &plane_origin) const
 
Eigen::MatrixXd RotatePoints (const Eigen::MatrixXd &points, const Eigen::Matrix3d &rotationMatrix, const Eigen::Vector3d &translation=Eigen::Vector3d::Zero()) const
 Rotate Points P using rotation matrix Q and translation t: Q * P + t.
 
Eigen::MatrixXd RotatePointsFrom2DTo3D (const Eigen::MatrixXd &points, const Eigen::Matrix3d &rotationMatrix, const Eigen::Vector3d &translation=Eigen::Vector3d::Zero()) const
 Rotate Points P From 2D To 3D using rotation matrix Q and translation t: Q * P + t.
 
Eigen::MatrixXd RotatePointsFrom3DTo2D (const Eigen::MatrixXd &points, const Eigen::Matrix3d &rotationMatrix, const Eigen::Vector3d &translation=Eigen::Vector3d::Zero()) const
 Rotate Points P From 3D To 2D using rotation matrix Q and translation t: Q * (P - t)
 
std::vector< unsigned intConvexHull (const Eigen::MatrixXd &points, const bool &includeCollinear=true) const
 Compute the Convex Hull of 2D points.
 
std::vector< boolPointsAreAligned (const Eigen::Vector3d &segmentOrigin, const Eigen::Vector3d &segmentEnd, const Eigen::MatrixXd &points) const
 Check if a set of points are aligned to a line identified by a segment.
 
std::vector< boolPointsAreOnLine (const Eigen::MatrixXd &points, const Eigen::Vector3d &lineOrigin, const Eigen::Vector3d &lineTangent) const
 Check if a set of points are on a line.
 
bool PointIsAligned (const Eigen::Vector3d &segmentOrigin, const Eigen::Vector3d &segmentEnd, const Eigen::Vector3d &point) const
 Check if a point is aligned to a line identified by a segment.
 
bool PointIsOnLine (const Eigen::Vector3d &point, const Eigen::Vector3d &lineOrigin, const Eigen::Vector3d &lineTangent) const
 Check if a point is on a line.
 
std::array< double, 3 > PointToBarycentricCoordinates2D (const Eigen::Matrix3d &triangle, const Eigen::Vector3d &point) const
 
Eigen::Vector3d BarycentricCoordinatesToPoint2D (const Eigen::Matrix3d &triangle, const std::array< double, 3 > &barycentric_coordinates) const
 
std::vector< unsigned intUnalignedPoints (const Eigen::MatrixXd &points, const unsigned int numDesiredUnalignedPoints=0) const
 Extract the circumscribed unaligned points (minimum 2) in a set of points.
 
std::vector< unsigned intUnalignedPolyhedronPoints (const Eigen::MatrixXd &polyhedronVertices, const std::vector< Eigen::MatrixXi > &polyhedronFaces, const std::vector< Eigen::Vector3d > &polyhedronFacesTranslation, const std::vector< Eigen::Matrix3d > &polyhedronFacesRotationMatrix, const std::vector< std::vector< unsigned int > > &polyhedronUnaligedFaces, const std::vector< std::vector< unsigned int > > &polyhedronFacesUnalignedVertices) const
 Extract the circumscribed unaligned points (minimum 4) in a polyhedron.
 
AlignedPolyhedronEdgesResult AlignedPolyhedronEdges (const Eigen::MatrixXd &polyhedronVertices, const std::vector< std::vector< unsigned int > > &verticesAdjacency, const std::vector< std::vector< unsigned int > > &edgesAdjacency, const std::vector< std::unordered_map< unsigned int, unsigned int > > &adjacencyVerticesMap, const Eigen::MatrixXd &polyhedronEdgeTangents, const Eigen::VectorXd &polyhedronEdgeSquaredLenghts) const
 
Eigen::MatrixXd ExtractPoints (const Eigen::MatrixXd &points, const std::vector< unsigned int > &filter) const
 
std::vector< Eigen::Matrix3d > ExtractTriangulationPoints (const Eigen::MatrixXd &points, const std::vector< unsigned int > &pointsTriangulation) const
 
std::vector< Eigen::Matrix3d > ExtractTriangulationPointsByInternalPoint (const Eigen::MatrixXd &points, const Eigen::Vector3d &internalPoint, const std::vector< unsigned int > &pointsTriangulation) const
 
Eigen::MatrixXd CreateEllipse (const double &axisMajorLength, const double &axisMinorLength, const unsigned int &resolution) const
 Create 2D Ellipse approximation with 2D polygon.
 
Eigen::MatrixXd CreateTriangle (const Eigen::Vector3d &p1, const Eigen::Vector3d &p2, const Eigen::Vector3d &p3) const
 Create a triangle with points.
 
Eigen::MatrixXd CreateParallelogram (const Eigen::Vector3d &origin, const Eigen::Vector3d &lengthVector, const Eigen::Vector3d &widthVector) const
 Create a parallelogram with origin and dimension.
 
Eigen::MatrixXd CreateRectangle (const Eigen::Vector3d &origin, const double &base, const double &height) const
 Create a rectangle with origin and dimensions parallel to axis.
 
Eigen::MatrixXd CreateSquare (const Eigen::Vector3d &origin, const double &edgeLength) const
 Create a square with origin and dimensions parallel to axis.
 
Polyhedron CreateTetrahedronWithOrigin (const Eigen::Vector3d &origin, const Eigen::Vector3d &lengthVector, const Eigen::Vector3d &heightVector, const Eigen::Vector3d &widthVector) const
 Create a Tetrahedron with origin and dimension.
 
Polyhedron CreateTetrahedronWithVertices (const Eigen::Vector3d &v1, const Eigen::Vector3d &v2, const Eigen::Vector3d &v3, const Eigen::Vector3d &v4) const
 Create a Tetrahedron with the four vertices.
 
Polyhedron CreateParallelepipedWithOrigin (const Eigen::Vector3d &origin, const Eigen::Vector3d &lengthVector, const Eigen::Vector3d &heightVector, const Eigen::Vector3d &widthVector) const
 Create a Parallelepiped with origin and dimension.
 
Polyhedron CreatePolyhedronWithExtrusion (const Eigen::MatrixXd &polygonVertices, const Eigen::Vector3d &heightVector) const
 Create Polyhedron With Extrusion.
 
Polyhedron CreatePolyhedronWithExtrusion (const Eigen::MatrixXd &polygonVertices, const std::vector< Eigen::Vector3d > &heightVectors) const
 Create Polyhedron With Extrusion.
 
Polyhedron CreateCubeWithOrigin (const Eigen::Vector3d &origin, const double &edgeLength) const
 Create a Cube with origin aligned to axis.
 
double PolyhedronVolumeByBoundaryIntegral (const std::vector< std::vector< Eigen::Matrix3d > > &polyhedronFaceRotatedTriangulationPoints, const std::vector< Eigen::Vector3d > &polyhedronFaceNormals, const std::vector< bool > &polyhedronFaceNormalDirections, const std::vector< Eigen::Vector3d > &polyhedronFaceTranslations, const std::vector< Eigen::Matrix3d > &polyhedronFaceRotationMatrices, const Eigen::MatrixXd &referenceQuadraturePoints=(Eigen::MatrixXd(3, 1)<< 1.0/3.0, 1.0/3.0, 0.0).finished(), const Eigen::VectorXd &referenceQuadratureWeights=Eigen::VectorXd::Constant(1, 0.5)) const
 Compute the Polyhedron Volume.
 
double PolyhedronVolumeByInternalIntegral (const std::vector< Eigen::MatrixXd > &polyhedronTetrahedronVertices, const Eigen::VectorXd &referenceQuadratureWeights=Eigen::VectorXd::Constant(1, 1.0/6.0)) const
 Polyhedron Volume By Internal Integral.
 
Eigen::Vector3d PolyhedronCentroid (const std::vector< std::vector< Eigen::Matrix3d > > &polyhedronFaceRotatedTriangulationPoints, const std::vector< Eigen::Vector3d > &polyhedronFaceNormals, const std::vector< bool > &polyhedronFaceNormalDirections, const std::vector< Eigen::Vector3d > &polyhedronFaceTranslations, const std::vector< Eigen::Matrix3d > &polyhedronFaceRotationMatrices, const double &polyhedronVolume) const
 Compute the Polyhedron centroid.
 
double PolyhedronDiameter (const Eigen::MatrixXd &polyhedronVertices) const
 Compute the Polyhedron diameter defined as the maximum distance between the vertices.
 
Eigen::MatrixXd PolyhedronEdgesCentroid (const Eigen::MatrixXd &polyhedronVertices, const Eigen::MatrixXi &polyhedronEdges) const
 Compute Polyhedron Edges Centroid.
 
Eigen::VectorXd PolyhedronEdgesLength (const Eigen::MatrixXd &polyhedronVertices, const Eigen::MatrixXi &polyhedronEdges) const
 Compute Polyhedron Edges Lenght.
 
Eigen::MatrixXd PolyhedronEdgeTangents (const Eigen::MatrixXd &polyhedronVertices, const Eigen::MatrixXi &polyhedronEdges) const
 Compute Polyhedron Edges Tangent.
 
std::vector< Eigen::MatrixXd > PolyhedronFaceVertices (const Eigen::MatrixXd &polyhedronVertices, const std::vector< Eigen::MatrixXi > &polyhedronFaces) const
 Compute Polyhedron Faces Vertices.
 
std::vector< std::vector< bool > > PolyhedronFaceEdgeDirections (const Eigen::MatrixXd &polyhedronVertices, const Eigen::MatrixXi &polyhedronEdges, const std::vector< Eigen::MatrixXi > &polyhedronFaces) const
 Compute Polyhedron Faces Edge Direction.
 
std::vector< Eigen::MatrixXd > PolyhedronFaceEdgeTangents (const Eigen::MatrixXd &polyhedronVertices, const Eigen::MatrixXi &polyhedronEdges, const std::vector< Eigen::MatrixXi > &polyhedronFaces, const std::vector< std::vector< bool > > &polyhedronFaceEdgeDirections, const Eigen::MatrixXd &polyhedronEdgeTangents) const
 Compute Polyhedron Faces Edge Tangents.
 
std::vector< Eigen::Matrix3d > PolyhedronFaceRotationMatrices (const std::vector< Eigen::MatrixXd > &polyhedronFaceVertices, const std::vector< Eigen::Vector3d > &polyhedronFaceNormals, const std::vector< Eigen::Vector3d > &polyhedronFaceTranslations) const
 Compute Polyhedron Faces Rotation matrix.
 
std::vector< Eigen::Vector3d > PolyhedronFaceTranslations (const std::vector< Eigen::MatrixXd > &polyhedronFaceVertices) const
 Compute Polyhedron Faces translation vectors.
 
std::vector< Eigen::MatrixXd > PolyhedronFaceRotatedVertices (const std::vector< Eigen::MatrixXd > &polyhedronFaceVertices, const std::vector< Eigen::Vector3d > &polyhedronFaceTranslations, const std::vector< Eigen::Matrix3d > &polyhedronFaceRotationMatrices) const
 Compute Polyhedron Faces Rotated Vertices 2D.
 
std::vector< std::vector< unsigned int > > PolyhedronFacesUnalignedVertices (const std::vector< Eigen::MatrixXd > &polyhedronFacesRotatedVertices) const
 Compute Polyhedron Faces Unaligned Vertices Indices.
 
std::vector< Eigen::Vector3d > PolyhedronFaceNormals (const std::vector< Eigen::MatrixXd > &polyhedronFaceVertices) const
 Compute Polyhedron Faces Normals.
 
std::vector< std::array< Eigen::Vector3d, 2 > > PolyhedronFaceTangents (const std::vector< Eigen::MatrixXd > &polyhedronFacesVertices, const std::vector< Eigen::Vector3d > &polyhedronFacesNormal, const std::vector< bool > &polyhedronFacesNormalDirection) const
 
std::vector< Eigen::Vector3d > PolyhedronFaceBarycenter (const std::vector< Eigen::MatrixXd > &polyhedronFaceVertices) const
 Compute Polyhedron Faces barycenters.
 
Eigen::Matrix3d PolyhedronMass (const Eigen::Vector3d &polyhedronCentroid, const std::vector< Eigen::MatrixXd > &polyhedronTetrahedronPoints) const
 
Eigen::Matrix3d PolyhedronInertia (const Eigen::Vector3d &polyhedronCentroid, const std::vector< Eigen::MatrixXd > &polyhedronTetrahedraPoints) const
 
Eigen::VectorXd PolyhedronCentroidFacesDistance (const Eigen::Vector3d &polyhedronCentroid, const std::vector< Eigen::Vector3d > &polyhedronFacesNormal, const std::vector< Eigen::MatrixXd > &polyhedronFaceVertices) const
 
double PolyhedronInRadius (const Eigen::VectorXd &polyhedronCentroidFacesDistance) const
 
bool PolyhedronIsConvex (const std::vector< Eigen::MatrixXd > &polyhedronFaceVertices, const std::vector< Eigen::MatrixXd > &polyhedronFaceRotatedVertices, const std::vector< Eigen::Vector3d > &polyhedronFaceInternalPoints, const std::vector< Eigen::Vector3d > &polyhedronFaceNormals, const std::vector< bool > &polyhedronFaceNormalDirections, const Eigen::Vector3d &polyhedronInternalPoint) const
 Check if Polyhedron is Convex.
 
std::vector< boolPolyhedronFaceNormalDirections (const std::vector< Eigen::MatrixXd > &polyhedronFaceVertices, const Eigen::Vector3d &pointInsidePolyhedron, const std::vector< Eigen::Vector3d > &polyhedronFaceNormals) const
 Compute Polyhedron Face Normal Directions.
 
std::vector< boolPolyhedronFaceNormalDirections (const Eigen::MatrixXd &polyhedronVertices, const Eigen::MatrixXi &polyhedronEdges, const std::vector< Eigen::MatrixXi > &polyhedronFaces, const std::vector< Eigen::MatrixXd > &polyhedronFaceVertices, const std::vector< Eigen::Vector3d > &polyhedronFaceInternalPoints, const std::vector< Eigen::MatrixXd > &polyhedronFaceRotatedVertices, const std::vector< Eigen::Vector3d > &polyhedronFaceNormals, const std::vector< Eigen::Vector3d > &polyhedronFaceTranslations, const std::vector< Eigen::Matrix3d > &polyhedronFaceRotationMatrices) const
 Compute Polyhedron Face Normal Directions for generic polyhedron (slower)
 
std::vector< std::vector< unsigned int > > PolyhedronFaceTriangulations (const std::vector< Eigen::MatrixXi > &polyhedronFaces, const std::vector< std::vector< unsigned int > > &localFaceTriangulations) const
 Polyhedron Face Triangulations of each face.
 
std::vector< std::vector< unsigned int > > PolyhedronFaceTriangulationsByFirstVertex (const std::vector< Eigen::MatrixXi > &polyhedronFaces, const std::vector< Eigen::MatrixXd > &polyhedronFaceVertices) const
 Polyhedron Face Triangulations by first vertex of each face.
 
std::vector< std::vector< unsigned int > > PolyhedronFaceTriangulationsByEarClipping (const unsigned int numPolyhedronFaces, const std::vector< Eigen::MatrixXd > &polyhedronFaces2DVertices) const
 Polyhedron Face Triangulations by ear clipping of each face.
 
std::vector< std::vector< Eigen::Matrix3d > > PolyhedronFaceExtractTriangulationPoints (const std::vector< Eigen::MatrixXd > &polyhedronFaceVertices, const std::vector< std::vector< unsigned int > > &polyhedronFaceTriangulations) const
 
std::vector< std::vector< Eigen::Matrix3d > > PolyhedronFaceTriangulationPointsByInternalPoint (const std::vector< Eigen::MatrixXd > &polyhedronFaceVertices, const std::vector< Eigen::Vector3d > &polyhedronFaceInternalPoints, const std::vector< std::vector< unsigned int > > &polyhedronFaceTriangulations) const
 
std::vector< std::vector< unsigned int > > PolyhedronFaceTriangulationsByInternalPoint (const Eigen::MatrixXd &polyhedronVertices, const std::vector< Eigen::MatrixXi > &polyhedronFaces, const std::vector< Eigen::MatrixXd > &polyhedronFaceVertices, const std::vector< Eigen::Vector3d > &polyhedronFaceInternalPoints) const
 Polyhedron Face Triangulations by internal point of each face.
 
std::vector< unsigned intPolyhedronTetrahedronsByFaceTriangulations (const Eigen::MatrixXd &polyhedronVertices, const std::vector< Eigen::MatrixXi > &polyhedronFaces, const std::vector< std::vector< unsigned int > > &polyhedronFaceTriangulations, const Eigen::Vector3d &polyhedronInternalPoint) const
 Polyhedron Tetrahedrons By Face Triangulations.
 
std::vector< unsigned intPolyhedronTetrahedronsByFaceTriangulations (const Eigen::MatrixXd &polyhedronVertices, const std::vector< Eigen::MatrixXi > &polyhedronFaces, const std::vector< std::vector< unsigned int > > &polyhedronFaceTriangulations, const std::vector< Eigen::Vector3d > &polyhedronFaceInternalPoints, const Eigen::Vector3d &polyhedronInternalPoint) const
 Polyhedron Tetrahedrons By Face Triangulations with face internal points.
 
std::vector< Eigen::MatrixXd > ExtractTetrahedronPoints (const Eigen::MatrixXd &polyhedronVertices, const Eigen::Vector3d &polyhedronInternalPoint, const std::vector< unsigned int > &pointTetrahedrons) const
 
std::vector< Eigen::MatrixXd > ExtractTetrahedronPoints (const Eigen::MatrixXd &polyhedronVertices, const Eigen::Vector3d &polyhedronInternalPoint, const std::vector< Eigen::Vector3d > &polyhedronFaceInternalPoints, const std::vector< unsigned int > &pointTetrahedrons) const
 
std::vector< unsigned intPolyhedronCoordinateSystem (const Eigen::MatrixXd &polyhedronVertices, const Eigen::MatrixXi &polyhedronEdges)
 Get Polyhedron Coordinate System.
 
void ExportPolyhedronToVTU (const Eigen::MatrixXd &polyhedronVertices, const Eigen::MatrixXi &polyhedronEdges, const std::vector< Eigen::MatrixXi > &polyhedronFaces, const std::string &exportFolder) const
 Export Polyhedron To VTU.
 
void ExportPolyhedronToVTU (const Polyhedron &polyhedron, const std::string &exportFolder) const
 
void ExportPolyhedronToVTU (const unsigned int &index, const Eigen::MatrixXd &polyhedronVertices, const Eigen::MatrixXi &polyhedronEdges, const std::vector< Eigen::MatrixXi > &polyhedronFaces, const std::vector< Eigen::MatrixXd > &polyhedronTetra, const double &polyhedronVolume, const Eigen::Vector3d &polyhedronCentroid, const std::vector< Eigen::MatrixXd > &polyhedronFaces3DVertices, const std::vector< double > &polyhedronFacesArea, const std::vector< Eigen::Vector3d > &polyhedronFaces2DCentroid, const std::vector< Eigen::Vector3d > &polyhedronFacesTranslation, const std::vector< Eigen::Matrix3d > &polyhedronFacesRotationMatrix, const std::vector< std::vector< Eigen::Matrix3d > > &polyhedronFaces3DTriangles, const std::vector< Eigen::Vector3d > &polyhedronFaces3DInternalPoint, const std::vector< Eigen::Vector3d > &polyhedronFaces3DNormal, const std::vector< bool > &polyhedronFaces3DNormalDirection, const std::string &exportFolder) const
 Export Polyhedron To VTU.
 
void ExportPolygonToVTU (const unsigned int &index, const Eigen::MatrixXd &polygon, const std::vector< Eigen::Matrix3d > &polygon_triangles, const double &polygon_volume, const Eigen::Vector3d &polygon_centroid, const Eigen::MatrixXd &polygon_edges_centroid, const Eigen::MatrixXd &polygon_edges_normal, const std::vector< bool > &polygon_edges_normal_direction, const std::string &exportFolder) const
 
void ExportPlanteToVTU (const Eigen::Vector3d &plane_origin, const Eigen::Vector3d &plane_normal, const Eigen::Vector3d &plane_translation, const Eigen::Matrix3d &plane_rotation_matrix, const std::string &exportFolder) const
 
MergePolyhedronsInput MergePolyhedronByFace (const std::array< Polyhedron, 2 > &polyhedrons, const std::array< unsigned int, 2 > polyhedrons_common_face_index, const bool remove_common_face) const
 
MergePolyhedronsResult MergePolyhedrons (const std::array< Polyhedron, 2 > &polyhedrons, const MergePolyhedronsInput &merge_information={}) const
 Merge two Polyhedrons not intersecting.
 
std::map< unsigned int, unsigned intFacetsToVertices (const std::vector< std::vector< unsigned int > > &facets) const
 
std::map< std::pair< unsigned int, unsigned int >, unsigned intFacetsToEdges (const std::vector< std::vector< unsigned int > > &facets) const
 
Polyhedron FacetsToPolyhedron (const Eigen::MatrixXd &points, const std::vector< std::vector< unsigned int > > &facets) const
 
std::vector< std::vector< unsigned int > > PolyhedronToFacets (const Polyhedron &polyhedron) const
 
void PolygonChebyshevCenter (const Eigen::MatrixXd &polygonVertices, const Eigen::MatrixXd &edgeNormals, Eigen::Vector3d &in_center, double &in_radius, const double r0, const bool use_r0) const
 
Eigen::MatrixXi ChangePolyhedronFaceOrientation (const Gedim::GeometryUtilities::Polyhedron &polyhedron, const unsigned int face_index) const
 
std::vector< Eigen::MatrixXi > ChangePolyhedronFacesOrientation (const Gedim::GeometryUtilities::Polyhedron &polyhedron, const std::vector< bool > &faces_normal_direction) const
 Change Polyhedron Face Orientation if face_normal_direction is false.
 

Detailed Description

The GeometryUtilities class intersects 3D segments.

Member Enumeration Documentation

◆ CompareTypes

Enumerator
Unknown 
FirstBeforeSecond 
Coincident 
SecondBeforeFirst 

◆ PointCirclePositionResult

Enumerator
Unknown 
Outside 
OnBorder 
Inside 

◆ PointPlanePositionTypes

Enumerator
Unknown 
Negative 
OnPlane 
Positive 

◆ PointSegmentPositionTypes

Enumerator
Unknown 
OnSegmentLineBeforeOrigin 
OnSegmentOrigin 
InsideSegment 
OnSegmentEnd 
OnSegmentLineAfterEnd 
LeftTheSegment 
RightTheSegment 

◆ PolygonCirclePositionTypes

Enumerator
Unknown 
PolygonOutsideCircleNoIntersection 
PolygonOutsideCircleOneIntersectionOnVertex 
PolygonOutsideCircleOneIntersectionTangentOnEdge 
CircleInsidePolygonNoIntersection 
CircleInsidePolygonOneIntersectionTangentOnEdge 
PolygonInsideCircleNoIntersection 
PolygonInsideCircleOneVertexIntersection 
PolygonInsideCircleIntersectionOnlyOnVertices 
CirclePolygonMultipleIntersections 

◆ PolygonOrientations

Enumerator
Unknown 
Clockwise 
CounterClockwise 

◆ PolygonTypes

Enumerator
Unknown 
Triangle 
Quadrilateral_Convex 
Quadrilateral_Concave 
Generic_Convex 
Generic_Concave 

Constructor & Destructor Documentation

◆ GeometryUtilities()

Gedim::GeometryUtilities::GeometryUtilities ( const GeometryUtilitiesConfig configuration)

◆ ~GeometryUtilities()

Gedim::GeometryUtilities::~GeometryUtilities ( )

Member Function Documentation

◆ AlignedPolyhedronEdges()

GeometryUtilities::AlignedPolyhedronEdgesResult Gedim::GeometryUtilities::AlignedPolyhedronEdges ( const Eigen::MatrixXd &  polyhedronVertices,
const std::vector< std::vector< unsigned int > > &  verticesAdjacency,
const std::vector< std::vector< unsigned int > > &  edgesAdjacency,
const std::vector< std::unordered_map< unsigned int, unsigned int > > &  adjacencyVerticesMap,
const Eigen::MatrixXd &  polyhedronEdgeTangents,
const Eigen::VectorXd &  polyhedronEdgeSquaredLenghts 
) const

◆ Angle()

double Gedim::GeometryUtilities::Angle ( const Eigen::Vector3d &  v_prev,
const Eigen::Vector3d &  v,
const Eigen::Vector3d &  v_next,
const double norm_v_prev_v,
const double norm_v_next_v 
) const
inline
Parameters
v_prevthe previous point
vthe middle point
v_nextthe next point
Returns
the angle between the three points, computed in radians [-pi,pi] as atan2((v_next-v) x (v_prev-v),(v_next-v) . (v_prev-v))

◆ AngleDegreeToRadians()

double Gedim::GeometryUtilities::AngleDegreeToRadians ( const double deg_angle) const
inline

◆ AngleRadiansToDegree()

double Gedim::GeometryUtilities::AngleRadiansToDegree ( const double rad_angle) const
inline

◆ AreLineCoplanar()

bool Gedim::GeometryUtilities::AreLineCoplanar ( const Eigen::Vector3d &  firstLineOrigin,
const Eigen::Vector3d &  firstLineTangent,
const Eigen::Vector3d &  secondLineOrigin,
const Eigen::Vector3d &  secondLineTangent 
) const
Parameters
firstLineOriginfirst line origin
firstLineTangentfirst line tangent
secondLineOriginsecond line origin
secondLineTangentsecond line tangent
Returns
line coplanarity

◆ AreValuesEqual()

bool Gedim::GeometryUtilities::AreValuesEqual ( const double first,
const double second,
const double tolerance 
) const
inline

Check if two values are equal according to tolerance.

Parameters
firstthe first value
secondthe second value
Returns
the result

◆ BarycentricCoordinatesToPoint2D()

Eigen::Vector3d Gedim::GeometryUtilities::BarycentricCoordinatesToPoint2D ( const Eigen::Matrix3d &  triangle,
const std::array< double, 3 > &  barycentric_coordinates 
) const

◆ BoundingBoxesIntersects()

bool Gedim::GeometryUtilities::BoundingBoxesIntersects ( const Eigen::MatrixXd &  boudingBox_1,
const Eigen::MatrixXd &  boudingBox_2 
) const
inline

◆ ChangePolygonOrientation()

std::vector< unsigned int > Gedim::GeometryUtilities::ChangePolygonOrientation ( const unsigned int  numPolygonVertices) const
inline
Parameters
numPolygonVerticesthe number of polygon vertices
Returns
the new polygon vertices indices oriented in the opposite direction

◆ ChangePolyhedronFaceOrientation()

Eigen::MatrixXi Gedim::GeometryUtilities::ChangePolyhedronFaceOrientation ( const Gedim::GeometryUtilities::Polyhedron polyhedron,
const unsigned int  face_index 
) const

◆ ChangePolyhedronFacesOrientation()

std::vector< MatrixXi > Gedim::GeometryUtilities::ChangePolyhedronFacesOrientation ( const Gedim::GeometryUtilities::Polyhedron polyhedron,
const std::vector< bool > &  faces_normal_direction 
) const

Change Polyhedron Face Orientation if face_normal_direction is false.

◆ CheckNoSpheresIntersection()

bool Gedim::GeometryUtilities::CheckNoSpheresIntersection ( const Eigen::Vector3d &  firstSphereCenter,
const Eigen::Vector3d &  secondSphereCenter,
const double firstSphereDiameter,
const double secondSphereDiameter 
) const
inline

Check if two spheres do not intersect.

Parameters
firstSphereCenterthe first sphere center
secondSphereCenterthe second sphere center
firstSphereDiameterthe first sphere diameter
secondSphereDiameterthe second sphere diameter
Returns
true if the two segments do not intersect
Note
if the function returns true it does not mean that the two segments intersects

◆ CheckTrianglesIntersection()

bool Gedim::GeometryUtilities::CheckTrianglesIntersection ( const Eigen::MatrixX3d &  triangle_one,
const Eigen::MatrixX3d &  triangle_two,
const bool  admit_boundary = true 
) const

◆ CircleDivisionByPolygon()

GeometryUtilities::CircleDivisionByPolygonResult Gedim::GeometryUtilities::CircleDivisionByPolygon ( const Eigen::MatrixXd &  polygonVertices,
const Eigen::MatrixXd &  polygonEdgeTangents,
const Eigen::Vector3d &  circleCenter,
const double circleRadius,
const unsigned int curvedEdgeIndex 
) const

Circle division from Convex Polygon sub division which intersects a polygon in a curved edge.

Parameters
polygonVerticesthe polygon vertices, size 3 x numPolygonVertices
circleCenterthe circle center from which the curved edge derives
circleRadiusthe radius of the circle from which the curved edge derives
curvedEdgeIndexcurved edge index, from 0 to numPolygonVertices
Returns
the sub-division circle result
Note
the polygon should be inside the angle quadrant formed by the curved edge

◆ CompareValues()

GeometryUtilities::CompareTypes Gedim::GeometryUtilities::CompareValues ( const double first,
const double second,
const double tolerance 
) const

Compare two values according to tolerance.

Parameters
firstthe first value
secondthe second value
Returns
the result
Note
the interval [-tolerance, tolerance] is considered 0.0

◆ ConvexHull()

vector< unsigned int > Gedim::GeometryUtilities::ConvexHull ( const Eigen::MatrixXd &  points,
const bool includeCollinear = true 
) const

Compute the Convex Hull of 2D points.

Parameters
pointsthe points, size 3 x numPoints
includeCollinearinclude the collinear points, default true
Returns
the convex hull indices counterclockwise, size numConvexHullPoints, numConvexHullPoints <= numPoints
Note
works in 2D, use the Graham_scan algorithm https://en.wikipedia.org/wiki/Graham_scan

◆ CreateCubeWithOrigin()

Polyhedron Gedim::GeometryUtilities::CreateCubeWithOrigin ( const Eigen::Vector3d &  origin,
const double edgeLength 
) const
inline

Create a Cube with origin aligned to axis.

Parameters
originthe origin
edgeLengththe edge length
Returns
the cube created

◆ CreateEllipse()

MatrixXd Gedim::GeometryUtilities::CreateEllipse ( const double axisMajorLength,
const double axisMinorLength,
const unsigned int resolution 
) const

Create 2D Ellipse approximation with 2D polygon.

Parameters
axisMajorLengththe ellipse axis major length
axisMinorLengththe ellipse axis minor length
resolutionthe number of points on each ellipse quadrant
Returns
the polygon which approximate the ellipse
Note
the ellipse is centered in the origin and parallel to xy-axis

◆ CreateParallelepipedWithOrigin()

GeometryUtilities::Polyhedron Gedim::GeometryUtilities::CreateParallelepipedWithOrigin ( const Eigen::Vector3d &  origin,
const Eigen::Vector3d &  lengthVector,
const Eigen::Vector3d &  heightVector,
const Eigen::Vector3d &  widthVector 
) const

Create a Parallelepiped with origin and dimension.

Parameters
originthe origin
lengthVectorthe length vector
heightVectorthe heigth vector
widthVectorthe width vector
Returns
the parallelepiped created

◆ CreateParallelogram()

MatrixXd Gedim::GeometryUtilities::CreateParallelogram ( const Eigen::Vector3d &  origin,
const Eigen::Vector3d &  lengthVector,
const Eigen::Vector3d &  widthVector 
) const

Create a parallelogram with origin and dimension.

Parameters
originthe origin
lengthVectorthe length vector
widthVectorthe width vector

◆ CreatePolyhedronWithExtrusion() [1/2]

Polyhedron Gedim::GeometryUtilities::CreatePolyhedronWithExtrusion ( const Eigen::MatrixXd &  polygonVertices,
const Eigen::Vector3d &  heightVector 
) const
inline

Create Polyhedron With Extrusion.

Parameters
polygonthe 2D polygon vertices
heightVectorthe height vector
Returns
the polyhedron created

◆ CreatePolyhedronWithExtrusion() [2/2]

GeometryUtilities::Polyhedron Gedim::GeometryUtilities::CreatePolyhedronWithExtrusion ( const Eigen::MatrixXd &  polygonVertices,
const std::vector< Eigen::Vector3d > &  heightVectors 
) const

Create Polyhedron With Extrusion.

Parameters
polygonthe 2D polygon vertices, size 3 x numPolygonVertices
heightVectorsthe height vector to be used for each polygon vertex, size numPolygonVertices
Returns
the polyhedron created

◆ CreateRectangle()

Eigen::MatrixXd Gedim::GeometryUtilities::CreateRectangle ( const Eigen::Vector3d &  origin,
const double base,
const double height 
) const
inline

Create a rectangle with origin and dimensions parallel to axis.

Parameters
originthe origin
basethe base length
heightthe height length

◆ CreateSquare()

Eigen::MatrixXd Gedim::GeometryUtilities::CreateSquare ( const Eigen::Vector3d &  origin,
const double edgeLength 
) const
inline

Create a square with origin and dimensions parallel to axis.

Parameters
originthe origin
edgeLengththe edge length

◆ CreateTetrahedronWithOrigin()

GeometryUtilities::Polyhedron Gedim::GeometryUtilities::CreateTetrahedronWithOrigin ( const Eigen::Vector3d &  origin,
const Eigen::Vector3d &  lengthVector,
const Eigen::Vector3d &  heightVector,
const Eigen::Vector3d &  widthVector 
) const

Create a Tetrahedron with origin and dimension.

Parameters
originthe origin
lengthVectorthe length vector
heightVectorthe heigth vector
widthVectorthe width vector
Returns
the tetrahedron created

◆ CreateTetrahedronWithVertices()

GeometryUtilities::Polyhedron Gedim::GeometryUtilities::CreateTetrahedronWithVertices ( const Eigen::Vector3d &  v1,
const Eigen::Vector3d &  v2,
const Eigen::Vector3d &  v3,
const Eigen::Vector3d &  v4 
) const

Create a Tetrahedron with the four vertices.

Parameters
v1the first vertex
v2the second vertex
v3the third vertex
v4the fourth vertex
Returns
the tetrahedron created

◆ CreateTriangle()

MatrixXd Gedim::GeometryUtilities::CreateTriangle ( const Eigen::Vector3d &  p1,
const Eigen::Vector3d &  p2,
const Eigen::Vector3d &  p3 
) const

Create a triangle with points.

◆ EquispaceCoordinates() [1/2]

vector< double > Gedim::GeometryUtilities::EquispaceCoordinates ( const double step,
const bool insertExtremes 
) const
Parameters
stepthe distance between each coordinate
insertExtremesif true keeps the extremes
Returns
the equispace coordinates between [0.0, 1.0], size 1 x numCoordinates

◆ EquispaceCoordinates() [2/2]

std::vector< double > Gedim::GeometryUtilities::EquispaceCoordinates ( const unsigned int size,
const double origin,
const double end,
const bool insertExtremes 
) const
Parameters
sizethe number of resulting coordinates
originthe starting curvilinear coordinate
endthe ending curvilinear coordinate
insertExtremesif true keeps the extremes
Returns
equispaced curvilinear coordinates in the interval [origin, end]
Note
if size < 2 then size will be considered as 2

◆ ExportPlanteToVTU()

void Gedim::GeometryUtilities::ExportPlanteToVTU ( const Eigen::Vector3d &  plane_origin,
const Eigen::Vector3d &  plane_normal,
const Eigen::Vector3d &  plane_translation,
const Eigen::Matrix3d &  plane_rotation_matrix,
const std::string &  exportFolder 
) const

◆ ExportPolygonToVTU()

void Gedim::GeometryUtilities::ExportPolygonToVTU ( const unsigned int index,
const Eigen::MatrixXd &  polygon,
const std::vector< Eigen::Matrix3d > &  polygon_triangles,
const double polygon_volume,
const Eigen::Vector3d &  polygon_centroid,
const Eigen::MatrixXd &  polygon_edges_centroid,
const Eigen::MatrixXd &  polygon_edges_normal,
const std::vector< bool > &  polygon_edges_normal_direction,
const std::string &  exportFolder 
) const

◆ ExportPolyhedronToVTU() [1/3]

void Gedim::GeometryUtilities::ExportPolyhedronToVTU ( const Eigen::MatrixXd &  polyhedronVertices,
const Eigen::MatrixXi &  polyhedronEdges,
const std::vector< Eigen::MatrixXi > &  polyhedronFaces,
const std::string &  exportFolder 
) const

Export Polyhedron To VTU.

Parameters
polyhedronVerticesthe polyhedron vertices
polyhedronEdgesthe polyhedron edges
polyhedronFacesthe polyhedron faces
exportFolderthe folder in which to export

◆ ExportPolyhedronToVTU() [2/3]

void Gedim::GeometryUtilities::ExportPolyhedronToVTU ( const Polyhedron polyhedron,
const std::string &  exportFolder 
) const
inline

◆ ExportPolyhedronToVTU() [3/3]

void Gedim::GeometryUtilities::ExportPolyhedronToVTU ( const unsigned int index,
const Eigen::MatrixXd &  polyhedronVertices,
const Eigen::MatrixXi &  polyhedronEdges,
const std::vector< Eigen::MatrixXi > &  polyhedronFaces,
const std::vector< Eigen::MatrixXd > &  polyhedronTetra,
const double polyhedronVolume,
const Eigen::Vector3d &  polyhedronCentroid,
const std::vector< Eigen::MatrixXd > &  polyhedronFaces3DVertices,
const std::vector< double > &  polyhedronFacesArea,
const std::vector< Eigen::Vector3d > &  polyhedronFaces2DCentroid,
const std::vector< Eigen::Vector3d > &  polyhedronFacesTranslation,
const std::vector< Eigen::Matrix3d > &  polyhedronFacesRotationMatrix,
const std::vector< std::vector< Eigen::Matrix3d > > &  polyhedronFaces3DTriangles,
const std::vector< Eigen::Vector3d > &  polyhedronFaces3DInternalPoint,
const std::vector< Eigen::Vector3d > &  polyhedronFaces3DNormal,
const std::vector< bool > &  polyhedronFaces3DNormalDirection,
const std::string &  exportFolder 
) const

Export Polyhedron To VTU.

Parameters
polyhedronVerticesthe polyhedron vertices
polyhedronEdgesthe polyhedron edges
polyhedronFacesthe polyhedron faces
exportFolderthe folder in which to export

◆ ExtractPoints()

MatrixXd Gedim::GeometryUtilities::ExtractPoints ( const Eigen::MatrixXd &  points,
const std::vector< unsigned int > &  filter 
) const
Parameters
pointsthe points, size 3 x numPoints
filterindices counterclockwise, size numFilterPoints, numFilterPoints <= numPoints
Returns
the points coordinates filtered, size 3 x numFilterPoints

◆ ExtractTetrahedronPoints() [1/2]

std::vector< Eigen::MatrixXd > Gedim::GeometryUtilities::ExtractTetrahedronPoints ( const Eigen::MatrixXd &  polyhedronVertices,
const Eigen::Vector3d &  polyhedronInternalPoint,
const std::vector< Eigen::Vector3d > &  polyhedronFaceInternalPoints,
const std::vector< unsigned int > &  pointTetrahedrons 
) const
Parameters
polyhedronVerticesthe polyhedron vertices
polyhedronInternalPointa polyhedron internal point
polyhedronFaceInternalPointsthe polyhedron face internal points
pointTetrahedronsthe polyhedron sub-division tetrahedrons, size 1 x 4 * numTetra
Returns
the tetrahedrons coordinates, size 1 x numTetra

◆ ExtractTetrahedronPoints() [2/2]

std::vector< Eigen::MatrixXd > Gedim::GeometryUtilities::ExtractTetrahedronPoints ( const Eigen::MatrixXd &  polyhedronVertices,
const Eigen::Vector3d &  polyhedronInternalPoint,
const std::vector< unsigned int > &  pointTetrahedrons 
) const
Parameters
polyhedronVerticesthe polyhedron vertices
polyhedronInternalPointa polyhedron internal point
pointTetrahedronsthe polyhedron sub-division tetrahedrons, size 1 x 4 * numTetra
Returns
the tetrahedrons coordinates, size 1 x numTetra

◆ ExtractTriangulationPoints()

vector< Matrix3d > Gedim::GeometryUtilities::ExtractTriangulationPoints ( const Eigen::MatrixXd &  points,
const std::vector< unsigned int > &  pointsTriangulation 
) const
Parameters
pointsthe points, size 3 x numPoints
pointsTriangulationthe polygon sub-division triangulation, size 1 x 3 * numTriangles
Returns
the triangles coordinates, size 1 x numTriangles

◆ ExtractTriangulationPointsByInternalPoint()

vector< Matrix3d > Gedim::GeometryUtilities::ExtractTriangulationPointsByInternalPoint ( const Eigen::MatrixXd &  points,
const Eigen::Vector3d &  internalPoint,
const std::vector< unsigned int > &  pointsTriangulation 
) const
Parameters
pointsthe points, size 3 x numPoints
externalPointthe external point coordinates
pointsTriangulationthe polygon sub-division triangulation, size 1 x 3 * numTriangles
Returns
the triangles coordinates, size 1 x numTriangles

◆ FacetsToEdges()

std::map< std::pair< unsigned int, unsigned int >, unsigned int > Gedim::GeometryUtilities::FacetsToEdges ( const std::vector< std::vector< unsigned int > > &  facets) const

◆ FacetsToPolyhedron()

GeometryUtilities::Polyhedron Gedim::GeometryUtilities::FacetsToPolyhedron ( const Eigen::MatrixXd &  points,
const std::vector< std::vector< unsigned int > > &  facets 
) const

◆ FacetsToVertices()

std::map< unsigned int, unsigned int > Gedim::GeometryUtilities::FacetsToVertices ( const std::vector< std::vector< unsigned int > > &  facets) const

◆ fibonacci_sphere()

Eigen::MatrixXd Gedim::GeometryUtilities::fibonacci_sphere ( const unsigned int  num_points) const

◆ FindPointInPoints()

vector< unsigned int > Gedim::GeometryUtilities::FindPointInPoints ( const Eigen::MatrixXd &  points,
const Eigen::Vector3d &  point 
) const

Find a point in point list.

Parameters
pointsthe point list, size 3 x numPoints
pointthe point to find
Returns
the collection of point found

◆ generate_uniform_random_points_in_sphere()

Eigen::MatrixXd Gedim::GeometryUtilities::generate_uniform_random_points_in_sphere ( const unsigned int  num_points,
const double  radius = 1.0 
) const

◆ IntersectionPolygonCircle()

GeometryUtilities::IntersectionPolygonCircleResult Gedim::GeometryUtilities::IntersectionPolygonCircle ( const Eigen::MatrixXd &  polygonVertices,
const Eigen::Vector3d &  circleCenter,
const double circleRadius 
) const
Parameters
polygonVerticesthe matrix of vertices of the polygon (size 3 x numVertices)
circleCenterthe circle center
circleRadiusthe circle radius
Returns
the Polygon Circle reciprocal intersections
Note
tested only in 2D

◆ IntersectionPolyhedronLine()

GeometryUtilities::IntersectionPolyhedronLineResult Gedim::GeometryUtilities::IntersectionPolyhedronLine ( const Eigen::MatrixXd &  polyhedronVertices,
const Eigen::MatrixXi &  polyhedronEdges,
const std::vector< Eigen::MatrixXi > &  polyhedronFaces,
const std::vector< Eigen::Vector3d > &  polyhedronFaceNormals,
const std::vector< bool > &  polyhedronFaceNormalDirections,
const Eigen::Vector3d &  lineTangent,
const Eigen::Vector3d &  lineOrigin 
) const

Intersection between a Polyhedron and a line.

Parameters
polyhedronVerticesthe polyhedron vertices, size 3 x numVertices
polyhedronEdgesthe polyhedron edges, size 2 x numEdges
polyhedronFacesthe polyhedron face vertices and edges, size numFaces x 2 x numVertices
lineTangentthe line tangent
lineOriginthe line origin
Returns
the intersection result
Warning
NOT TESTED PROPERLY

◆ IntersectionPolyhedronPlane()

GeometryUtilities::IntersectionPolyhedronPlaneResult Gedim::GeometryUtilities::IntersectionPolyhedronPlane ( const Eigen::MatrixXd &  polyhedronVertices,
const Eigen::MatrixXi &  polyhedronEdges,
const std::vector< Eigen::MatrixXi > &  polyhedronFaces,
const Eigen::Vector3d &  planeNormal,
const Eigen::Vector3d &  planeOrigin,
const Eigen::Matrix3d &  planeRotationMatrix,
const Eigen::Vector3d &  planeTranslation 
) const

Intersection between a Polyhedron and a Plane.

Parameters
polyhedronVerticesthe polyhedron vertices, size 3 x numVertices
polyhedronEdgesthe polyhedron edges, size 2 x numEdges
polyhedronFacesthe polyhedron face vertices and edges, size numFaces x 2 x numVertices
planeNormalthe plane normal normalized
planeOriginthe plane origin
planeRotationMatrixthe plane rotation from 3D to 2D
planeTranslationthe plane translation vector
Returns
the intersection result
Note
works only with convex polyhedra

◆ IntersectionPolyhedronSegment()

GeometryUtilities::IntersectionPolyhedronLineResult Gedim::GeometryUtilities::IntersectionPolyhedronSegment ( const Eigen::MatrixXd &  polyhedronVertices,
const Eigen::MatrixXi &  polyhedronEdges,
const std::vector< Eigen::MatrixXi > &  polyhedronFaces,
const Eigen::Vector3d &  segmentOrigin,
const Eigen::Vector3d &  segmentEnd,
const Eigen::Vector3d &  segmentTangent,
const IntersectionPolyhedronLineResult polyhedronLineIntersections 
) const

Intersection between a Polyhedron and a segment.

Parameters
polyhedronVerticesthe polyhedron vertices, size 3 x numVertices
polyhedronEdgesthe polyhedron edges, size 2 x numEdges
polyhedronFacesthe polyhedron face vertices and edges, size numFaces x 2 x numVertices
segmentOriginthe segment origin
segmentEndthe segment end
segmentTangentthe segment tangent
polyhedronLineIntersectionsthe intersection between the polyhedron and the line of the segment
Returns
the intersection result ///
Warning
NOT TESTED PROPERLY

◆ IntersectionPolyhedronsSegment()

GeometryUtilities::IntersectionPolyhedronsSegmentResult Gedim::GeometryUtilities::IntersectionPolyhedronsSegment ( const std::vector< Polyhedron > &  polyhedrons,
const std::vector< std::vector< Eigen::Vector3d > > &  polyhedronFaceNormals,
const std::vector< std::vector< bool > > &  polyhedronFaceNormalDirections,
const Eigen::Vector3d &  segmentOrigin,
const Eigen::Vector3d &  segmentEnd,
const Eigen::Vector3d &  segmentTangent 
) const

Intersection between a collectio of Polyhedrons and a segment.

Parameters
polyhedronsthe polyhedron collection
polyhedronFaceNormalspolyhedron face normals
segmentOriginthe segment origin
segmentEndthe segment end
segmentTangentthe segment tangent
Returns
the intersection result
Warning
NOT TESTED PROPERLY

◆ IntersectionsBetweenSegments()

std::vector< std::list< double > > Gedim::GeometryUtilities::IntersectionsBetweenSegments ( const std::vector< Eigen::MatrixXd > &  segmentsVertices,
const std::vector< Eigen::Vector3d > &  segmentsTangent,
const std::vector< Eigen::Vector3d > &  segmentsBarycenter,
const std::vector< double > &  segmentsLength 
) const

Compute the intersection between a collection of segments.

Parameters
segmentsVerticesthe segments vertices
segmentsTangentthe segments tangent
segmentsBarycenterthe segments barycenter
segmentsLengththe segments length
Returns
for each segment the list of intersections curvilinear coordinate

◆ IntersectionSegmentCircle()

GeometryUtilities::IntersectionSegmentCircleResult Gedim::GeometryUtilities::IntersectionSegmentCircle ( const Eigen::Vector3d &  segmentOrigin,
const Eigen::Vector3d &  segmentEnd,
const Eigen::Vector3d &  circleCenter,
const double circleRadius 
) const

Compute the intersection between the a segment and a circle.

Parameters
segmentOriginfirst segment origin
segmentEndfirst segment end
circleCentercircle center
circleRadiuscircle radius
Returns
the resulting intersection
Note
tested only in 2D

◆ IntersectionSegmentPlane()

GeometryUtilities::IntersectionSegmentPlaneResult Gedim::GeometryUtilities::IntersectionSegmentPlane ( const Eigen::Vector3d &  segmentOrigin,
const Eigen::Vector3d &  segmentEnd,
const Eigen::Vector3d &  planeNormal,
const Eigen::Vector3d &  planeOrigin 
) const

Intersection between a Segment, represented by origin and end and a plane represented by the normal and a point.

Parameters
segmentOriginthe segment origin
segmentEndthe segement end
planeNormalthe plane normal normalized
planeOrigina plane point
Returns
the resulting intersection

◆ IntersectionSegmentSegment()

GeometryUtilities::IntersectionSegmentSegmentResult Gedim::GeometryUtilities::IntersectionSegmentSegment ( const Eigen::Vector3d &  firstSegmentOrigin,
const Eigen::Vector3d &  firstSegmentEnd,
const Eigen::Vector3d &  secondSegmentOrigin,
const Eigen::Vector3d &  secondSegmentEnd 
) const

Compute the intersection between the two segments.

Parameters
firstSegmentOriginfirst segment origin
firstSegmentEndfirst segment end
secondSegmentOriginsecond segment origin
secondSegmentEndsecond segment end
Returns
the resulting intersection
Note
no check is performed

◆ IsPointInBoundingBox()

bool Gedim::GeometryUtilities::IsPointInBoundingBox ( const Eigen::Vector3d &  point,
const Eigen::MatrixXd &  boudingBox 
) const
inline
Parameters
pointthe point
boudingBoxthe bounding box points (xmin, ymin, zmin) and (xmax, ymax, zmax), size 2 x numPoints
Returns
false if the point is outside the bounding box, true otherwise (border or inside)

◆ IsPointInsidePolygon()

bool Gedim::GeometryUtilities::IsPointInsidePolygon ( const Eigen::Vector3d &  point,
const Eigen::MatrixXd &  polygonVertices 
) const
inline
Parameters
pointthe point
polygonVerticesthe matrix of vertices of the polygon (size 3 x numVertices)
Returns
false if it is outside, true the other cases
Warning
works only in 2D with convex polygons

◆ IsPointInsidePolygon_RayCasting()

bool Gedim::GeometryUtilities::IsPointInsidePolygon_RayCasting ( const Eigen::Vector3d &  point,
const Eigen::MatrixXd &  polygonVertices 
) const
inline

IsPointInsidePolygon using RayCasting algorithm (see https://en.wikipedia.org/wiki/Point_in_polygon)

Parameters
pointthe point
polygonVerticesthe matrix of vertices of the polygon (size 3 x numVertices)
Returns
false if it is outside, true the other cases

◆ IsPointInsideTetrahedron()

bool Gedim::GeometryUtilities::IsPointInsideTetrahedron ( const Eigen::MatrixXd &  tetrahedron,
const Eigen::Vector3d &  point 
) const

◆ IsPointOnLine()

bool Gedim::GeometryUtilities::IsPointOnLine ( const Eigen::Vector3d &  point,
const Eigen::Vector3d &  lineOrigin,
const Eigen::Vector3d &  lineTangent,
const double lineTangentSquaredLength 
) const
Parameters
pointthe point
lineOriginthe line origin
lineTangentthe line tangent
lineTangentSquaredLengththe line tangent length squared
Returns
true if the point belongs on line

◆ IsPointOnPlane() [1/2]

bool Gedim::GeometryUtilities::IsPointOnPlane ( const double pointPlaneDistance) const
inline
Parameters
pointPlaneDistancethe point plane distance
Returns
true if point is on the plane

◆ IsPointOnPlane() [2/2]

bool Gedim::GeometryUtilities::IsPointOnPlane ( const Eigen::Vector3d &  point,
const Eigen::Vector3d &  planeNormal,
const Eigen::Vector3d &  planeOrigin 
) const
inline
Parameters
pointthe point
planeNormalthe plane normal
planeOriginthe plane origin
Returns
true if point is on the plane

◆ IsPointZero()

bool Gedim::GeometryUtilities::IsPointZero ( const Eigen::Vector3d &  point) const
inline

◆ IsPolygonCoplanar()

bool Gedim::GeometryUtilities::IsPolygonCoplanar ( const Eigen::Vector3d &  planeNormal,
const Eigen::Vector3d &  planeOrigin,
const Eigen::MatrixXd &  polygonVertices,
const std::vector< unsigned int > &  polygonUnalignedVertices 
) const

verify if the polygon is in the coplana to a plane

◆ IsValueGreater()

bool Gedim::GeometryUtilities::IsValueGreater ( const double first,
const double second,
const double tolerance 
) const
inline
Parameters
firstthe first value
secondthe second value
Returns
true if first is greater than second

◆ IsValueGreaterOrEqual()

bool Gedim::GeometryUtilities::IsValueGreaterOrEqual ( const double first,
const double second,
const double tolerance 
) const
inline
Parameters
firstthe first value
secondthe second value
Returns
true if first is greater or equal than second

◆ IsValueLower()

bool Gedim::GeometryUtilities::IsValueLower ( const double first,
const double second,
const double tolerance 
) const
inline

◆ IsValueLowerOrEqual()

bool Gedim::GeometryUtilities::IsValueLowerOrEqual ( const double first,
const double second,
const double tolerance 
) const
inline

◆ IsValueNegative()

bool Gedim::GeometryUtilities::IsValueNegative ( const double value,
const double tolerance 
) const
inline
Parameters
valuethe value
Returns
true if value is negative

◆ IsValuePositive()

bool Gedim::GeometryUtilities::IsValuePositive ( const double value,
const double tolerance 
) const
inline
Parameters
valuethe value
Returns
true if value is positive

◆ IsValueZero()

bool Gedim::GeometryUtilities::IsValueZero ( const double value,
const double tolerance 
) const
inline
Parameters
valuethe value
Returns
true if value is zero

◆ LinePolygonPosition()

Gedim::GeometryUtilities::LinePolygonPositionResult Gedim::GeometryUtilities::LinePolygonPosition ( const Eigen::Vector3d &  lineTangent,
const Eigen::Vector3d &  lineOrigin,
const Eigen::MatrixXd &  polygonVertices 
) const

◆ MakeConcatenation()

Eigen::MatrixXi Gedim::GeometryUtilities::MakeConcatenation ( const Eigen::MatrixXi &  segments,
const unsigned int  starting_vertex 
) const

◆ MergePolyhedronByFace()

GeometryUtilities::MergePolyhedronsInput Gedim::GeometryUtilities::MergePolyhedronByFace ( const std::array< Polyhedron, 2 > &  polyhedrons,
const std::array< unsigned int, 2 >  polyhedrons_common_face_index,
const bool  remove_common_face 
) const

◆ MergePolyhedrons()

GeometryUtilities::MergePolyhedronsResult Gedim::GeometryUtilities::MergePolyhedrons ( const std::array< Polyhedron, 2 > &  polyhedrons,
const MergePolyhedronsInput merge_information = {} 
) const

Merge two Polyhedrons not intersecting.

Parameters
polyhedronsthe polyhedrons to merge
Returns
the merged polyhedron data

◆ PlaneReflectionMatrix()

Eigen::Matrix3d Gedim::GeometryUtilities::PlaneReflectionMatrix ( const Eigen::Vector3d &  plane_normal) const

◆ PlaneReflectionTranslation()

Eigen::Vector3d Gedim::GeometryUtilities::PlaneReflectionTranslation ( const Eigen::Vector3d &  plane_normal,
const Eigen::Vector3d &  planeOrigin 
) const

◆ PlaneRotationMatrix()

Matrix3d Gedim::GeometryUtilities::PlaneRotationMatrix ( const Eigen::Vector3d &  planeNormal) const

Compute the rotation matrix of a plane from 2D to 3D.

Parameters
planeNormalthe normalized normal of the plane
Returns
the resulting rotation matrix Q which rotates 2D points to 3D points
Note
to rotate some point P from 2D to 3D use Q * P + t
to rotate some point P from 3D to 2D use Q^T * (P - t)

◆ PlaneToPolygon()

MatrixXd Gedim::GeometryUtilities::PlaneToPolygon ( const Eigen::Vector3d &  plane_normal,
const Eigen::Vector3d &  plane_origin 
) const

◆ PlaneTranslation()

Eigen::Vector3d Gedim::GeometryUtilities::PlaneTranslation ( const Eigen::Vector3d &  planeOrigin) const
inline

Compute the translation vector of a plane from 2D to 3D.

Parameters
planeNormalthe normalized normal of the plane
planeOriginthe 3D plane origin
Returns
the resulting translation vector t which translates 2D points to 3D points
Note
to rotate some point P from 2D to 3D use Q * P + t
to rotate some point P from 3D to 2D use Q^T * (P - t)

◆ PointCirclePosition()

GeometryUtilities::PointCirclePositionResult Gedim::GeometryUtilities::PointCirclePosition ( const Eigen::Vector3d &  point,
const Eigen::Vector3d &  circleCenter,
const double circleRadius 
) const

Check if point is inside a circle.

Parameters
pointthe point
circleCenterthe circle center
circleRadiusthe circle radius
resultthe resulting position
Note
tested only in 2D

◆ PointCirclePositions()

vector< GeometryUtilities::PointCirclePositionResult > Gedim::GeometryUtilities::PointCirclePositions ( const Eigen::MatrixXd &  points,
const Eigen::Vector3d &  circleCenter,
const double circleRadius 
) const

Check if points are inside a circle.

Parameters
pointsthe matrix of points (size 3 x numVertices)
circleCenterthe circle center
circleRadiusthe circle radius
resultthe resulting positions
Note
tested only in 2D

◆ PointCurvilinearCoordinate()

double Gedim::GeometryUtilities::PointCurvilinearCoordinate ( const Eigen::Vector3d &  point,
const Eigen::Vector3d &  segmentOrigin,
const Eigen::Vector3d &  segmentEnd 
) const
inline

compute the Point Curvilinear Coordinate of segment

Parameters
pointthe point
segmentOriginthe segment origin
segmentEndthe segment end
Returns
the curvilinear coordinate computed

◆ PointDistance()

double Gedim::GeometryUtilities::PointDistance ( const Eigen::Vector3d &  firstPoint,
const Eigen::Vector3d &  secondPoint 
) const
inline

compute the Point distance

Parameters
firstPointthe first point
secondPointthe second point
Returns
the distance

◆ PointDistances()

Eigen::VectorXd Gedim::GeometryUtilities::PointDistances ( const Eigen::MatrixXd &  points,
const Eigen::Vector3d &  point 
) const

compute the distance between a point and a list of points

Parameters
pointsthe point collection, size 3 x numPoints
pointthe point
Returns
the collection of distances, size 1 x numPoints

◆ PointIs2D()

bool Gedim::GeometryUtilities::PointIs2D ( const Eigen::Vector3d &  point) const
inline
Parameters
pointthe point
Returns
true if the point is 2D (z == 0)

◆ PointIsAligned()

bool Gedim::GeometryUtilities::PointIsAligned ( const Eigen::Vector3d &  segmentOrigin,
const Eigen::Vector3d &  segmentEnd,
const Eigen::Vector3d &  point 
) const
inline

Check if a point is aligned to a line identified by a segment.

Parameters
segmentOriginsegment origin of the line
segmentEndsegment end of the line
pointthe point
Returns
true if the point is aligned

◆ PointIsOnLine()

bool Gedim::GeometryUtilities::PointIsOnLine ( const Eigen::Vector3d &  point,
const Eigen::Vector3d &  lineOrigin,
const Eigen::Vector3d &  lineTangent 
) const
inline

Check if a point is on a line.

Parameters
pointthe point
lineTangentthe line tangent
lineOriginthe line origin
Returns
true if the point is aligned

◆ PointLineCurvilinearCoordinate()

double Gedim::GeometryUtilities::PointLineCurvilinearCoordinate ( const Eigen::Vector3d &  point,
const Eigen::Vector3d &  lineOrigin,
const Eigen::Vector3d &  lineTangent,
const double lineTangentSquaredLength 
) const
inline

compute the Point Curvilinear Coordinate of line

Parameters
pointthe point
lineOriginthe line origin
lineTangentthe line tangent
lineTangentSquaredLengththe line tangent length squared
Returns
the curvilinear coordinate computed

◆ PointLineDistance()

double Gedim::GeometryUtilities::PointLineDistance ( const Eigen::Vector3d &  point,
const Eigen::Vector3d &  lineOrigin,
const Eigen::Vector3d &  normalToLine 
) const
inline

Compute the distance between a point and a line.

Parameters
pointa point P
lineOriginthe line origin O
normalToLinea normal vector n to the line, in the same plane of P and the line
Returns
the distance d
Note
The distance is computed as d = n^T * (P - O) / ||n||

◆ PointPlaneDistance() [1/2]

double Gedim::GeometryUtilities::PointPlaneDistance ( const Eigen::Vector3d &  point,
const Eigen::Vector3d &  planeNormal,
const Eigen::Vector3d &  planeOrigin 
) const

Compute point position respect to a plane normal.

Parameters
planeNormalthe plane normal
planeOriginthe plane origin
pointthe point
Returns
the signed point distance, 0.0 on plane, positive above, negative bottom

◆ PointPlaneDistance() [2/2]

double Gedim::GeometryUtilities::PointPlaneDistance ( const Eigen::Vector3d &  point,
const std::array< Eigen::Vector3d, 3 > &  planePoints 
) const

Compute point position respect to a plane formed by 3 points.

Parameters
planePointsthe 3 plane points
pointthe point
Returns
the signed point distance, 0.0 on plane, positive above, negative bottom

◆ PointPlanePosition()

GeometryUtilities::PointPlanePositionTypes Gedim::GeometryUtilities::PointPlanePosition ( const double pointPlaneDistance) const

Compute point position respect to a plane.

Parameters
pointPlaneDistancethe point plane distance
Returns
result the point position

◆ PointPolygonPosition()

GeometryUtilities::PointPolygonPositionResult Gedim::GeometryUtilities::PointPolygonPosition ( const Eigen::Vector3d &  point,
const Eigen::MatrixXd &  polygonVertices 
) const

Check if point is inside a polygon.

Parameters
pointthe point
polygonVerticesthe matrix of vertices of the polygon (size 3 x numVertices)
Returns
the resulting position
Warning
works only in 2D with convex polygons

◆ PointPolygonPosition_RayCasting()

GeometryUtilities::PointPolygonPositionResult Gedim::GeometryUtilities::PointPolygonPosition_RayCasting ( const Eigen::Vector3d &  point,
const Eigen::MatrixXd &  polygonVertices 
) const

◆ PointPolyhedronPosition() [1/2]

Gedim::GeometryUtilities::PointPolyhedronPositionResult Gedim::GeometryUtilities::PointPolyhedronPosition ( const Eigen::Vector3d &  point,
const std::vector< Eigen::MatrixXi > &  polyhedron_faces,
const std::vector< Eigen::MatrixXd > &  polyhedron_faces_3D_vertices,
const std::vector< Eigen::MatrixXd > &  polyhedron_faces_2D_vertices,
const std::vector< Eigen::Vector3d > &  polyhedron_faces_normals,
const std::vector< bool > &  polyhedron_faces_normal_direction,
const std::vector< Eigen::Vector3d > &  polyhedron_faces_translation,
const std::vector< Eigen::Matrix3d > &  polyhedron_faces_rotation_matrix,
const std::vector< Eigen::MatrixXd > &  polyhedron_tetrahedrons 
) const

Check if point is inside a polyhedron.

Parameters
pointthe point
polyhedronFacesthe polyhedron faces, size numPolyhedronFaces
polyhedronFaceVerticesthe polyhedron face 3D vertices, size numPolyhedronFaces
polyhedronFaceRotatedVerticesthe polyhedron face 2D vertices, size numPolyhedronFaces
polyhedronFaceNormalsthe polyhedron face normals
polyhedronFaceNormalDirectionsthe polyhedron face normal directions
polyhedronFaceTranslationsthe polyhedron face translation from 2D to 3D
polyhedronFaceRotationMatricesthe polyhedron face rotation matrix from 2D to 3D
Returns
the point position respect the polyhedron
Note
works for concave and convex polyhedrons

◆ PointPolyhedronPosition() [2/2]

Gedim::GeometryUtilities::PointPolyhedronPositionResult Gedim::GeometryUtilities::PointPolyhedronPosition ( const Eigen::Vector3d &  point,
const std::vector< Eigen::MatrixXi > &  polyhedronFaces,
const std::vector< Eigen::MatrixXd > &  polyhedronFaceVertices,
const std::vector< Eigen::MatrixXd > &  polyhedronFaceRotatedVertices,
const std::vector< Eigen::Vector3d > &  polyhedronFaceNormals,
const std::vector< bool > &  polyhedronFaceNormalDirections,
const std::vector< Eigen::Vector3d > &  polyhedronFaceTranslations,
const std::vector< Eigen::Matrix3d > &  polyhedronFaceRotationMatrices 
) const

Check if point is inside a polygon.

Parameters
pointthe point
polygonVerticesthe matrix of vertices of the polygon (size 3 x numVertices)
resultthe resulting position

Check if point is inside a polyhedron

Parameters
pointthe point
polyhedronFacesthe polyhedron faces, size numPolyhedronFaces
polyhedronFaceVerticesthe polyhedron face 3D vertices, size numPolyhedronFaces
polyhedronFaceRotatedVerticesthe polyhedron face 2D vertices, size numPolyhedronFaces
polyhedronFaceNormalsthe polyhedron face normals
polyhedronFaceNormalDirectionsthe polyhedron face normal directions
polyhedronFaceTranslationsthe polyhedron face translation from 2D to 3D
polyhedronFaceRotationMatricesthe polyhedron face rotation matrix from 2D to 3D
Returns
the point position respect the polyhedron
Note
works only for convex polyhedrons

◆ PointsAre2D()

bool Gedim::GeometryUtilities::PointsAre2D ( const Eigen::MatrixXd &  points) const
inline
Parameters
pointsthe points to test, size 3 x numPoints
Returns
true if the points are 2D (z == 0)

◆ PointsAreAligned()

std::vector< bool > Gedim::GeometryUtilities::PointsAreAligned ( const Eigen::Vector3d &  segmentOrigin,
const Eigen::Vector3d &  segmentEnd,
const Eigen::MatrixXd &  points 
) const
inline

Check if a set of points are aligned to a line identified by a segment.

Parameters
segmentOriginsegment origin of the line
segmentEndsegment end of the line
pointsthe points, size 3 x numPoints
Returns
true if the i-th point is aligned, size 1 x numPoints

◆ PointsAreCoincident()

bool Gedim::GeometryUtilities::PointsAreCoincident ( const Eigen::Vector3d &  firstPoint,
const Eigen::Vector3d &  secondPoint 
) const
inline
Parameters
firstPointthe first point
secondPointthe second point
Returns
true if the points are coincident

◆ PointsAreOnLine()

vector< bool > Gedim::GeometryUtilities::PointsAreOnLine ( const Eigen::MatrixXd &  points,
const Eigen::Vector3d &  lineOrigin,
const Eigen::Vector3d &  lineTangent 
) const

Check if a set of points are on a line.

Parameters
pointsthe points, size 3 x numPoints
lineTangentthe line tangent
lineOriginthe line origin
Returns
true if the i-th point is aligned, size 1 x numPoints

◆ PointsBoundingBox()

MatrixXd Gedim::GeometryUtilities::PointsBoundingBox ( const Eigen::MatrixXd &  points) const
Parameters
pointsthe point collection, size 3 x numPoints
Returns
the extreme bounding box points (xmin, ymin, zmin) and (xmax, ymax, zmax), size 2 x numPoints

◆ PointsDistance()

Eigen::MatrixXd Gedim::GeometryUtilities::PointsDistance ( const Eigen::MatrixXd &  points) const
Parameters
pointsthe point collection, size 3 x numPoints
Returns
the distances between the points collected in matrix, size numPoints x numPoints.

◆ PointSegmentPosition() [1/2]

GeometryUtilities::PointSegmentPositionTypes Gedim::GeometryUtilities::PointSegmentPosition ( const double curvilinearCoordinate) const

Compute point position on a segment line given the curvilinear Coordinate.

Parameters
curvilinearCoordinatethe curvilinear coordinate, segment is between 0.0 and 1.0
resultthe point position on the line

◆ PointSegmentPosition() [2/2]

PointSegmentPositionTypes Gedim::GeometryUtilities::PointSegmentPosition ( const Eigen::Vector3d &  point,
const Eigen::Vector3d &  segmentOrigin,
const Eigen::Vector3d &  segmentEnd 
) const

Compute point position respect to a segment.

Parameters
pointthe point
segmentOriginthe segment origin
segmentEndthe segment end
Returns
result the point position
Warning
left and right point positions work only in xy plane

◆ PointSegmentProjection()

double Gedim::GeometryUtilities::PointSegmentProjection ( const Eigen::Vector3d &  point,
const Eigen::Vector3d &  segmentOrigin,
const Eigen::Vector3d &  segmentEnd 
) const
inline

Project point on a segment line.

Parameters
pointthe point
segmentOriginthe segment origin
segmentEndthe segment end
Returns
the projected point curvilinear coordinate

◆ PointsMaxDistance()

double Gedim::GeometryUtilities::PointsMaxDistance ( const Eigen::MatrixXd &  points) const
Parameters
pointsthe point collection, size 3 x numPoints
Returns
the maximum distance between the points.

◆ PointToBarycentricCoordinates2D()

std::array< double, 3 > Gedim::GeometryUtilities::PointToBarycentricCoordinates2D ( const Eigen::Matrix3d &  triangle,
const Eigen::Vector3d &  point 
) const

◆ PolarAngle()

double Gedim::GeometryUtilities::PolarAngle ( const Eigen::Vector3d &  v_prev,
const Eigen::Vector3d &  v,
const Eigen::Vector3d &  v_next,
const double norm_v_prev_v,
const double norm_v_next_v 
) const
inline
Parameters
v_prevthe previous point
vthe middle point
v_nextthe next point
Returns
the polar angle between the three points, computed as the cross product (v_next-v) x (v_prev-v)
Note
positive is convex (counter-clockwise), negative is concave (clockwise), zero is collinear

◆ PolygonArea()

double Gedim::GeometryUtilities::PolygonArea ( const Eigen::MatrixXd &  polygonVertices) const
Parameters
polygonVerticesthe polygon vertices, size 3 x numPolygonVertices
Returns
the polygon area
Note
the polygon shall be 2D

◆ PolygonArea3D()

double Gedim::GeometryUtilities::PolygonArea3D ( const Eigen::MatrixXd &  polygonVertices) const
Parameters
polygonVerticesthe polygon vertices, size 3 x numPolygonVertices
Returns
the polygon area

◆ PolygonAreaByBoundaryIntegral()

double Gedim::GeometryUtilities::PolygonAreaByBoundaryIntegral ( const Eigen::MatrixXd &  polygonVertices,
const Eigen::VectorXd &  edgeLengths,
const Eigen::MatrixXd &  edgeTangents,
const Eigen::MatrixXd &  edgeNormals,
const Eigen::MatrixXd &  referenceQuadraturePoints = (Eigen::MatrixXd(3, 1) << 0.5, 0.0, 0.0).finished(),
const Eigen::VectorXd &  referenceQuadratureWeights = Eigen::VectorXd::Ones(1) 
) const

Polygon Area By Integral on edges.

Parameters
polygonVerticesthe polygon vertices, size 3 x numVertices
edgeLengthsthe edge lengths, size numEdges
edgeTangentsthe edge tangents, size 3 x numEdges
edgeNormalsthe edge outgoint normals, size 3 x numEdges
referenceQuadraturePointsquadrature points on reference segment [0,1]
referenceQuadratureWeightsquadrature weights on reference segment [0,1]
Returns
the polygon area
Note
the area is computed as integral_edges x dot n_x with gauss formula on edges of order 1

◆ PolygonAreaByInternalIntegral()

double Gedim::GeometryUtilities::PolygonAreaByInternalIntegral ( const std::vector< Eigen::Matrix3d > &  polygonTriangulationPoints,
const Eigen::VectorXd &  referenceQuadratureWeights = Eigen::VectorXd::Constant(1, 0.5) 
) const

Polygon Area By Internal Integral.

Parameters
polygonTriangulationPointsthe internal polygon sub-triangulation
referenceQuadratureWeightsthe reference triangle quadrature weights [0,1]x[0,1]
Returns
the area computed as integral on sub-triangles

◆ PolygonAspectRatio()

double Gedim::GeometryUtilities::PolygonAspectRatio ( const double polygonDiameter,
const double polygonInRadius 
) const
inline
Parameters
polygonDiameterthe polygon diameter
polygonInRadiusthe polygon in radius
Returns
the polygon aspect ratio, defined as the ratio bewteen the in and out diameter

◆ PolygonBarycenter()

Eigen::Vector3d Gedim::GeometryUtilities::PolygonBarycenter ( const Eigen::MatrixXd &  polygonVertices) const
inline

Compute the Polygon barycenter as a mean of all vertices.

Parameters
polygonVerticesthe matrix of vertices of the polygon (size 3 x numVertices)

◆ PolygonCentroid() [1/2]

Vector3d Gedim::GeometryUtilities::PolygonCentroid ( const Eigen::MatrixXd &  polygonVertices,
const double polygonArea 
) const

Compute the Polygon centroid as described in https://en.wikipedia.org/wiki/Centroid.

Parameters
polygonVerticesthe matrix of vertices of the polygon (size 3 x numVertices)
polygonAreathe area of the polygon
Note
the polygon shall be 2D

◆ PolygonCentroid() [2/2]

Eigen::Vector3d Gedim::GeometryUtilities::PolygonCentroid ( const Eigen::MatrixXd &  subPolygonCentroids,
const Eigen::VectorXd &  subPolygonAreas,
const double polygonArea 
) const
inline

Compute the Polygon centroid using polygon sub-division.

Parameters
subPolygonCentroidsthe centroid of each subPolygon (size 3 x numSubPolygons)
subPolygonAreasthe areas of each subPolygon, size 1 x numSubPolygons
polygonAreathe total area of the polygon

◆ PolygonCentroidByIntegral()

Vector3d Gedim::GeometryUtilities::PolygonCentroidByIntegral ( const Eigen::MatrixXd &  polygonVertices,
const Eigen::VectorXd &  edgeLengths,
const Eigen::MatrixXd &  edgeTangents,
const Eigen::MatrixXd &  edgeNormals,
const double polygonArea 
) const

Polygon Area By Integral on edges.

Parameters
polygonVerticesthe polygon vertices, size 3 x numVertices
edgeLengthsthe edge lengths, size numEdges
edgeTangentsthe edge tangents, size 3 x numEdges
edgeNormalsthe edge outgoint normals, size 3 x numEdges
polygonAreathe polygon area
Returns
the polygon centroid
Note
the area is computed as integral_edges (x^2, y^2) dot n with gauss formula on edges of order 2

◆ PolygonCentroidEdgesDistance()

VectorXd Gedim::GeometryUtilities::PolygonCentroidEdgesDistance ( const Eigen::MatrixXd &  polygonVertices,
const Eigen::Vector3d &  polygonCentroid,
const Eigen::MatrixXd &  polygonEdgeNormals 
) const
Parameters
polygonVerticesthe polygon vertices, size 3 x numVertices
polygonCentroidthe polygon centroid
polygonEdgeNormalsthe polygon edge normals outgoing the polygon, size 3 x numEdges
Returns
the distance between the centroid and all the polygon edges, size 1 x numEdges

◆ PolygonCentroidVerticesDistance()

VectorXd Gedim::GeometryUtilities::PolygonCentroidVerticesDistance ( const Eigen::MatrixXd &  polygonVertices,
const Eigen::Vector3d &  polygonCentroid 
) const
Parameters
polygonVerticesthe polygon vertices, size 3 x numVertices
polygonCentroidthe polygon centroid
Returns
the distance between the centroid and all the polygon vertices, size 1 x numEdges

◆ PolygonChebyshevCenter()

void Gedim::GeometryUtilities::PolygonChebyshevCenter ( const Eigen::MatrixXd &  polygonVertices,
const Eigen::MatrixXd &  edgeNormals,
Eigen::Vector3d &  in_center,
double in_radius,
const double  r0,
const bool  use_r0 
) const

Compute the PolgonChebyshevCenter by solving max r (x, r)s.t. n_e'x + r = b_e for all edge and 0.0 <= r <= r_0 r is the in radius and x the chebishev center

◆ PolygonCirclePosition()

GeometryUtilities::PolygonCirclePositionTypes Gedim::GeometryUtilities::PolygonCirclePosition ( const Eigen::MatrixXd &  polygonVertices,
const Eigen::Vector3d &  circleCenter,
const double circleRadius,
const std::vector< PointCirclePositionResult > &  vertexPositions,
const IntersectionPolygonCircleResult polygonCircleIntersections 
) const
Parameters
polygonVerticesthe matrix of vertices of the polygon (size 3 x numVertices)
circleCenterthe circle center
circleRadiusthe circle radius
vertexPositionsthe polygon vertices positions respect the circle
polygonCircleIntersectionsthe polygon center intersections
Returns
the Polygon Circle reciprocal position
Note
tested only in 2D

◆ PolygonDiameter()

double Gedim::GeometryUtilities::PolygonDiameter ( const Eigen::MatrixXd &  polygonVertices) const
inline

Compute the Polygon diameter defined as the maximum distance between the vertices.

Parameters
polygonVerticesthe matrix of vertices of the polygon (size 3 x numVertices)

◆ PolygonDivisionByCircle()

GeometryUtilities::PolygonDivisionByCircleResult Gedim::GeometryUtilities::PolygonDivisionByCircle ( const Eigen::MatrixXd &  polygonVertices,
const Eigen::MatrixXd &  polygonEdgeTangents,
const Eigen::Vector3d &  circleCenter,
const double circleRadius,
const unsigned int curvedEdgeIndex 
) const

Convex Polygon sub division from a circle which intersects a polygon in a curved edge.

Parameters
polygonVerticesthe polygon vertices, size 3 x numPolygonVertices
circleCenterthe circle center from which the curved edge derives
circleRadiusthe radius of the circle from which the curved edge derives
curvedEdgeIndexcurved edge index, from 0 to numPolygonVertices
Returns
the sub-division polygons result
Note
the polygon should be inside the angle quadrant formed by the curved edge
otherwise use PolygonDivisionByAngleQuadrant function to split the polygon

◆ PolygonEdgeLengths()

VectorXd Gedim::GeometryUtilities::PolygonEdgeLengths ( const Eigen::MatrixXd &  polygonVertices) const

Compute the Polygon edge lengths.

Parameters
polygonVerticesthe matrix of vertices of the polygon (size 3 x numVertices)
Returns
the resulting edge lengths, size 1 x numVertices

◆ PolygonEdgeNormals()

MatrixXd Gedim::GeometryUtilities::PolygonEdgeNormals ( const Eigen::MatrixXd &  polygonVertices) const

Compute the Polygon edge normals outgoing the polygon.

Parameters
polygonVerticesthe matrix of vertices of the polygon (size 3 x numVertices)
Returns
the resulting edge normals outgoing the polygon, size 3 x numVertices

◆ PolygonEdgesCentroid()

MatrixXd Gedim::GeometryUtilities::PolygonEdgesCentroid ( const Eigen::MatrixXd &  polygonVertices) const

Compute the Polygon edges centroid.

Parameters
polygonVerticesthe matrix of vertices of the polygon (size 3 x numVertices)
Returns
the resulting edges centroid, size 3 x numVertices

◆ PolygonEdgeTangents()

MatrixXd Gedim::GeometryUtilities::PolygonEdgeTangents ( const Eigen::MatrixXd &  polygonVertices) const

Compute the Polygon edge tangents.

Parameters
polygonVerticesthe matrix of vertices of the polygon (size 3 x numVertices)
Returns
the resulting edge tangents, size 3 x numVertices

◆ PolygonInertia()

Matrix3d Gedim::GeometryUtilities::PolygonInertia ( const Eigen::Vector3d &  polygonCentroid,
const std::vector< Eigen::Matrix3d > &  polygonTriangulationPoints 
) const
Parameters
polygonCentroidthe centroid
polygonTriangulationPointsthe internal polygon sub-triangulation
Returns
the polygon intertia tensor

◆ PolygonInRadius()

double Gedim::GeometryUtilities::PolygonInRadius ( const Eigen::VectorXd &  polygonCentroidEdgesDistance) const
inline
Parameters
polygonCentroidEdgesDistancethe polygon centroid edges distance, size 1 x numEdges
Returns
the polygon in radius, as the minimum distance between the polygon centroid and the edges

◆ PolygonInsideCircleDivisionByAngleQuadrant()

GeometryUtilities::PolygonDivisionByAngleQuadrantResult Gedim::GeometryUtilities::PolygonInsideCircleDivisionByAngleQuadrant ( const Eigen::MatrixXd &  polygonVertices,
const Eigen::MatrixXd &  polygonEdgeTangents,
const Eigen::Vector3d &  circleCenter,
const double circleRadius,
const unsigned int curvedEdgeIndex 
) const

Convex Polygon sub division by angle quadrant which intersects a polygon in a curved edge.

Parameters
polygonVerticesthe polygon vertices, size 3 x numPolygonVertices
circleCenterthe circle center from which the curved edge derives
circleRadiusthe radius of the circle from which the curved edge derives
curvedEdgeIndexcurved edge index, from 0 to numPolygonVertices
Returns
the sub-division polygons result

◆ PolygonIsConvex()

bool Gedim::GeometryUtilities::PolygonIsConvex ( const Eigen::MatrixXd &  polygonVertices,
const Eigen::MatrixXd &  convexHull 
) const

Check if Polygon is Convex.

Parameters
polygonVerticesthe polygon vertices, size 3 x numVertices
convexHullthe convex hull vertices counterclockwise
Returns
true if polygon is convex, false otherwise
Note
works only in 2D-plane

◆ PolygonMass()

Matrix2d Gedim::GeometryUtilities::PolygonMass ( const Eigen::Vector3d &  polygonCentroid,
const std::vector< Eigen::Matrix3d > &  polygonTriangulationPoints 
) const
Parameters
polygonCentroidthe centroid
polygonTriangulationPointsthe internal polygon sub-triangulation
Returns
the polygon mass matrix

◆ PolygonNormal()

Eigen::Vector3d Gedim::GeometryUtilities::PolygonNormal ( const Eigen::MatrixXd &  polygonVertices) const

Compute the Polygon tridimensional normalized Normal.

Parameters
polygonVerticesthe matrix of vertices of the polygon (size 3 x numVertices)
Returns
the resulting normalized normal

◆ PolygonOrientation()

GeometryUtilities::PolygonOrientations Gedim::GeometryUtilities::PolygonOrientation ( const std::vector< unsigned int > &  convexHull) const
Parameters
convexHullthe polygon convex hull vertices indices counterclockwise
Returns
the polygon 2D orientation
Note
works only in 2D-plane

◆ PolygonOutsideCircleDivisionByAngleQuadrant()

GeometryUtilities::PolygonDivisionByAngleQuadrantResult Gedim::GeometryUtilities::PolygonOutsideCircleDivisionByAngleQuadrant ( const Eigen::MatrixXd &  polygonVertices,
const Eigen::MatrixXd &  polygonEdgeTangents,
const Eigen::Vector3d &  circleCenter,
const double circleRadius,
const unsigned int curvedEdgeIndex 
) const

Convex Polygon sub division by angle quadrant which intersects a polygon in a curved edge.

Parameters
polygonVerticesthe polygon vertices, size 3 x numPolygonVertices
circleCenterthe circle center from which the curved edge derives
circleRadiusthe radius of the circle from which the curved edge derives
curvedEdgeIndexcurved edge index, from 0 to numPolygonVertices
Returns
the sub-division polygons result

◆ PolygonRotationMatrix()

Matrix3d Gedim::GeometryUtilities::PolygonRotationMatrix ( const Eigen::MatrixXd &  polygonVertices,
const Eigen::Vector3d &  polygonNormal,
const Eigen::Vector3d &  polygonTranslation 
) const

Compute the rotation matrix and translation vector of a tridimensional Polygon.

Parameters
polygonVerticesthe vertices of the polygon counterclockwise (size 3 x numVertices)
polygonNormalthe normalized normal of the plane which contains the polygon
polygonTranslationthe translation vector t
Returns
the resulting rotation matrix Q which rotates 2D points to 3D points
Note
to rotate some point P from 2D to 3D use Q * P + t
to rotate some point P from 3D to 2D use Q^T * (P - t)

◆ PolygonTangents()

std::array< Eigen::Vector3d, 2 > Gedim::GeometryUtilities::PolygonTangents ( const Eigen::MatrixXd &  polygonVertices,
const Eigen::Vector3d &  polygonNormal 
) const

◆ PolygonTranslation()

Eigen::Vector3d Gedim::GeometryUtilities::PolygonTranslation ( const Eigen::MatrixXd &  polygonVertices) const
inline

Compute the translation vector of a tridimensional Polygon.

Parameters
polygonVerticesthe vertices of the polygon counterclockwise (size 3 x numVertices)
Returns
the resulting translation vector t which corresponds to the first vertex of the polygon
Note
to rotate some point P from 2D to 3D use Q * P + t
to rotate some point P from 3D to 2D use Q^T * (P - t)

◆ PolygonTriangulationByEarClipping()

std::vector< unsigned int > Gedim::GeometryUtilities::PolygonTriangulationByEarClipping ( const Eigen::MatrixXd &  polygonVertices) const

Concave Polygon Triangulation with ear clipping algorithm.

Parameters
polygonVerticesthe polygon vertices, size 3 x numPolygonVertices
Returns
the sub-division triangulation, size 1 x 3 * numTriangles

◆ PolygonTriangulationByFirstVertex()

vector< unsigned int > Gedim::GeometryUtilities::PolygonTriangulationByFirstVertex ( const Eigen::MatrixXd &  polygonVertices) const

Convex Polygon simple Triangulation from the first vertex.

Parameters
polygonVerticesthe polygon vertices, size 3 x numPolygonVertices
Returns
the sub-division triangulation, size 1 x 3 * numTriangles
Note
works only for convex polygon

◆ PolygonTriangulationByInternalPoint()

vector< unsigned int > Gedim::GeometryUtilities::PolygonTriangulationByInternalPoint ( const Eigen::MatrixXd &  polygonVertices,
const Eigen::Vector3d &  internalPoint 
) const

Convex Polygon simple Triangulation from an internal point.

Parameters
polygonVerticesthe polygon vertices, size 3 x numPolygonVertices
pointinternal polygon point
Returns
the sub-division triangulation, size 1 x 3 * numPolygonVertices,
Note
the internal point index is numPolygonVertices

◆ PolygonType()

GeometryUtilities::PolygonTypes Gedim::GeometryUtilities::PolygonType ( const unsigned int numPolygonVertices,
const bool isPolygonConvex 
) const
Parameters
numPolygonVerticesthe number of polygon vertices
isPolygonConvextrue if the polygon is convex
Returns
the polygon type

◆ PolyhedronBarycenter()

Eigen::Vector3d Gedim::GeometryUtilities::PolyhedronBarycenter ( const Eigen::MatrixXd &  polyhedronVertices) const
inline

Compute the polyhedron barycenter as a mean of all vertices.

Parameters
polyhedronVerticesthe matrix of vertices of the polyhedron (size 3 x numVertices)

◆ PolyhedronCentroid()

Eigen::Vector3d Gedim::GeometryUtilities::PolyhedronCentroid ( const std::vector< std::vector< Eigen::Matrix3d > > &  polyhedronFaceRotatedTriangulationPoints,
const std::vector< Eigen::Vector3d > &  polyhedronFaceNormals,
const std::vector< bool > &  polyhedronFaceNormalDirections,
const std::vector< Eigen::Vector3d > &  polyhedronFaceTranslations,
const std::vector< Eigen::Matrix3d > &  polyhedronFaceRotationMatrices,
const double polyhedronVolume 
) const

Compute the Polyhedron centroid.

Parameters
polyhedronRotatedFaceTriangulationPointspolyhedron face triangulation points 2D, size numPolyhedronFaces x numTrianglesPerFace
polyhedronFaceNormalspolyhedron face normals, size numPolyhedronFaces
polyhedronFaceNormalDirectionspolyhedron face normal directions, size numPolyhedronFaces
polyhedronFaceTranslationspolyhedron face translation vector from 2D to 3D
polyhedronFaceRotationMatricespolyhedron face rotation matrix from 2D to 3D
polyhedronVolumethe polyhedron volume
Returns
the polyhedron centroid
Note
use the divergence theorem, with F_x = 1/2 (x^2, 0, 0), F_y = 1/2 (0, y^2, 0), F_z = 1/2 (0, 0, z^2), see https://en.wikipedia.org/wiki/Divergence_theorem

◆ PolyhedronCentroidFacesDistance()

VectorXd Gedim::GeometryUtilities::PolyhedronCentroidFacesDistance ( const Eigen::Vector3d &  polyhedronCentroid,
const std::vector< Eigen::Vector3d > &  polyhedronFacesNormal,
const std::vector< Eigen::MatrixXd > &  polyhedronFaceVertices 
) const

◆ PolyhedronCoordinateSystem()

vector< unsigned int > Gedim::GeometryUtilities::PolyhedronCoordinateSystem ( const Eigen::MatrixXd &  polyhedronVertices,
const Eigen::MatrixXi &  polyhedronEdges 
)

Get Polyhedron Coordinate System.

Parameters
polyhedronVerticesthe polyhedron vertices
polyhedronEdgesthe polyhedron edges
Returns
the four vertices indices forming a coordinate system for the polyhedron, size 1x4

◆ PolyhedronDiameter()

double Gedim::GeometryUtilities::PolyhedronDiameter ( const Eigen::MatrixXd &  polyhedronVertices) const
inline

Compute the Polyhedron diameter defined as the maximum distance between the vertices.

Parameters
polyhedronVerticesthe matrix of vertices of the polyhedron (size 3 x numVertices)

◆ PolyhedronEdgesCentroid()

MatrixXd Gedim::GeometryUtilities::PolyhedronEdgesCentroid ( const Eigen::MatrixXd &  polyhedronVertices,
const Eigen::MatrixXi &  polyhedronEdges 
) const

Compute Polyhedron Edges Centroid.

Parameters
polyhedronVerticesthe polyhedron vertices
polyhedronEdgesthe polyhedron edges
Returns
for each edge the centroid, size 3xnumEdges

◆ PolyhedronEdgesLength()

VectorXd Gedim::GeometryUtilities::PolyhedronEdgesLength ( const Eigen::MatrixXd &  polyhedronVertices,
const Eigen::MatrixXi &  polyhedronEdges 
) const

Compute Polyhedron Edges Lenght.

Parameters
polyhedronVerticesthe polyhedron vertices
polyhedronEdgesthe polyhedron edges
Returns
for each edge the length, size 1xnumEdges

◆ PolyhedronEdgeTangents()

MatrixXd Gedim::GeometryUtilities::PolyhedronEdgeTangents ( const Eigen::MatrixXd &  polyhedronVertices,
const Eigen::MatrixXi &  polyhedronEdges 
) const

Compute Polyhedron Edges Tangent.

Parameters
polyhedronVerticesthe polyhedron vertices
polyhedronEdgesthe polyhedron edges
Returns
for each edge the tangent, size 3xnumEdges

◆ PolyhedronFaceBarycenter()

vector< Vector3d > Gedim::GeometryUtilities::PolyhedronFaceBarycenter ( const std::vector< Eigen::MatrixXd > &  polyhedronFaceVertices) const

Compute Polyhedron Faces barycenters.

Parameters
polyhedronFaceVerticesthe polyhedron faces vertices
Returns
for each polyhedron face the barycenter

◆ PolyhedronFaceEdgeDirections()

vector< vector< bool > > Gedim::GeometryUtilities::PolyhedronFaceEdgeDirections ( const Eigen::MatrixXd &  polyhedronVertices,
const Eigen::MatrixXi &  polyhedronEdges,
const std::vector< Eigen::MatrixXi > &  polyhedronFaces 
) const

Compute Polyhedron Faces Edge Direction.

Parameters
polyhedronVerticesthe polyhedron vertices
polyhedronEdgesthe polyhedron edges
polyhedronFacesthe polyhedron faces
Returns
for each face the edge direction compare to polyhedron edge directions, size 1xnumFaces

◆ PolyhedronFaceEdgeTangents()

vector< MatrixXd > Gedim::GeometryUtilities::PolyhedronFaceEdgeTangents ( const Eigen::MatrixXd &  polyhedronVertices,
const Eigen::MatrixXi &  polyhedronEdges,
const std::vector< Eigen::MatrixXi > &  polyhedronFaces,
const std::vector< std::vector< bool > > &  polyhedronFaceEdgeDirections,
const Eigen::MatrixXd &  polyhedronEdgeTangents 
) const

Compute Polyhedron Faces Edge Tangents.

Parameters
polyhedronVerticesthe polyhedron vertices
polyhedronEdgesthe polyhedron edges
polyhedronFacesthe polyhedron faces
polyhedronEdgeTangentsfor each polyhedron edge the tangent, size 3xnumEdges
Returns
for each face the edge tangents, size 1xnumFaces

◆ PolyhedronFaceExtractTriangulationPoints()

std::vector< std::vector< Matrix3d > > Gedim::GeometryUtilities::PolyhedronFaceExtractTriangulationPoints ( const std::vector< Eigen::MatrixXd > &  polyhedronFaceVertices,
const std::vector< std::vector< unsigned int > > &  polyhedronFaceTriangulations 
) const

◆ PolyhedronFaceNormalDirections() [1/2]

std::vector< bool > Gedim::GeometryUtilities::PolyhedronFaceNormalDirections ( const Eigen::MatrixXd &  polyhedronVertices,
const Eigen::MatrixXi &  polyhedronEdges,
const std::vector< Eigen::MatrixXi > &  polyhedronFaces,
const std::vector< Eigen::MatrixXd > &  polyhedronFaceVertices,
const std::vector< Eigen::Vector3d > &  polyhedronFaceInternalPoints,
const std::vector< Eigen::MatrixXd > &  polyhedronFaceRotatedVertices,
const std::vector< Eigen::Vector3d > &  polyhedronFaceNormals,
const std::vector< Eigen::Vector3d > &  polyhedronFaceTranslations,
const std::vector< Eigen::Matrix3d > &  polyhedronFaceRotationMatrices 
) const

Compute Polyhedron Face Normal Directions for generic polyhedron (slower)

Parameters
polyhedronFaceVerticesthe polyhedron faces vertices
pointInsidePolyhedrona point inside polyhedron
polyhedronFaceNormalsthe normal of each face
Returns
true if the face has normal outgoing
Warning
NOT WORKING in all cases

◆ PolyhedronFaceNormalDirections() [2/2]

std::vector< bool > Gedim::GeometryUtilities::PolyhedronFaceNormalDirections ( const std::vector< Eigen::MatrixXd > &  polyhedronFaceVertices,
const Eigen::Vector3d &  pointInsidePolyhedron,
const std::vector< Eigen::Vector3d > &  polyhedronFaceNormals 
) const

Compute Polyhedron Face Normal Directions.

Parameters
polyhedronFaceVerticesthe polyhedron faces vertices
pointInsidePolyhedrona point inside polyhedron
polyhedronFaceNormalsthe normal of each face
Returns
true if the face has normal outgoing
Warning
works only for convex polyhedrons

◆ PolyhedronFaceNormals()

vector< Vector3d > Gedim::GeometryUtilities::PolyhedronFaceNormals ( const std::vector< Eigen::MatrixXd > &  polyhedronFaceVertices) const

Compute Polyhedron Faces Normals.

Parameters
polyhedronFaceVerticesthe polyhedron faces vertices
Returns
for each polyhedron face the normal

◆ PolyhedronFaceRotatedVertices()

std::vector< MatrixXd > Gedim::GeometryUtilities::PolyhedronFaceRotatedVertices ( const std::vector< Eigen::MatrixXd > &  polyhedronFaceVertices,
const std::vector< Eigen::Vector3d > &  polyhedronFaceTranslations,
const std::vector< Eigen::Matrix3d > &  polyhedronFaceRotationMatrices 
) const

Compute Polyhedron Faces Rotated Vertices 2D.

Parameters
polyhedronVerticesthe polyhedron vertices
polyhedronFaceTranslationsthe polyhedron face translations from 2D to 3D
polyhedronFaceRotationMatricesthe polyhedron face rotation matrix from 2D to 3D
Returns
for each face the 2D vertices, size 1xnumFaces

◆ PolyhedronFaceRotationMatrices()

vector< Matrix3d > Gedim::GeometryUtilities::PolyhedronFaceRotationMatrices ( const std::vector< Eigen::MatrixXd > &  polyhedronFaceVertices,
const std::vector< Eigen::Vector3d > &  polyhedronFaceNormals,
const std::vector< Eigen::Vector3d > &  polyhedronFaceTranslations 
) const

Compute Polyhedron Faces Rotation matrix.

Parameters
polyhedronFaceVerticesthe polyhedron faces vertices
Returns
for each polyhedron face the rotation matrix from 2D to 3D

◆ PolyhedronFacesUnalignedVertices()

std::vector< std::vector< unsigned int > > Gedim::GeometryUtilities::PolyhedronFacesUnalignedVertices ( const std::vector< Eigen::MatrixXd > &  polyhedronFacesRotatedVertices) const

Compute Polyhedron Faces Unaligned Vertices Indices.

Parameters
polyhedronFacesRotatedVerticesthe polyhedron faces 2D vertices
Returns
for each face the unaligned vertices indices, size 1 x numFaces

◆ PolyhedronFaceTangents()

std::vector< std::array< Eigen::Vector3d, 2 > > Gedim::GeometryUtilities::PolyhedronFaceTangents ( const std::vector< Eigen::MatrixXd > &  polyhedronFacesVertices,
const std::vector< Eigen::Vector3d > &  polyhedronFacesNormal,
const std::vector< bool > &  polyhedronFacesNormalDirection 
) const

◆ PolyhedronFaceTranslations()

vector< Vector3d > Gedim::GeometryUtilities::PolyhedronFaceTranslations ( const std::vector< Eigen::MatrixXd > &  polyhedronFaceVertices) const

Compute Polyhedron Faces translation vectors.

Parameters
polyhedronFaceVerticesthe polyhedron faces vertices
Returns
for each polyhedron face the translation vector

◆ PolyhedronFaceTriangulationPointsByInternalPoint()

std::vector< std::vector< Matrix3d > > Gedim::GeometryUtilities::PolyhedronFaceTriangulationPointsByInternalPoint ( const std::vector< Eigen::MatrixXd > &  polyhedronFaceVertices,
const std::vector< Eigen::Vector3d > &  polyhedronFaceInternalPoints,
const std::vector< std::vector< unsigned int > > &  polyhedronFaceTriangulations 
) const

◆ PolyhedronFaceTriangulations()

vector< vector< unsigned int > > Gedim::GeometryUtilities::PolyhedronFaceTriangulations ( const std::vector< Eigen::MatrixXi > &  polyhedronFaces,
const std::vector< std::vector< unsigned int > > &  localFaceTriangulations 
) const

Polyhedron Face Triangulations of each face.

Parameters
polyhedronFacesthe polyhedron faces
localFaceTriangulationsthe local faces triangulations indices, size 1xnumFaces x (3xnumTriangles)
Returns
for each face the triangulation indices by first vertex, size 1xnumFaces x (3xnumTriangles)

◆ PolyhedronFaceTriangulationsByEarClipping()

std::vector< std::vector< unsigned int > > Gedim::GeometryUtilities::PolyhedronFaceTriangulationsByEarClipping ( const unsigned int  numPolyhedronFaces,
const std::vector< Eigen::MatrixXd > &  polyhedronFaces2DVertices 
) const

Polyhedron Face Triangulations by ear clipping of each face.

Parameters
numPolyhedronFacesthe number of polyhedron faces
polyhedronFaceVerticesthe polyhedron faces vertices
Returns
for each face the triangulation indices by first vertex, size 1xnumFaces x (3xnumTriangles)

◆ PolyhedronFaceTriangulationsByFirstVertex()

vector< vector< unsigned int > > Gedim::GeometryUtilities::PolyhedronFaceTriangulationsByFirstVertex ( const std::vector< Eigen::MatrixXi > &  polyhedronFaces,
const std::vector< Eigen::MatrixXd > &  polyhedronFaceVertices 
) const

Polyhedron Face Triangulations by first vertex of each face.

Parameters
polyhedronFacesthe polyhedron faces
polyhedronFaceVerticesthe polyhedron faces vertices
Returns
for each face the triangulation indices by first vertex, size 1xnumFaces x (3xnumTriangles)

◆ PolyhedronFaceTriangulationsByInternalPoint()

vector< vector< unsigned int > > Gedim::GeometryUtilities::PolyhedronFaceTriangulationsByInternalPoint ( const Eigen::MatrixXd &  polyhedronVertices,
const std::vector< Eigen::MatrixXi > &  polyhedronFaces,
const std::vector< Eigen::MatrixXd > &  polyhedronFaceVertices,
const std::vector< Eigen::Vector3d > &  polyhedronFaceInternalPoints 
) const

Polyhedron Face Triangulations by internal point of each face.

Parameters
polyhedronVerticesthe polyhedron vertices
polyhedronFacesthe polyhedron faces
polyhedronFaceVerticesthe polyhedron faces vertices
polyhedronFaceInternalPointsthe polyhedron face internal points
Returns
for each face the triangulation indices by first vertex, size 1xnumFaces x (3xnumTriangles)
Note
the internal point index is polyhedronVertices.size()

◆ PolyhedronFaceVertices()

vector< MatrixXd > Gedim::GeometryUtilities::PolyhedronFaceVertices ( const Eigen::MatrixXd &  polyhedronVertices,
const std::vector< Eigen::MatrixXi > &  polyhedronFaces 
) const

Compute Polyhedron Faces Vertices.

Parameters
polyhedronVerticesthe polyhedron vertices
polyhedronEdgesthe polyhedron edges
polyhedronFacesthe polyhedron faces
Returns
for each face the vertices, size 1xnumFaces

◆ PolyhedronInertia()

Matrix3d Gedim::GeometryUtilities::PolyhedronInertia ( const Eigen::Vector3d &  polyhedronCentroid,
const std::vector< Eigen::MatrixXd > &  polyhedronTetrahedraPoints 
) const

◆ PolyhedronInRadius()

double Gedim::GeometryUtilities::PolyhedronInRadius ( const Eigen::VectorXd &  polyhedronCentroidFacesDistance) const
inline

◆ PolyhedronIsConvex()

bool Gedim::GeometryUtilities::PolyhedronIsConvex ( const std::vector< Eigen::MatrixXd > &  polyhedronFaceVertices,
const std::vector< Eigen::MatrixXd > &  polyhedronFaceRotatedVertices,
const std::vector< Eigen::Vector3d > &  polyhedronFaceInternalPoints,
const std::vector< Eigen::Vector3d > &  polyhedronFaceNormals,
const std::vector< bool > &  polyhedronFaceNormalDirections,
const Eigen::Vector3d &  polyhedronInternalPoint 
) const

Check if Polyhedron is Convex.

Parameters
polyhedronFaceVerticesthe polyhedron faces vertices
polyhedronFaceInternalPointsthe polyhedron face internal points
polyhedronFaceNormalsthe normal of each face
polyhedronFaceNormalDirectionsthe normal outgoing direction
pointInsidePolyhedrona point inside polyhedron
Returns
true if polyhedron is convex, false otherwise
Warning
still not working

check convexity with the intersections between the faces and a line starting from the polyhedron internal point to each face internal point.

◆ PolyhedronMass()

Matrix3d Gedim::GeometryUtilities::PolyhedronMass ( const Eigen::Vector3d &  polyhedronCentroid,
const std::vector< Eigen::MatrixXd > &  polyhedronTetrahedronPoints 
) const

◆ PolyhedronTetrahedronsByFaceTriangulations() [1/2]

std::vector< unsigned int > Gedim::GeometryUtilities::PolyhedronTetrahedronsByFaceTriangulations ( const Eigen::MatrixXd &  polyhedronVertices,
const std::vector< Eigen::MatrixXi > &  polyhedronFaces,
const std::vector< std::vector< unsigned int > > &  polyhedronFaceTriangulations,
const Eigen::Vector3d &  polyhedronInternalPoint 
) const

Polyhedron Tetrahedrons By Face Triangulations.

Parameters
polyhedronVerticesthe polyhedron vertices
polyhedronFacesthe polyhedron faces
faceTriangulationsthe triangulation on face vertices
polyhedronInternalPointa polyhedron internal point
Returns
the polyhedron tetrahedrons indices, size 1x(4*numTetrahedrons)
Note
the polyhedron internal point index is polyhedronVertices.size() + f

◆ PolyhedronTetrahedronsByFaceTriangulations() [2/2]

std::vector< unsigned int > Gedim::GeometryUtilities::PolyhedronTetrahedronsByFaceTriangulations ( const Eigen::MatrixXd &  polyhedronVertices,
const std::vector< Eigen::MatrixXi > &  polyhedronFaces,
const std::vector< std::vector< unsigned int > > &  polyhedronFaceTriangulations,
const std::vector< Eigen::Vector3d > &  polyhedronFaceInternalPoints,
const Eigen::Vector3d &  polyhedronInternalPoint 
) const

Polyhedron Tetrahedrons By Face Triangulations with face internal points.

Parameters
polyhedronVerticesthe polyhedron vertices
polyhedronFacesthe polyhedron faces
faceTriangulationsthe triangulation on face vertices by internal points
polyhedronFaceInternalPointsthe polyhedron face internal points
polyhedronInternalPointa polyhedron internal point
Returns
the polyhedron tetrahedrons indices, size 1x(4*numTetrahedrons)
Note
the polyhedron face internal points are polyhedronVertices.size() + f
the polyhedron internal point index is polyhedronVertices.size() + polyhedronFaceInternalPoints.size()

◆ PolyhedronToFacets()

std::vector< std::vector< unsigned int > > Gedim::GeometryUtilities::PolyhedronToFacets ( const Polyhedron polyhedron) const

◆ PolyhedronVolumeByBoundaryIntegral()

double Gedim::GeometryUtilities::PolyhedronVolumeByBoundaryIntegral ( const std::vector< std::vector< Eigen::Matrix3d > > &  polyhedronFaceRotatedTriangulationPoints,
const std::vector< Eigen::Vector3d > &  polyhedronFaceNormals,
const std::vector< bool > &  polyhedronFaceNormalDirections,
const std::vector< Eigen::Vector3d > &  polyhedronFaceTranslations,
const std::vector< Eigen::Matrix3d > &  polyhedronFaceRotationMatrices,
const Eigen::MatrixXd &  referenceQuadraturePoints = (Eigen::MatrixXd(3, 1) << 1.0 / 3.0, 1.0 / 3.0, 0.0).finished(),
const Eigen::VectorXd &  referenceQuadratureWeights = Eigen::VectorXd::Constant(1, 0.5) 
) const

Compute the Polyhedron Volume.

Parameters
polyhedronRotatedFaceTriangulationPointspolyhedron face triangulation points 2D, size numPolyhedronFaces x numTrianglesPerFace
polyhedronFaceNormalspolyhedron face normals, size numPolyhedronFaces
polyhedronFaceNormalDirectionspolyhedron face normal directions, size numPolyhedronFaces
polyhedronFaceTranslationspolyhedron face translation vector from 2D to 3D
polyhedronFaceRotationMatricespolyhedron face rotation matrix from 2D to 3D
referenceQuadraturePointsthe reference tetrahedron quadrature points [0,1]x[0,1]x[0,1]
referenceQuadratureWeightsthe reference tetrahedron quadrature weights [0,1]x[0,1]x[0,1]
Returns
the polyhedron volume
Note
use the divergence theorem, with F = 1/3 (x, y, z), see https://en.wikipedia.org/wiki/Divergence_theorem

◆ PolyhedronVolumeByInternalIntegral()

double Gedim::GeometryUtilities::PolyhedronVolumeByInternalIntegral ( const std::vector< Eigen::MatrixXd > &  polyhedronTetrahedronVertices,
const Eigen::VectorXd &  referenceQuadratureWeights = Eigen::VectorXd::Constant(1, 1.0 / 6.0) 
) const

Polyhedron Volume By Internal Integral.

Parameters
polyhedronTetrahedronVerticesthe internal polyhedron sub-tetrahedra
referenceQuadratureWeightsthe reference tetrahedron quadrature weights [0,1]x[0,1]x[0,1]
Returns
the area computed as integral on sub-tetrahedra

◆ RandomCoordinates()

std::vector< double > Gedim::GeometryUtilities::RandomCoordinates ( const unsigned int  size,
const bool  insertExtremes,
const double minDistance,
const unsigned int  seed = time(nullptr) 
) const
Parameters
sizethe number of resulting coordinates
originthe starting curvilinear coordinate
endthe ending curvilinear coordinate
insertExtremesif true keeps the extremes
Returns
random curvilinear coordinates in the interval [0.0, 1.0], size 1 x numCoordinates
Note
if size < 2 then size will be considered as 2

◆ RelativeDifference()

double Gedim::GeometryUtilities::RelativeDifference ( const double first,
const double second,
const double tolerance 
) const
inline
Parameters
firstthe first value
secondthe second value
Returns
the relative difference between the two values according the first

◆ RotatePoints()

Eigen::MatrixXd Gedim::GeometryUtilities::RotatePoints ( const Eigen::MatrixXd &  points,
const Eigen::Matrix3d &  rotationMatrix,
const Eigen::Vector3d &  translation = Eigen::Vector3d::Zero() 
) const
inline

Rotate Points P using rotation matrix Q and translation t: Q * P + t.

Parameters
pointsthe points (size 3 x numPoints)
rotationMatrixthe rotation matrix, size 3x3
translationthe translation vector, size 1x3
rotatedPointsthe resulting rotated points (size 3 x numPoints) rP = Q * P + t

◆ RotatePointsFrom2DTo3D()

Eigen::MatrixXd Gedim::GeometryUtilities::RotatePointsFrom2DTo3D ( const Eigen::MatrixXd &  points,
const Eigen::Matrix3d &  rotationMatrix,
const Eigen::Vector3d &  translation = Eigen::Vector3d::Zero() 
) const
inline

Rotate Points P From 2D To 3D using rotation matrix Q and translation t: Q * P + t.

Parameters
pointsthe points (size 3 x numPoints)
rotationMatrixthe rotation matrix from 2D to 3D
translationthe translation vector
rotatedPointsthe resulting rotated points (size 3 x numPoints) rP = Q * P + t

◆ RotatePointsFrom3DTo2D()

Eigen::MatrixXd Gedim::GeometryUtilities::RotatePointsFrom3DTo2D ( const Eigen::MatrixXd &  points,
const Eigen::Matrix3d &  rotationMatrix,
const Eigen::Vector3d &  translation = Eigen::Vector3d::Zero() 
) const
inline

Rotate Points P From 3D To 2D using rotation matrix Q and translation t: Q * (P - t)

Parameters
pointsthe points (size 3 x numPoints)
rotationMatrixthe rotation matrix from 3D to 2D
translationthe translation vector
rotatedPointsthe resulting rotated points (size 3 x numPoints) rP = Q * (P - t)

◆ SegmentBarycenter()

Eigen::Vector3d Gedim::GeometryUtilities::SegmentBarycenter ( const Eigen::Vector3d &  segmentOrigin,
const Eigen::Vector3d &  segmentEnd 
) const
inline

Compute the segment barycenter as a mean of all vertices.

Parameters
segmentOriginthe segment origin
segmentEndthe segment end

◆ SegmentIntercept()

double Gedim::GeometryUtilities::SegmentIntercept ( const Eigen::Vector3d &  segmentOrigin,
const Eigen::Vector3d &  segmentEnd 
) const
inline

Compute the segment intercept q of line y = m * x + q.

Parameters
segmentOriginthe segment origin
segmentEndthe segment end
Returns
the segment intercept
Note
the segment shall be 2D

◆ SegmentLength()

double Gedim::GeometryUtilities::SegmentLength ( const Eigen::Vector3d &  segmentOrigin,
const Eigen::Vector3d &  segmentEnd 
) const
inline
Parameters
segmentOriginthe segment origin
segmentEndthe segment end
Returns
the segment length

◆ SegmentNormal()

Eigen::Vector3d Gedim::GeometryUtilities::SegmentNormal ( const Eigen::Vector3d &  segmentOrigin,
const Eigen::Vector3d &  segmentEnd 
) const
inline
Parameters
segmentOriginthe segment origin
segmentEndthe segment end
Returns
the segment normal normalized, rotation of the normalized tangent (x,y,0) with 90° clockwise (y, -x,0)
Note
the segment shall be 2D

◆ SegmentSlope()

double Gedim::GeometryUtilities::SegmentSlope ( const Eigen::Vector3d &  segmentOrigin,
const Eigen::Vector3d &  segmentEnd 
) const
inline

Compute the segment slope m of line y = m * x + q.

Parameters
segmentOriginthe segment origin
segmentEndthe segment end
Returns
the segment slope
Note
the segment shall be 2D

◆ SegmentTangent()

Eigen::Vector3d Gedim::GeometryUtilities::SegmentTangent ( const Eigen::Vector3d &  segmentOrigin,
const Eigen::Vector3d &  segmentEnd 
) const
inline
Parameters
segmentOriginthe segment origin
segmentEndthe segment end
Returns
the segment tangent

◆ SimplexBarycenter()

Eigen::Vector3d Gedim::GeometryUtilities::SimplexBarycenter ( const Eigen::MatrixXd &  vertices) const
inline

Compute the simplex barycenter as a mean of all vertices.

Parameters
verticesthe matrix of vertices of the simplex (size 3 x numVertices)

◆ SimplexMeasure()

double Gedim::GeometryUtilities::SimplexMeasure ( const Eigen::MatrixXd &  vertices) const
inline

◆ SplitPolygonWithCircle()

GeometryUtilities::SplitPolygonWithCircleResult Gedim::GeometryUtilities::SplitPolygonWithCircle ( const Eigen::MatrixXd &  polygonVertices,
const Eigen::Vector3d &  circleCenter,
const double circleRadius,
const std::vector< PointCirclePositionResult > &  vertexPositions,
const IntersectionPolygonCircleResult polygonCircleIntersections,
const PolygonCirclePositionTypes polygonCirclePosition 
) const

Split a polygon with n vertices numbered from 0 to n counterclockwise given a cirle.

Parameters
polygonVerticesthe matrix of vertices of the polygon (size 3 x numVertices)
circleCenterthe circle center
circleRadiusthe circle radius
vertexPositionsthe polygon vertices positions respect the circle
polygonCircleIntersectionsthe polygon center intersections
polygonCirclePositionthe polygon position respect the circle
Note
tested only in 2D
Returns
the split result
Note
only indices are threated in this function, no space points

◆ SplitPolygonWithCircleBuildSubPolygon()

MatrixXd Gedim::GeometryUtilities::SplitPolygonWithCircleBuildSubPolygon ( const SplitPolygonWithCircleResult splitResult,
const unsigned int subPolygonIndex,
const Eigen::MatrixXd &  polygonVertices,
const Gedim::GeometryUtilities::IntersectionPolygonCircleResult polygonCircleIntersections 
) const

Build the subpolygon coordinates from split result.

Parameters
splitResultthe split result
subPolygonIndexthe subpolygon index, from 0 to SplitPolygonWithCircleResult::NewPolygons.size()
polygonVerticesthe original polygon vertices
polygonCircleIntersectionsthe polygon circle intersection
Returns
the resulting subpolygon coordinates

◆ SplitPolygonWithPlane()

Gedim::GeometryUtilities::SplitPolygonWithPlaneResult Gedim::GeometryUtilities::SplitPolygonWithPlane ( const Eigen::MatrixXd &  polygonVertices,
const Eigen::MatrixXd &  polygonEdgeTangents,
const Eigen::Vector3d &  planeNormal,
const Eigen::Vector3d &  planeOrigin,
const Eigen::Vector3d &  polygonTranslation,
const Eigen::Matrix3d &  polygonRotationMatrix 
) const

Split 3d Polygon With Plane.

Parameters
polygonVerticesthe 3D polygon vertices
polygonEdgeTangentsthe 3D polygon edge tangents
planeNormalthe plane normal
planeOriginthe plane origin
polygonTranslationthe polygon translation vector for rotation
polygonRotationMatrixthe polygon rotation matrix from 2D to 3D
Returns
the splitted polygons

◆ SplitPolygonWithSegment()

GeometryUtilities::SplitPolygonWithSegmentResult Gedim::GeometryUtilities::SplitPolygonWithSegment ( const SplitPolygonInput input) const

Split a polygon with n vertices numbered from 0 to n counterclockwise given a segment contained inside.

Parameters
inputthe input data
resultthe resulting split
Note
only indices are threated in this function, no space points

◆ SplitPolyhedronWithPlane()

GeometryUtilities::SplitPolyhedronWithPlaneResult Gedim::GeometryUtilities::SplitPolyhedronWithPlane ( const Eigen::MatrixXd &  polyhedronVertices,
const Eigen::MatrixXi &  polyhedronEdges,
const std::vector< Eigen::MatrixXi > &  polyhedronFaces,
const std::vector< Eigen::MatrixXd > &  polyhedronFaceVertices,
const std::vector< Eigen::MatrixXd > &  polyhedronFaceEdgeTangents,
const std::vector< Eigen::Vector3d > &  polyhedronFaceTranslations,
const std::vector< Eigen::Matrix3d > &  polyhedronFaceRotationMatrices,
const Eigen::Vector3d &  planeNormal,
const Eigen::Vector3d &  planeOrigin,
const Eigen::Matrix3d &  planeRotationMatrix,
const Eigen::Vector3d &  planeTranslation 
) const

◆ SplitPolyhedronWithPlaneResultToPolyhedra()

vector< GeometryUtilities::Polyhedron > Gedim::GeometryUtilities::SplitPolyhedronWithPlaneResultToPolyhedra ( const SplitPolyhedronWithPlaneResult result) const

◆ Tolerance1D()

double Gedim::GeometryUtilities::Tolerance1D ( ) const
inline
Returns
tolerance used for segment length

◆ Tolerance1DSquared()

double Gedim::GeometryUtilities::Tolerance1DSquared ( ) const
inline
Returns
tolerance used for squared segment length

◆ Tolerance2D()

double Gedim::GeometryUtilities::Tolerance2D ( ) const
inline
Returns
tolerance used for polygon area

◆ Tolerance3D()

double Gedim::GeometryUtilities::Tolerance3D ( ) const
inline
Returns
tolerance used for polyhedron volume

◆ UnalignedPoints()

vector< unsigned int > Gedim::GeometryUtilities::UnalignedPoints ( const Eigen::MatrixXd &  points,
const unsigned int  numDesiredUnalignedPoints = 0 
) const

Extract the circumscribed unaligned points (minimum 2) in a set of points.

Parameters
pointsthe points, size 3 x numPoints
numDesiredUnalignedPointsthe number of desired unaligned points, if 0 all the points are computed
Returns
the unaligned points indices counterclockwise, size numUnalignedPoints, 2 <= numUnalignedPoints <= numPoints

◆ UnalignedPolyhedronPoints()

std::vector< unsigned int > Gedim::GeometryUtilities::UnalignedPolyhedronPoints ( const Eigen::MatrixXd &  polyhedronVertices,
const std::vector< Eigen::MatrixXi > &  polyhedronFaces,
const std::vector< Eigen::Vector3d > &  polyhedronFacesTranslation,
const std::vector< Eigen::Matrix3d > &  polyhedronFacesRotationMatrix,
const std::vector< std::vector< unsigned int > > &  polyhedronUnaligedFaces,
const std::vector< std::vector< unsigned int > > &  polyhedronFacesUnalignedVertices 
) const

Extract the circumscribed unaligned points (minimum 4) in a polyhedron.

Returns
the unaligned points, size numUnalignedPoints, 4 <= numUnalignedPoints <= numPoints
Warning
works only for convex polyhedron

The documentation for this class was generated from the following files: