Mesh::Facet Class Reference

The Facet helper class The MeshFacet class provides an interface for the MeshFacetPy class for convenient access to the Mesh data structure. More...

#include <Facet.h>

Public Member Functions

 Facet (const Facet &f)
 
 Facet (const MeshCore::MeshFacet &face=MeshCore::MeshFacet(), const MeshObject *obj=nullptr, MeshCore::FacetIndex index=MeshCore::FACET_INDEX_MAX)
 
Edge getEdge (int) const
 
bool isBound () const
 
void operator= (const Facet &f)
 
 ~Facet ()
 
- Public Member Functions inherited from MeshCore::MeshGeomFacet
 MeshGeomFacet ()
 default constructor More...
 
 MeshGeomFacet (const Base::Vector3f &v1, const Base::Vector3f &v2, const Base::Vector3f &v3)
 Constructor with the corner points. More...
 
 ~MeshGeomFacet ()
 Destruction. More...
 
bool IsPointOf (const Base::Vector3f &rclPoint, float fDistance) const
 Checks if the point is part of the facet. More...
 
bool IsPointOf (const Base::Vector3f &rclPoint) const
 Checks if the point is inside or at the border of the facet. More...
 
bool IsPointOfFace (const Base::Vector3f &rclP, float fDistance) const
 Checks whether the given point is inside the facet with tolerance fDistance. More...
 
bool Weights (const Base::Vector3f &rclP, float &w0, float &w1, float &w2) const
 Calculates the weights w1, ..., w3 of the corners to get the point rclP, i.e. More...
 
float DistancePlaneToPoint (const Base::Vector3f &rclPoint) const
 Calculates the distance of a point to the plane defined by the triangle. More...
 
void ProjectPointToPlane (const Base::Vector3f &rclPoint, Base::Vector3f &rclProj) const
 Calculates the projection of a point onto the plane defined by the triangle. More...
 
void ProjectFacetToPlane (MeshGeomFacet &rclFacet) const
 Calculates the projection of a facet onto the plane defined by the triangle. More...
 
bool IsDegenerated (float epsilon) const
 Checks whether the triangle is degenerated. More...
 
bool IsDeformed (float fCosOfMinAngle, float fCosOfMaxAngle) const
 Checks whether the triangle is deformed. More...
 
void Enlarge (float fDist)
 Enlarges the triangle. More...
 
void CalcNormal () const
 Calculates the facet normal for storing internally. More...
 
void ArrangeNormal (const Base::Vector3f &rclN)
 Arrange the facet normal so the both vectors have the same orientation. More...
 
void AdjustCirculationDirection ()
 Adjusts the facet's orientation to its normal. More...
 
void NormalInvalid ()
 Invalidate the normal. More...
 
bool IsFlag (MeshFacet::TFlagType tF) const
 Query the flag state of the facet. More...
 
void SetFlag (MeshFacet::TFlagType tF)
 Set flag state. More...
 
void ResetFlag (MeshFacet::TFlagType tF)
 Reset flag state. More...
 
Base::Vector3f GetGravityPoint () const
 Calculates the facet's gravity point. More...
 
Base::Vector3f GetNormal () const
 Returns the normal of the facet. More...
 
void SetNormal (const Base::Vector3f &rclNormal)
 Sets the facet's normal. More...
 
Base::BoundBox3f GetBoundBox () const
 Returns the wrapping bounding box. More...
 
float Perimeter () const
 Calculates the perimeter of the facet. More...
 
float Area () const
 Calculates the area of a facet. More...
 
float MaximumAngle () const
 Calculates the maximum angle of a facet. More...
 
float MinimumAngle () const
 Calculates the minimum angle of a facet. More...
 
bool ContainedByOrIntersectBoundingBox (const Base::BoundBox3f &rcBB) const
 Checks if the facet is inside the bounding box or intersects with it. More...
 
bool IntersectBoundingBox (const Base::BoundBox3f &rclBB) const
 Checks if the facet intersects with the given bounding box. More...
 
bool IntersectWithFacet (const MeshGeomFacet &rclFacet) const
 This method checks if both facets intersect. More...
 
int IntersectWithFacet (const MeshGeomFacet &facet, Base::Vector3f &rclPt0, Base::Vector3f &rclPt1) const
 Intersect the facet with the other facet The result is line given by two points (if intersected). More...
 
float DistanceToLineSegment (const Base::Vector3f &rcP1, const Base::Vector3f &rcP2) const
 Calculates the shortest distance from the line segment defined by rcP1 and rcP2 to this facet. More...
 
float DistanceToPoint (const Base::Vector3f &rcPt) const
 Calculates the shortest distance from the point rcPt to the facet. More...
 
float DistanceToPoint (const Base::Vector3f &rclPt, Base::Vector3f &rclNt) const
 Calculates the shortest distance from the point rcPt to the facet. More...
 
bool IntersectWithLine (const Base::Vector3f &rclPt, const Base::Vector3f &rclDir, Base::Vector3f &rclRes) const
 Calculates the intersection point of the line defined by the base rclPt and the direction rclDir with the facet. More...
 
bool Foraminate (const Base::Vector3f &rclPt, const Base::Vector3f &rclDir, Base::Vector3f &rclRes, float fMaxAngle=Mathf::PI) const
 Calculates the intersection point of the line defined by the base rclPt and the direction rclDir with the facet. More...
 
bool IntersectWithPlane (const Base::Vector3f &rclBase, const Base::Vector3f &rclNormal, Base::Vector3f &rclP1, Base::Vector3f &rclP2) const
 Checks if the facet intersects with the plane defined by the base rclBase and the normal rclNormal and returns true if two points are found, false otherwise. More...
 
bool IntersectWithPlane (const Base::Vector3f &rclBase, const Base::Vector3f &rclNormal) const
 Checks if the facet intersects with the plane defined by the base rclBase and the normal rclNormal. More...
 
bool IntersectPlaneWithLine (const Base::Vector3f &rclBase, const Base::Vector3f &rclNormal, Base::Vector3f &rclRes) const
 Checks if the plane defined by the facet rclFacet intersects with the line defined by the base rclBase and the direction rclNormal and returns the intersection point rclRes if possible. More...
 
float VolumeOfPrism (const MeshGeomFacet &rclF) const
 Calculates the volume of the prism defined by two facets. More...
 
void SubSample (float fStep, std::vector< Base::Vector3f > &rclPoints) const
 Subsamples the facet into points with resolution fStep. More...
 
float CenterOfInscribedCircle (Base::Vector3f &rclCenter) const
 Calculates the center and radius of the inscribed circle of the facet. More...
 
float CenterOfCircumCircle (Base::Vector3f &rclCenter) const
 Calculates the center and radius of the circum circle of the facet. More...
 
unsigned short NearestEdgeToPoint (const Base::Vector3f &rclPt) const
 Returns the edge number of the facet that is nearest to the point rclPt. More...
 
void NearestEdgeToPoint (const Base::Vector3f &rclPt, float &fDistance, unsigned short &side) const
 Returns the edge number side of the facet and the distance to the edge that is nearest to the point rclPt. More...
 
MeshGeomEdge GetEdge (short side) const
 Returns the edge for side. More...
 
bool IsPointOfSphere (const Base::Vector3f &rP) const
 The center and radius of the circum circle define a sphere in 3D. More...
 
bool IsPointOfSphere (const MeshGeomFacet &rFacet) const
 This is an overloaded member function, provided for convenience. More...
 
float AspectRatio () const
 The aspect ratio is the longest edge length divided by its height. More...
 
float AspectRatio2 () const
 The alternative aspect ration is the ratio of the radius of the circum-circle and twice the radius of the in-circle. More...
 
float Roundness () const
 The roundness is in the range between 0.0 (colinear) and 1.0 (equilateral). More...
 
void Transform (const Base::Matrix4D &)
 Apply a transformation on the triangle. More...
 
bool IsCoplanar (const MeshGeomFacet &facet) const
 Checks if the two triangles are coplanar. More...
 

Public Attributes

MeshCore::FacetIndex Index
 
Base::Reference< const MeshObjectMesh
 
MeshCore::FacetIndex NIndex [3]
 
MeshCore::PointIndex PIndex [3]
 

Detailed Description

The Facet helper class The MeshFacet class provides an interface for the MeshFacetPy class for convenient access to the Mesh data structure.

This class should not be used for programming algorithms in C++. Use Mesh Core classes instead!

Constructor & Destructor Documentation

◆ Facet() [1/2]

◆ Facet() [2/2]

Facet::Facet ( const Facet f)

References NIndex, and PIndex.

◆ ~Facet()

Facet::~Facet ( )

Member Function Documentation

◆ getEdge()

◆ isBound()

bool Mesh::Facet::isBound ( ) const

◆ operator=()

void Facet::operator= ( const Facet f)

References Index, NIndex, and PIndex.

Member Data Documentation

◆ Index

◆ Mesh

Base::Reference<const MeshObject> Mesh::Facet::Mesh

Referenced by getEdge().

◆ NIndex

MeshCore::FacetIndex Mesh::Facet::NIndex[3]

Referenced by Facet(), getEdge(), and operator=().

◆ PIndex

MeshCore::PointIndex Mesh::Facet::PIndex[3]

Referenced by Facet(), getEdge(), and operator=().


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