MeshPart::MeshProjection Class Reference

The MeshProjection class projects a shape onto a mesh. More...

#include <CurveProjector.h>

Classes

struct  Edge
 
struct  PolyLine
 
struct  SplitEdge
 Helper class. More...
 

Public Member Functions

void discretize (const TopoDS_Edge &aEdge, std::vector< Base::Vector3f > &polyline, std::size_t minPoints=2) const
 
void findSectionParameters (const TopoDS_Edge &edge, const Base::Vector3f &dir, std::set< double > &parameters) const
 findSectionParameters Find the parameters of the edge where when projecting the corresponding point will lie on an edge of the mesh. More...
 
 MeshProjection (const MeshKernel &rMesh)
 Construction. More...
 
void projectOnMesh (const std::vector< Base::Vector3f > &pointsIn, const Base::Vector3f &dir, float tolerance, std::vector< Base::Vector3f > &pointsOut) const
 projectOnMesh Projects the given points onto the mesh along a given direction. More...
 
void projectParallelToMesh (const std::vector< PolyLine > &aEdges, const Base::Vector3f &dir, std::vector< PolyLine > &rPolyLines) const
 Project all polylines onto the mesh using parallel projection. More...
 
void projectParallelToMesh (const TopoDS_Shape &aShape, const Base::Vector3f &dir, std::vector< PolyLine > &rPolyLines) const
 Project all edges of the shape onto the mesh using parallel projection. More...
 
void projectToMesh (const TopoDS_Shape &aShape, float fMaxDist, std::vector< PolyLine > &rPolyLines) const
 Searches all edges that intersect with the projected curve aShape. More...
 
void splitMeshByShape (const TopoDS_Shape &aShape, float fMaxDist) const
 Cuts the mesh at the curve defined by aShape. More...
 
 ~MeshProjection ()
 Destruction. More...
 

Protected Member Functions

bool findIntersection (const Edge &, const Edge &, const Base::Vector3f &dir, Base::Vector3f &res) const
 
void projectEdgeToEdge (const TopoDS_Edge &aCurve, float fMaxDist, const MeshCore::MeshFacetGrid &rGrid, std::vector< SplitEdge > &rSplitEdges) const
 

Detailed Description

The MeshProjection class projects a shape onto a mesh.

Author
Werner Mayer

Constructor & Destructor Documentation

◆ MeshProjection()

MeshProjection::MeshProjection ( const MeshKernel rMesh)

Construction.

◆ ~MeshProjection()

MeshProjection::~MeshProjection ( )

Destruction.

Member Function Documentation

◆ discretize()

void MeshProjection::discretize ( const TopoDS_Edge &  aEdge,
std::vector< Base::Vector3f > &  polyline,
std::size_t  minPoints = 2 
) const

◆ findIntersection()

bool MeshProjection::findIntersection ( const Edge edgeSegm,
const Edge meshEdge,
const Base::Vector3f dir,
Base::Vector3f res 
) const
protected

◆ findSectionParameters()

void MeshProjection::findSectionParameters ( const TopoDS_Edge &  edge,
const Base::Vector3f dir,
std::set< double > &  parameters 
) const

findSectionParameters Find the parameters of the edge where when projecting the corresponding point will lie on an edge of the mesh.

Parameters
edge
dir
parameters

References MeshPart::MeshProjection::Edge::cPt1, MeshPart::MeshProjection::Edge::cPt2, discretize(), findIntersection(), and MeshCore::MeshAlgorithm::GetAverageEdgeLength().

◆ projectEdgeToEdge()

◆ projectOnMesh()

void MeshProjection::projectOnMesh ( const std::vector< Base::Vector3f > &  pointsIn,
const Base::Vector3f dir,
float  tolerance,
std::vector< Base::Vector3f > &  pointsOut 
) const

projectOnMesh Projects the given points onto the mesh along a given direction.

The points can can be projected will be saved to pointsOut

projectOnMesh

Parameters
pointsIn
dir
tolerance
pointsOut

References MeshCore::MeshAlgorithm::GetAverageEdgeLength(), MeshCore::MeshGeomFacet::IntersectPlaneWithLine(), MeshCore::MeshGeomFacet::IsPointOfFace(), MeshCore::MeshAlgorithm::NearestFacetOnRay(), Base::SequencerLauncher::next(), draftutils.utils::tolerance(), and draftgeoutils.general::vec().

◆ projectParallelToMesh() [1/2]

void MeshProjection::projectParallelToMesh ( const std::vector< PolyLine > &  aEdges,
const Base::Vector3f dir,
std::vector< PolyLine > &  rPolyLines 
) const

◆ projectParallelToMesh() [2/2]

void MeshProjection::projectParallelToMesh ( const TopoDS_Shape &  aShape,
const Base::Vector3f dir,
std::vector< PolyLine > &  rPolyLines 
) const

◆ projectToMesh()

void MeshProjection::projectToMesh ( const TopoDS_Shape &  aShape,
float  fMaxDist,
std::vector< PolyLine > &  rPolyLines 
) const

Searches all edges that intersect with the projected curve aShape.

Therefore aShape must contain shapes of type TopoDS_Edge, other shape types are ignored. A possible solution is taken if the distance between the curve point and the projected point is <= fMaxDist.

References MeshCore::MeshAlgorithm::GetAverageEdgeLength(), Base::SequencerLauncher::next(), MeshPart::MeshProjection::PolyLine::points, and projectEdgeToEdge().

Referenced by splitMeshByShape().

◆ splitMeshByShape()

void MeshProjection::splitMeshByShape ( const TopoDS_Shape &  aShape,
float  fMaxDist 
) const

Cuts the mesh at the curve defined by aShape.

This method call projectToMesh() to get the split the facet at the found points.

See also
projectToMesh() for more details.

References projectToMesh().


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