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 | IntersectWithEdge (const MeshGeomEdge &edge, Base::Vector3f &res) const |
Calculates the intersection point of an edge with this edge. 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... | |
bool | IsCollinear (const MeshGeomEdge &edge) const |
Checks if the two edges are collinear. More... | |
bool | IsParallel (const MeshGeomEdge &edge) const |
Checks if the two edges are parallel. More... | |
bool | IsPointOf (const Base::Vector3f &rclPoint, float fDistance) const |
Checks if the point is part of the edge. More... | |
bool | IsProjectionPointOf (const Base::Vector3f &point) const |
Checks if the projection point of point lies on the edge. More... | |
MeshGeomEdge () | |
void | ProjectPointToLine (const Base::Vector3f &rclPoint, Base::Vector3f &rclProj) const |
Calculates the projection of a point onto the line defined by the edge. More... | |
The MeshGeomEdge class is geometric counterpart to MeshEdge that holds the geometric data points of an edge.
MeshCore::MeshGeomEdge::MeshGeomEdge | ( | ) |
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().
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().
Base::BoundBox3f MeshGeomEdge::GetBoundBox | ( | ) | const |
Returns the bounding box of the edge.
Referenced by ContainedByOrIntersectBoundingBox(), and MeshCore::MeshEvalPointOnEdge::Evaluate().
bool MeshGeomEdge::IntersectBoundingBox | ( | const Base::BoundBox3f & | rclBB | ) | const |
Checks if the edge intersects with the given bounding box.
References Base::BoundBox3< _Precision >::GetCenter(), Base::BoundBox3< _Precision >::LengthX(), Base::BoundBox3< _Precision >::LengthY(), Base::BoundBox3< _Precision >::LengthZ(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by ContainedByOrIntersectBoundingBox().
bool MeshGeomEdge::IntersectWithEdge | ( | const MeshGeomEdge & | edge, |
Base::Vector3f & | res | ||
) | const |
Calculates the intersection point of an edge with this edge.
The intersection must be inside both edges. If there is no intersection false is returned.
References Base::Vector3< _Precision >::Cross(), Base::Vector3< _Precision >::Dot(), Base::Vector3< _Precision >::IsNull(), and IsProjectionPointOf().
Referenced by MeshCore::MeshGeomFacet::IntersectWithFacet().
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().
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().
bool MeshGeomEdge::IsCollinear | ( | const MeshGeomEdge & | edge | ) | const |
Checks if the two edges are collinear.
References Base::Vector3< _Precision >::Cross(), Base::Vector3< _Precision >::IsNull(), and IsParallel().
bool MeshGeomEdge::IsParallel | ( | const MeshGeomEdge & | edge | ) | const |
Checks if the two edges are parallel.
References Base::Vector3< _Precision >::Cross(), and Base::Vector3< _Precision >::IsNull().
Referenced by IsCollinear().
bool MeshGeomEdge::IsPointOf | ( | const Base::Vector3f & | rclPoint, |
float | fDistance | ||
) | const |
Checks if the point is part of the edge.
A point is regarded as part of an edge if the distance is lower than fDistance to the projected point of rclPoint on the edge.
References Base::Distance(), and Base::DistanceP2().
Referenced by MeshCore::MeshEvalPointOnEdge::Evaluate().
bool MeshGeomEdge::IsProjectionPointOf | ( | const Base::Vector3f & | point | ) | const |
Checks if the projection point of point lies on the edge.
Referenced by IntersectWithEdge().
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().