Mesh class

Mesh class


back to menu

This class describes meshes



class Mesh {
public:
list<Mpoint *> _points; list of mesh points
list<Triangle *> _triangles; list of triangles

Mesh(); default constructor
~Mesh(); delete all the components of the mesh
Mesh(const Mesh&m); copy constructor
Mesh operator=(const Mesh&m); affectation operateur

void display() const; display information concernig the mesh
void clear(); clear the mesh and delete its components
const int nvertices() const; return the number of vertices
Mpoint * get_point(int n); return the nth point in the list

double distance(const Pt& p) const; signed distance of the point to the mesh
void reorientate(); puts the triangles in a coherent orientation
void addvertex(Triangle *const t,const Pt p); add a new mesh point in the centre of the triangle
void retessellate(); retessellate the whole mesh
void update(); update coordinates for all the points of the mesh
void translation(const double x,const double y,const double z); translate the whole mesh
void translation(const Vec v);translate the whole mesh
void rescale(const double t, const double x=0,const double y=0,const double z=0); rescale the whole mesh with scale t and center (x, y, z)
void rescale(const double t , const Pt p); rescale the whole mesh with scale t and center Pt
void load(string s); load mesh from .off file s
void save(string s="manual_input") const; save a mesh into s in .off format
const double self_intersection(const Mesh& original) const; amount of self intersection(cf bet report)
const bool real_self_intersection(const Mesh& original) const; returns true if the mesh is self-intersecting

const bool real_self_intersection(); check if the mesh self-intersects or not

};

void make_mesh_from_tetra(int n, Mesh& m); m becomes a tetrahedron rettesselated n times
void make_mesh_from_icosa(int n, Mesh& m); m becomes a icosahedron rettesselated n times
void make_mesh_from_octa(int n, Mesh& m); m becomes an octaahedron rettesselated n times
ostream& operator <<(ostream& flot,const Mesh & m); return a stream in .off format

Scripts:
drawmesh is a script that draws a mesh on a volume, or the corresponding binary mask.
Usage : drawmesh [mesh.off] [volume.hdr] (-m for the mask)


see examples
back to menu