Cmm2Mesh
A function to turn mesh data from hnf to a wireframe representation
ilato-Namensbereichsreferenz

Funktionen

void print_Vector (std::vector< MyMesh::VertexHandle > vector)
 utility function for printing vectors. Mehr ...
 
void print_Vector (std::vector< double > vector)
 utility function for printing vectors. Mehr ...
 
void print_2D_Vector (std::vector< std::vector< MyMesh::VertexHandle > > vector)
 A utility function for printing 2D vectors. Mehr ...
 
bool isSubset (std::vector< MyMesh::VertexHandle > superset, std::vector< MyMesh::VertexHandle > subset)
 A utility function for checking whether or not a set is a subset of another set. Mehr ...
 
void remove_duplicates_from_Vector (std::vector< MyMesh::VertexHandle > &vector)
 A utility function for removing duplicates form vectors. Orders the vector. Mehr ...
 
std::vector< std::vector< MyMesh::VertexHandle > > remove_unused_from_allowed (const MyMesh &mesh, std::vector< std::vector< MyMesh::VertexHandle >> allowed_in_planes, std::vector< MyMesh::VertexHandle > used_vertecies, int plane_nr)
 Removes those vertecies that weren't used from the "allowed" vector. Mehr ...
 
std::vector< std::vector< MyMesh::VertexHandle > > add_piece_to_mandatory (const MyMesh &mesh, std::vector< std::vector< MyMesh::VertexHandle >> mandatory_in_planes, std::vector< MyMesh::VertexHandle > piece, int plane_nr)
 Add a piece to the vector of vertecies that are mandatory in future. Mehr ...
 
void findFace (const MyMesh &mesh, std::vector< std::vector< std::vector< MyMesh::VertexHandle >>> &allPlanes_allLoops, std::vector< std::vector< MyMesh::VertexHandle >> mandatory_in_planes, std::vector< std::vector< MyMesh::VertexHandle >> allowed_in_planes, unsigned int plane_nr, int &done, std::vector< std::vector< MyMesh::VertexHandle >> &result, bool verbose=false)
 The main loop, finding valid pieces for a given side. Mehr ...
 
void unravelLoops (MyMesh mesh, std::vector< std::vector< std::vector< MyMesh::VertexHandle > > > allPlanes_allLoops, std::vector< std::unordered_multimap< int, int >> mymultimap_allFlaws, bool verbose=false)
 unravelLoops Restoring all loops, including those filtered for duplicate mappings Mehr ...
 
MyMesh cleanMesh (MyMesh &mesh, MyMesh &mesh_hnf)
 cleanMesh Creates a new, 'clean' mesh, without the unnecessary data amassed during creation Mehr ...
 
std::vector< std::vector< MyMesh::VertexHandle > > verticesByPlane (MyMesh &mesh, int planes)
 extracts all vertices belonging to a given plane Mehr ...
 
std::vector< std::vector< MyMesh::VertexHandle > > getValidNeighbors (MyMesh &mesh, int currentPlane, std::vector< MyMesh::VertexHandle > &vhCurrentPlane)
 getValidNeighbors Mehr ...
 
bool areParallel (MyMesh &mesh, std::vector< int > currentPath)
 
bool areParallel (MyMesh &mesh, std::vector< int > currentPath, int next)
 
bool no_U_turn (MyMesh &mesh, int currentVH, int nextVH)
 
std::vector< std::pair< int, int > > growPaths (std::vector< std::vector< int > > &paths, std::unordered_multimap< int, int > &mymultimap, MyMesh &mesh)
 
void appendPaths (std::vector< std::pair< int, int > > &growth, std::vector< std::vector< int > > &paths)
 
std::vector< std::vector< int > > loopsAtVertex (MyMesh::VertexHandle vh, std::unordered_multimap< int, int > &mymultimap, MyMesh &mesh)
 
std::vector< std::vector< MyMesh::VertexHandle > > loopsPerPlane (std::vector< MyMesh::VertexHandle > &vhCurrentPlane, std::unordered_multimap< int, int > &mymultimap, MyMesh &mesh, bool verbose=false)
 
void unify_multimap (std::vector< MyMesh::VertexHandle > vhInPlane, std::unordered_multimap< int, int > &mymultimap, bool verbose=false)
 
void resolve_duplicateMappings (std::vector< MyMesh::VertexHandle > keys, std::unordered_multimap< int, int > &mymultimap_toFix, std::unordered_multimap< int, int > mymultimap_knownFlaws)
 
void remove_duplicatesFromMap (std::vector< MyMesh::VertexHandle > keys, std::unordered_multimap< int, int > &mymultimap_toFix, std::unordered_multimap< int, int > &mymultimap_knownFlaws)
 
void print_multimap (std::vector< MyMesh::VertexHandle > keys, std::unordered_multimap< int, int > mymultimap)
 
void create_multimaps (MyMesh &mesh, std::vector< MyMesh::VertexHandle > vhCurrentPlane, int plane, std::unordered_multimap< int, int > &mymultimap, std::unordered_multimap< int, int > &mymultimap_flaws, double minLength=1.0, bool verbose=false)
 
int crossingsMultiplyTest (std::vector< Eigen::Vector2d > &polygon, Eigen::Vector2d cmm=Eigen::Vector2d(0, 0))
 

Dokumentation der Funktionen

std::vector<std::vector<MyMesh::VertexHandle> > ilato::add_piece_to_mandatory ( const MyMesh &  mesh,
std::vector< std::vector< MyMesh::VertexHandle >>  mandatory_in_planes,
std::vector< MyMesh::VertexHandle >  piece,
int  plane_nr 
)

Add a piece to the vector of vertecies that are mandatory in future.

Parameter
meshthe mesh to work on
mandatory_in_planesthe vector to store the mandatories in
piecethe piece itself
plane_nrthe number of the plane used
Rückgabe
the new mandatory vector
void ilato::appendPaths ( std::vector< std::pair< int, int > > &  growth,
std::vector< std::vector< int > > &  paths 
)
bool ilato::areParallel ( MyMesh &  mesh,
std::vector< int >  currentPath 
)
bool ilato::areParallel ( MyMesh &  mesh,
std::vector< int >  currentPath,
int  next 
)
MyMesh ilato::cleanMesh ( MyMesh &  mesh,
MyMesh &  mesh_hnf 
)

cleanMesh Creates a new, 'clean' mesh, without the unnecessary data amassed during creation

Parameter
meshthe mesh
mesh_hnfthe original hmf version of the mesh
Rückgabe
the clean mesh
void ilato::create_multimaps ( MyMesh &  mesh,
std::vector< MyMesh::VertexHandle >  vhCurrentPlane,
int  plane,
std::unordered_multimap< int, int > &  mymultimap,
std::unordered_multimap< int, int > &  mymultimap_flaws,
double  minLength = 1.0,
bool  verbose = false 
)
int ilato::crossingsMultiplyTest ( std::vector< Eigen::Vector2d > &  polygon,
Eigen::Vector2d  cmm = Eigen::Vector2d(0,0) 
)
void ilato::findFace ( const MyMesh &  mesh,
std::vector< std::vector< std::vector< MyMesh::VertexHandle >>> &  allPlanes_allLoops,
std::vector< std::vector< MyMesh::VertexHandle >>  mandatory_in_planes,
std::vector< std::vector< MyMesh::VertexHandle >>  allowed_in_planes,
unsigned int  plane_nr,
int &  done,
std::vector< std::vector< MyMesh::VertexHandle >> &  result,
bool  verbose = false 
)

The main loop, finding valid pieces for a given side.

Parameter
meshthe mesh to work on
allPlanes_allLoopsa vector consisting of all calculated loops per plane
mandatory_in_planesthe vertecies mandatory per plane
allowed_in_planesthe vertecues allowed per plane
plane_nrthe number of the plane used
doneare we done? set by function
resultcontainer for result
verboseSet true for debug info
std::vector<std::vector<MyMesh::VertexHandle> > ilato::getValidNeighbors ( MyMesh &  mesh,
int  currentPlane,
std::vector< MyMesh::VertexHandle > &  vhCurrentPlane 
)

getValidNeighbors

Parameter
meshintersection points of all CMM planes
currentPlane
vhCurrentPlanevertexhandles of current planes' intersection points
Rückgabe
vector with valid neighbors per vertexhandle in vhCurrentplanes
std::vector<std::pair<int,int> > ilato::growPaths ( std::vector< std::vector< int > > &  paths,
std::unordered_multimap< int, int > &  mymultimap,
MyMesh &  mesh 
)
bool ilato::isSubset ( std::vector< MyMesh::VertexHandle >  superset,
std::vector< MyMesh::VertexHandle >  subset 
)

A utility function for checking whether or not a set is a subset of another set.

Parameter
supersetThe set to be checked for being a superset.
subsetThe set to be checked for being a subset.
Rückgabe
whether or not the set is a subset
std::vector<std::vector<int> > ilato::loopsAtVertex ( MyMesh::VertexHandle  vh,
std::unordered_multimap< int, int > &  mymultimap,
MyMesh &  mesh 
)
std::vector<std::vector<MyMesh::VertexHandle> > ilato::loopsPerPlane ( std::vector< MyMesh::VertexHandle > &  vhCurrentPlane,
std::unordered_multimap< int, int > &  mymultimap,
MyMesh &  mesh,
bool  verbose = false 
)
bool ilato::no_U_turn ( MyMesh &  mesh,
int  currentVH,
int  nextVH 
)
void ilato::print_2D_Vector ( std::vector< std::vector< MyMesh::VertexHandle > >  vector)

A utility function for printing 2D vectors.

Parameter
vectorThe vector to be printed.
void ilato::print_multimap ( std::vector< MyMesh::VertexHandle >  keys,
std::unordered_multimap< int, int >  mymultimap 
)
void ilato::print_Vector ( std::vector< MyMesh::VertexHandle >  vector)

utility function for printing vectors.

Parameter
vectorThe vector to be printed.
void ilato::print_Vector ( std::vector< double >  vector)

utility function for printing vectors.

Parameter
vectorThe vector to be printed.
void ilato::remove_duplicates_from_Vector ( std::vector< MyMesh::VertexHandle > &  vector)

A utility function for removing duplicates form vectors. Orders the vector.

Parameter
vectorThe vector to be cleaned.
void ilato::remove_duplicatesFromMap ( std::vector< MyMesh::VertexHandle >  keys,
std::unordered_multimap< int, int > &  mymultimap_toFix,
std::unordered_multimap< int, int > &  mymultimap_knownFlaws 
)
std::vector<std::vector<MyMesh::VertexHandle> > ilato::remove_unused_from_allowed ( const MyMesh &  mesh,
std::vector< std::vector< MyMesh::VertexHandle >>  allowed_in_planes,
std::vector< MyMesh::VertexHandle >  used_vertecies,
int  plane_nr 
)

Removes those vertecies that weren't used from the "allowed" vector.

Parameter
meshthe mesh to work on
allowed_in_planesthe vertecies in each planes that are still allowed to be used
used_verteciesthe vertecies that been used in this iteration
plane_nrthe number of the plane used
Rückgabe
the new allowed vector
void ilato::resolve_duplicateMappings ( std::vector< MyMesh::VertexHandle >  keys,
std::unordered_multimap< int, int > &  mymultimap_toFix,
std::unordered_multimap< int, int >  mymultimap_knownFlaws 
)
void ilato::unify_multimap ( std::vector< MyMesh::VertexHandle >  vhInPlane,
std::unordered_multimap< int, int > &  mymultimap,
bool  verbose = false 
)
void ilato::unravelLoops ( MyMesh  mesh,
std::vector< std::vector< std::vector< MyMesh::VertexHandle > > >  allPlanes_allLoops,
std::vector< std::unordered_multimap< int, int >>  mymultimap_allFlaws,
bool  verbose = false 
)

unravelLoops Restoring all loops, including those filtered for duplicate mappings

Parameter
meshthe mesh to work on
allPlanes_allLoopsa vector consisting of all calculated loops per plane
mymultimap_allFlawsthe vector of all the Flaw-dictionaries per planes
verboseset true for debug info
std::vector<std::vector<MyMesh::VertexHandle> > ilato::verticesByPlane ( MyMesh &  mesh,
int  planes 
)

extracts all vertices belonging to a given plane

Parameter
meshintersection points of all CMM planes
planesnumber of surface parts mesured via CMM
Rückgabe
vector with one element per plane, storing in turn all vertexhandles of contained intersection points