MeshCore::MeshGeomEdge Class Reference

The MeshGeomEdge class is geometric counterpart to MeshEdge that holds the geometric data points of an edge. More...

#include <Elements.h>

Public Member Functions

void ClosestPointsToLine (const Base::Vector3f &linePt, const Base::Vector3f &lineDir, Base::Vector3f &rclPnt1, Base::Vector3f &rclPnt2) const
 Get the closest points rclPnt1 and rclPnt2 of the line defined by this edge and the line defined by rclPt and rclDir. More...
 
bool ContainedByOrIntersectBoundingBox (const Base::BoundBox3f &rclBB) const
 Checks if the edge is inside the bounding box or intersects with it. More...
 
Base::BoundBox3f GetBoundBox () const
 Returns the bounding box of the edge. More...
 
bool IntersectBoundingBox (const Base::BoundBox3f &rclBB) const
 Checks if the edge intersects with the given bounding box. 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 edge. More...
 
bool IntersectWithPlane (const Base::Vector3f &rclPt, const Base::Vector3f &rclDir, Base::Vector3f &rclRes) const
 Calculates the intersection point of the plane defined by the base rclPt and the direction rclDir with the edge. More...
 
 MeshGeomEdge (void)
 
void ProjectPointToLine (const Base::Vector3f &rclPoint, Base::Vector3f &rclProj) const
 Calculates the projection of a point onto the line defined by the edge. More...
 

Detailed Description

The MeshGeomEdge class is geometric counterpart to MeshEdge that holds the geometric data points of an edge.

Constructor & Destructor Documentation

◆ MeshGeomEdge()

MeshCore::MeshGeomEdge::MeshGeomEdge ( void  )

Member Function Documentation

◆ ClosestPointsToLine()

void MeshGeomEdge::ClosestPointsToLine ( const Base::Vector3f linePt,
const Base::Vector3f lineDir,
Base::Vector3f rclPnt1,
Base::Vector3f rclPnt2 
) const

Get the closest points rclPnt1 and rclPnt2 of the line defined by this edge and the line defined by rclPt and rclDir.

If the two points are identical then both lines intersect each other.

References Base::Vector3< _Precision >::Cross(), Base::Vector3< _Precision >::GetAngle(), and ProjectPointToLine().

◆ ContainedByOrIntersectBoundingBox()

bool MeshGeomEdge::ContainedByOrIntersectBoundingBox ( const Base::BoundBox3f rclBB) const

Checks if the edge is inside the bounding box or intersects with it.

References GetBoundBox(), IntersectBoundingBox(), and Base::BoundBox3< _Precision >::IsInBox().

◆ GetBoundBox()

Base::BoundBox3f MeshGeomEdge::GetBoundBox ( ) const

Returns the bounding box of the edge.

Referenced by ContainedByOrIntersectBoundingBox().

◆ IntersectBoundingBox()

◆ IntersectWithLine()

bool MeshGeomEdge::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 edge.

The intersection must be inside the edge. If there is no intersection false is returned.

References Base::Vector3< _Precision >::Cross(), Base::Distance(), Base::Vector3< _Precision >::DistanceToPlane(), and Base::Vector3< _Precision >::GetAngle().

◆ IntersectWithPlane()

bool MeshGeomEdge::IntersectWithPlane ( const Base::Vector3f rclPt,
const Base::Vector3f rclDir,
Base::Vector3f rclRes 
) const

Calculates the intersection point of the plane defined by the base rclPt and the direction rclDir with the edge.

The intersection must be inside the edge. If there is no intersection false is returned.

References Base::Vector3< _Precision >::Dot().

◆ ProjectPointToLine()

void MeshGeomEdge::ProjectPointToLine ( const Base::Vector3f rclPoint,
Base::Vector3f rclProj 
) const

Calculates the projection of a point onto the line defined by the edge.

The caller must check if the projection point is inside the edge.

References draftgeoutils.general::vec().

Referenced by ClosestPointsToLine().


The documentation for this class was generated from the following files:
  • Sources/FreeCAD/src/Mod/Mesh/App/Core/Elements.h
  • Sources/FreeCAD/src/Mod/Mesh/App/Core/Elements.cpp