Core 1.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Mesh Class Reference

Core triangle mesh class. More...

#include <mesh.h>

Inheritance diagram for Mesh:
MeshColor MeshStack MeshTopo

Public Member Functions

 Mesh ()
 Initialize the mesh to empty.
 
 Mesh (const Mesh2 &)
 Initialize the structure from a two dimensional mesh. More...
 
 Mesh (const QVector< Vector > &)
 Create a mesh from a set of vertices. More...
 
 Mesh (const QVector< Vector > &, const QVector< int > &, bool=true)
 Create a mesh from a set of vertices and a set of triangle indexes. More...
 
 Mesh (const QVector< Vector > &, const QVector< Vector > &, const QVector< int > &, const QVector< int > &)
 Create the mesh. More...
 
 ~Mesh ()
 Empty.
 
void Reserve (int, int, int, int)
 Reserve memory for arrays. More...
 
Triangle GetTriangle (int) const
 Get a triangle. More...
 
const Vector Vertex (int) const
 Get a vertex. More...
 
VectorVertex (int)
 Acces to a vertex. More...
 
Vector Vertex (int, int) const
 Get a vertex from a specific triangle. More...
 
Vector Normal (int) const
 Get a normal. More...
 
int Triangles () const
 Get the number of triangles.
 
int Vertexes () const
 Get the number of vertices in the geometry. More...
 
bool Manifold () const
 Check if a mesh is manifold.
 
void Append (const Mesh &)
 Merge two meshes into a single one. More...
 
QVector< VectorGetVertices () const
 Get the array of vertices.
 
QVector< VectorGetNormals () const
 Get the array of normals.
 
QVector< int > VertexIndexes () const
 Return the set of vertex indexes.
 
QVector< int > NormalIndexes () const
 Return the set of normal indexes.
 
QVector< TriangleGetTriangles () const
 Returns the geometry as a set of triangles.
 
int VertexIndex (int, int) const
 Get the vertex index of a given triangle. More...
 
int NormalIndex (int, int) const
 Get the normal index of a given triangle. More...
 
Vector operator[] (int) const
 Get a vertex. More...
 
double R (const Vector &) const
 Compute the squared distance to the mesh. More...
 
double Signed (const Vector &) const
 Compute the signed distance to the mesh. More...
 
bool Intersect (const Ray &, double &, int &) const
 Compute the intersection between a ray and the mesh. More...
 
int Intersections (const Ray &) const
 Compute the number of intersections between a ray and the mesh. More...
 
bool Inside (const Vector &) const
 Check if a point is inside or outside of the object. More...
 
Box GetBox () const
 Compute the bounding box of the object.
 
Sphere GetSphere () const
 Compute the bounding sphere of the object.
 
double AverageEdgeLength () const
 Compute the average edge length.
 
void EdgeLengthRange (double &, double &) const
 Compute the range of edge lengths. More...
 
QVector< int > AspectRatios (int=4) const
 Compute the histogram of the aspect ratio of the triangles of the mesh. More...
 
void EdgeCollapse (const double &)
 Run a simple edge collapse algorithm over a triangle mesh. More...
 
void Transform (const FrameScaled &)
 Transforms the mesh given a transformation. More...
 
Mesh Transformed (const FrameScaled &) const
 Transforms the mesh given a transformation. More...
 
void InverseTransform (const FrameScaled &)
 Inverse transform. More...
 
void Symmetry (const Plane &)
 Apply a planar symmetry to the object. More...
 
void Rotate (const Matrix &)
 Rotate the mesh. More...
 
void Translate (const Vector &)
 Translate the mesh. More...
 
void Scale (const Vector &)
 Scale the mesh. More...
 
void Scale (const double &)
 Scale the mesh. More...
 
void SmoothNormals ()
 Smooth the normals of the mesh. More...
 
int IsSmooth (int) const
 Check if the ith triangle in the mesh is a flat or smooth triangle. More...
 
 Mesh (const Capsule &, int, int=2)
 Creates a capsule. More...
 
 Mesh (const Quadrangle &, int, int)
 Generate a grid geometry over an input quadrangle. More...
 
 Mesh (const Quadrangle &)
 Generate a quadrangle. More...
 
 Mesh (const Octahedron &)
 Creates the mesh of an octaedron. More...
 
 Mesh (const Box &)
 Creates an axis aligned box. More...
 
 Mesh (const Triangle &)
 Creates a triangle. More...
 
 Mesh (const Sphere &, int)
 Creates a sphere, using polar coordinates. More...
 
 Mesh (const SphereSet &, int)
 Creates a set of spheres. More...
 
 Mesh (const Cylinder &, int, bool=true, bool=true)
 Creates a cylinder. More...
 
 Mesh (const Disc &, int)
 Creates a disc. More...
 
 Mesh (const Dodecahedron &)
 This function creates the mesh of a dodecahedron. More...
 
 Mesh (const Icosahedron &)
 Create the mesh of an icosahedron. More...
 
 Mesh (const QVector< Vector > &, const QVector< Vector > &, const Vector &, const Vector &)
 Create a generalized cylinder with star-shaped contours. More...
 
 Mesh (const Torus &, int, int, int=-1, int=-1)
 Create the mesh of an torus. More...
 
 Mesh (const Cuboctahedron &)
 Create the mesh of a cuboctahedron. More...
 
 Mesh (const Icosidodecahedron &)
 Create the mesh of an icosidodecahedron. More...
 
 Mesh (const Hexagonal &)
 Create the mesh of a hexagonal prism. More...
 
 Mesh (const Cone &, int)
 Creates the mesh of a cone. More...
 
 Mesh (const Rectangles &, int, int)
 Generate a grid geometry over an input rectangle. More...
 
 Mesh (const Cuboid &)
 Creates the mesh of a cuboid. More...
 
 Mesh (const QuadricSurface &, const Box2 &, int, int)
 Generate a grid geometry and polygonize the quadric surface. More...
 
 Mesh (const QuadricCurve &, const double &, int, int)
 Create a swept-sphere along a quadric curve. More...
 
 Mesh (const CubicCurveSet &, const double &, int, int)
 Create a swept-sphere along a cubic curve. More...
 
 Mesh (const QuadricCurveSet &, const double &, int, int=2)
 Create a swept-sphere along a set of quadric curves. More...
 
Mesh ShrinkedTriangles (const double &) const
 Scales (shrinks) all the triangles of the model. More...
 
void Load (const QString &)
 Import a mesh from an .obj file. More...
 
void SaveObj (const QString &, const QString &=QString("mesh")) const
 Save the mesh in .obj format, with vertices and normals. More...
 

Static Public Member Functions

static Mesh Hull (const QVector< Vector > &)
 Compute the convex hull. More...
 
static Mesh Extrusion (const PointCurve &, const PointCurve2 &)
 Extrude a contour along a point curve. More...
 
static Mesh Extrusion (const PointCurve &, const QVector< PointCurve2 > &)
 Extrude a set of contour along a point curve. More...
 
static Mesh Arrow (const Vector &, const Vector &, const double &, const double &, const double &, int)
 Creates an arrow. The object has 3n+2 vertices, 2n+2 normals and 6n triangles. More...
 

Protected Member Functions

void AddTriangle (int, int, int, int)
 Add a triangle to the geometry. More...
 
void AddSmoothTriangle (int, int, int, int, int, int)
 Add a smooth triangle to the geometry. More...
 
void AddSmoothQuadrangle (int, int, int, int, int, int, int, int)
 Add a smmoth quadrangle to the geometry. More...
 
void AddQuadrangle (int, int, int, int)
 Add a quadrangle to the geometry. More...
 
void AddQuadrangle (int, int, int, int, int)
 Add a quadrangle to the geometry. More...
 
void AddPentagon (int, int, int, int, int, int)
 Add a pentagon to the geometry. More...
 
int NextIndex (int) const
 Compute the next index of an edge in a triangle. More...
 
int PrevIndex (int) const
 Compute the previous index of an edge in a triangle. More...
 
int BaseIndex (int) const
 Compute the base index of a triangle given an edge index. More...
 

Protected Attributes

QVector< Vectorvertices
 Vertices.
 
QVector< Vectornormals
 Normals.
 
QVector< int > varray
 Vertex indexes.
 
QVector< int > narray
 Normal indexes.
 

Friends

class MeshStack
 
std::ostream & operator<< (std::ostream &, const Mesh &)
 Overloaded. More...
 

Detailed Description

Core triangle mesh class.

Constructor & Destructor Documentation

◆ Mesh() [1/28]

Mesh::Mesh ( const Mesh2 mesh)
explicit

Initialize the structure from a two dimensional mesh.

Parameters
meshPlanar mesh.

◆ Mesh() [2/28]

Mesh::Mesh ( const QVector< Vector > &  vertices)
explicit

Create a mesh from a set of vertices.

The set defines the 3n vertexes of n triangles. The array of triangle indexes is generated internally.

Parameters
verticesList of vertices.

◆ Mesh() [3/28]

Mesh::Mesh ( const QVector< Vector > &  vertices,
const QVector< int > &  indices,
bool  flat = true 
)
explicit

Create a mesh from a set of vertices and a set of triangle indexes.

Indices must have a size multiple of three. Normals are computed to define flat triangles.

Parameters
verticesList of vertices.
indicesList of vertex indexes.
flatBoolean, set to true if face should be flat, set to false to generate smooth normals.

◆ Mesh() [4/28]

Mesh::Mesh ( const QVector< Vector > &  vertices,
const QVector< Vector > &  normals,
const QVector< int > &  va,
const QVector< int > &  na 
)
explicit

Create the mesh.

Parameters
vertices,normalsArray of vertices and normals.
va,naArray of vertex and normal indexes.

◆ Mesh() [5/28]

Mesh::Mesh ( const Capsule c,
int  n,
int  m = 2 
)
explicit

Creates a capsule.

The mesh has 2n(n-1)+2 vertices, 2n(n-1)+2 normals and 4n(n-1) triangles.

Parameters
cCapsule.
nNumber of points on circle, the number of slices on a half sphere will be E(n/4).
mNumber of slices on the cylinder part (should be 2 at least).

◆ Mesh() [6/28]

Mesh::Mesh ( const Quadrangle quad,
int  nx,
int  ny 
)
explicit

Generate a grid geometry over an input quadrangle.

Parameters
quadQuadrangle.
nx,nyNumber of points in the subdivision.

◆ Mesh() [7/28]

Mesh::Mesh ( const Quadrangle quad)
explicit

Generate a quadrangle.

Parameters
quadQuadrangle, should be flat.

◆ Mesh() [8/28]

Mesh::Mesh ( const Octahedron octa)
explicit

Creates the mesh of an octaedron.

Parameters
octaOctahedron.

◆ Mesh() [9/28]

Mesh::Mesh ( const Box box)
explicit

Creates an axis aligned box.

The object has 8 vertices, 6 normals and 12 triangles.

Parameters
boxThe box.

◆ Mesh() [10/28]

Mesh::Mesh ( const Triangle t)
explicit

Creates a triangle.

Parameters
tThe triangle.

◆ Mesh() [11/28]

Mesh::Mesh ( const Sphere sphere,
int  n 
)
explicit

Creates a sphere, using polar coordinates.

The object has (2 n) (n - 1) + 2 vertices, (2 n) (n - 1) + 2 normals and 4n(n-1) triangles.

Parameters
sphereSphere.
nDiscretization parameter.

◆ Mesh() [12/28]

Mesh::Mesh ( const SphereSet set,
int  n 
)
explicit

Creates a set of spheres.

Parameters
setSet of spheres.
nDiscretization parameter.

◆ Mesh() [13/28]

Mesh::Mesh ( const Cylinder cylinder,
int  n,
bool  ca = true,
bool  cb = true 
)
explicit

Creates a cylinder.

The cylinder with caps has 2n+2 vertices, n+2 normals and 4n triangles.

Parameters
cylinderCylinder.
ca,cbBooleans defining whether the cylinder should have caps.
nDiscretization.

◆ Mesh() [14/28]

Mesh::Mesh ( const Disc disc,
int  n 
)
explicit

Creates a disc.

The disc with has n+1 vertices.

Parameters
discDisc.
nDiscretization.

◆ Mesh() [15/28]

Mesh::Mesh ( const Dodecahedron dodecahedron)
explicit

This function creates the mesh of a dodecahedron.

The object has 20 vertices, 12 normals and 36 triangles

Parameters
dodecahedronDodecahedron.

◆ Mesh() [16/28]

Mesh::Mesh ( const Icosahedron icosahedron)
explicit

Create the mesh of an icosahedron.

Parameters
icosahedronIcosahedron.

◆ Mesh() [17/28]

Mesh::Mesh ( const QVector< Vector > &  ca,
const QVector< Vector > &  cb,
const Vector a,
const Vector b 
)
explicit

Create a generalized cylinder with star-shaped contours.

Parameters
ca,cbStar-shaped contours, they should have the same size.
a,bCenters of the two contours.

◆ Mesh() [18/28]

Mesh::Mesh ( const Torus t,
int  n,
int  p,
int  ia = -1,
int  ib = -1 
)
explicit

Create the mesh of an torus.

Parameters
tTorus.
n,pDiscretization of the generating circles.
ia,ibStarting and ending indexes of the sections of the torus

◆ Mesh() [19/28]

Mesh::Mesh ( const Cuboctahedron c)
explicit

Create the mesh of a cuboctahedron.

Parameters
cCuboctahedron.

◆ Mesh() [20/28]

Mesh::Mesh ( const Icosidodecahedron icosi)
explicit

Create the mesh of an icosidodecahedron.

Parameters
icosiIcosidodecahedron.

◆ Mesh() [21/28]

Mesh::Mesh ( const Hexagonal hexa)
explicit

Create the mesh of a hexagonal prism.

Parameters
hexaHexagonal prism.

◆ Mesh() [22/28]

Mesh::Mesh ( const Cone cone,
int  n 
)
explicit

Creates the mesh of a cone.

A truncated cone has 2n+2 vertices, n+2 normals and 4n triangles.

A real cone has n+2 vertices, n+2 normals and 2n triangles.

Parameters
coneThe cone.
nDiscretization parameter.

◆ Mesh() [23/28]

Mesh::Mesh ( const Rectangles rect,
int  nx,
int  ny 
)
explicit

Generate a grid geometry over an input rectangle.

Parameters
rectRectangle.
nx,nyNumber of points in the subdivision.

◆ Mesh() [24/28]

Mesh::Mesh ( const Cuboid cuboid)
explicit

Creates the mesh of a cuboid.

Parameters
cuboidThe cuboid.

◆ Mesh() [25/28]

Mesh::Mesh ( const QuadricSurface s,
const Box2 box,
int  nx,
int  ny 
)
explicit

Generate a grid geometry and polygonize the quadric surface.

Parameters
sThe quadric surface.
boxThe box.
nx,nyNumber of points in the subdivision.

◆ Mesh() [26/28]

Mesh::Mesh ( const QuadricCurve c,
const double &  r,
int  n,
int  m 
)
explicit

Create a swept-sphere along a quadric curve.

Parameters
cQuadric curve
rRadius.
nNumber of points on circle.
mNumber of slices on the curve (should be 2 at least).

◆ Mesh() [27/28]

Mesh::Mesh ( const CubicCurveSet c,
const double &  r,
int  n,
int  m 
)
explicit

Create a swept-sphere along a cubic curve.

Parameters
cSet of cubic curves
rRadius.
nNumber of points on circle.
mNumber of slices on the curve (should be 2 at least).

◆ Mesh() [28/28]

Mesh::Mesh ( const QuadricCurveSet c,
const double &  r,
int  n,
int  m = 2 
)
explicit

Create a swept-sphere along a set of quadric curves.

Parameters
cSet of quadric curves
rRadius.
nNumber of points on circle.
mNumber of slices on the curve (should be 2 at least).

Member Function Documentation

◆ AddPentagon()

void Mesh::AddPentagon ( int  a,
int  b,
int  c,
int  d,
int  e,
int  n 
)
protected

Add a pentagon to the geometry.

It creates three triangles abc, acd and ade.

Parameters
a,b,c,d,eIndex of the vertices.
nIndex of the normal shared by all vertices.

◆ AddQuadrangle() [1/2]

void Mesh::AddQuadrangle ( int  a,
int  b,
int  c,
int  d 
)
protected

Add a quadrangle to the geometry.

Parameters
a,b,c,dIndex of the vertices and normals.

◆ AddQuadrangle() [2/2]

void Mesh::AddQuadrangle ( int  a,
int  b,
int  c,
int  d,
int  n 
)
protected

Add a quadrangle to the geometry.

Parameters
a,b,c,dIndex of the vertexes.
nIndex of the (shared) normal.

◆ AddSmoothQuadrangle()

void Mesh::AddSmoothQuadrangle ( int  a,
int  na,
int  b,
int  nb,
int  c,
int  nc,
int  d,
int  nd 
)
protected

Add a smmoth quadrangle to the geometry.

Creates two smooth triangles abc and acd.

Parameters
a,b,c,dIndex of the vertexes.
na,nb,nc,ndIndexes of the normals for the vertexes.

◆ AddSmoothTriangle()

void Mesh::AddSmoothTriangle ( int  a,
int  na,
int  b,
int  nb,
int  c,
int  nc 
)
protected

Add a smooth triangle to the geometry.

Parameters
a,b,cIndex of the vertices.
na,nb,ncIndex of the normals.

◆ AddTriangle()

void Mesh::AddTriangle ( int  a,
int  b,
int  c,
int  n 
)
protected

Add a triangle to the geometry.

Parameters
a,b,cIndex of the vertices.
nIndex of the normal.

◆ Append()

void Mesh::Append ( const Mesh mesh)

Merge two meshes into a single one.

Parameters
meshArgument mesh.

◆ Arrow()

Mesh Mesh::Arrow ( const Vector a,
const Vector b,
const double &  r,
const double &  R,
const double &  l,
int  n 
)
static

Creates an arrow. The object has 3n+2 vertices, 2n+2 normals and 6n triangles.

Note that this shape is more efficient in terms of storage than a cylinder and a cone.

Parameters
a,bEnd vertices.
r,RCylinder and cone radii.
lLength of the cylinder, the size of the cone will be derived from the distance b-a minus this length.
nDiscretization.

◆ AspectRatios()

QVector< int > Mesh::AspectRatios ( int  n = 4) const

Compute the histogram of the aspect ratio of the triangles of the mesh.

Parameters
nNumber of classes.

◆ BaseIndex()

int Mesh::BaseIndex ( int  i) const
inlineprotected

Compute the base index of a triangle given an edge index.

Parameters
iEdge index.

◆ EdgeCollapse()

void Mesh::EdgeCollapse ( const double &  epsilon)

Run a simple edge collapse algorithm over a triangle mesh.

This algorithm runs in O(n2) where n denotes the number of triangles in the mesh.

Parameters
epsilonThreshold length for collapsing an edge.

◆ EdgeLengthRange()

void Mesh::EdgeLengthRange ( double &  a,
double &  b 
) const

Compute the range of edge lengths.

Parameters
a,bRange.

◆ Extrusion() [1/2]

Mesh Mesh::Extrusion ( const PointCurve curve,
const PointCurve2 profile 
)
static

Extrude a contour along a point curve.

Parameters
curveCurve.
profileContour.

◆ Extrusion() [2/2]

Mesh Mesh::Extrusion ( const PointCurve curve,
const QVector< PointCurve2 > &  profile 
)
static

Extrude a set of contour along a point curve.

The curve and the set of contours should have the same size.

Parameters
curve%Curve.
profileContour.

◆ GetTriangle()

Triangle Mesh::GetTriangle ( int  i) const
inline

Get a triangle.

Parameters
iIndex.
Returns
The triangle.

◆ Hull()

Mesh Mesh::Hull ( const QVector< Vector > &  p)
static

Compute the convex hull.

Parameters
pSet of points.
Author
Leo McCormack, Copyright © 2017-2018

◆ Inside()

bool Mesh::Inside ( const Vector p) const

Check if a point is inside or outside of the object.

This is a brute force algorithm, that computes all the intersections between the ray and the triangles of the object.

The mesh should be closed, i.e. without holes.

Parameters
pPoint.

◆ Intersect()

bool Mesh::Intersect ( const Ray ray,
double &  depth,
int &  index 
) const

Compute the intersection between a ray and the mesh.

Very computationally intensive function: compute all the ray-triangle intersections.

Parameters
rayThe ray.
depthIntersection depth.
indexIndex of the intersected triangle.

◆ Intersections()

int Mesh::Intersections ( const Ray ray) const

Compute the number of intersections between a ray and the mesh.

Very computationally intensive function: compute all the ray-triangle intersections.

Parameters
rayThe ray.

◆ InverseTransform()

void Mesh::InverseTransform ( const FrameScaled frame)

Inverse transform.

See also
Mesh::Transform()
Parameters
frameTransformation.

◆ IsSmooth()

int Mesh::IsSmooth ( int  i) const

Check if the ith triangle in the mesh is a flat or smooth triangle.

This is performed by comparing the indexes of the normals, not the normals themselves. Therefore, should the normal indexes be different but the normal vector equal, the function will return that the triangle is a smooth one anyway.

Parameters
iIndex of the triangle.

◆ Load()

void Mesh::Load ( const QString &  filename)

Import a mesh from an .obj file.

Parameters
filenameFile name.

◆ NextIndex()

int Mesh::NextIndex ( int  i) const
inlineprotected

Compute the next index of an edge in a triangle.

Parameters
iIndex of the starting vertex of an edge.

◆ Normal()

Vector Mesh::Normal ( int  i) const
inline

Get a normal.

Parameters
iIndex of the wanted normal.
Returns
The normal.

◆ NormalIndex()

int Mesh::NormalIndex ( int  t,
int  i 
) const
inline

Get the normal index of a given triangle.

Parameters
tTriangle index.
iNormal index.

◆ operator[]()

Vector Mesh::operator[] ( int  i) const
inline

Get a vertex.

Parameters
iThe index of the wanted vertex.
Returns
The wanted vertex (as a 3D Vector).
See also
vertex(int i) const

◆ PrevIndex()

int Mesh::PrevIndex ( int  i) const
inlineprotected

Compute the previous index of an edge in a triangle.

Parameters
iIndex of the starting vertex of an edge.

◆ R()

double Mesh::R ( const Vector p) const

Compute the squared distance to the mesh.

This function computes the squared distance to the surface, not the squared distance to the solid object.

Parameters
pPoint.

◆ Reserve()

void Mesh::Reserve ( int  nv,
int  nn,
int  nvi,
int  nvn 
)

Reserve memory for arrays.

Parameters
nv,nn,nvi,nvnNumber of vertices, normals, vertex indexes and vertex normals.

◆ Rotate()

void Mesh::Rotate ( const Matrix r)

Rotate the mesh.

Parameters
rRotation matrix.

◆ SaveObj()

void Mesh::SaveObj ( const QString &  url,
const QString &  meshName = QString("mesh") 
) const

Save the mesh in .obj format, with vertices and normals.

Parameters
urlFilename.
meshNameMesh name in .obj file.

◆ Scale() [1/2]

void Mesh::Scale ( const double &  s)

Scale the mesh.

Parameters
sScaling factor.

◆ Scale() [2/2]

void Mesh::Scale ( const Vector s)

Scale the mesh.

Parameters
sScaling vector, terms should be >0.

◆ ShrinkedTriangles()

Mesh Mesh::ShrinkedTriangles ( const double &  e) const

Scales (shrinks) all the triangles of the model.

It should be possible to look into the geometry as holes will appear at the edges and vertices of the model.

Parameters
eErosion.

◆ Signed()

double Mesh::Signed ( const Vector p) const

Compute the signed distance to the mesh.

The mesh should be closed.

Parameters
pPoint.

◆ SmoothNormals()

void Mesh::SmoothNormals ( )

Smooth the normals of the mesh.

This function weights the normals of the faces by their corresponding area.

See also
Triangle::AreaNormal()

◆ Symmetry()

void Mesh::Symmetry ( const Plane plane)

Apply a planar symmetry to the object.

Parameters
planePlane.

◆ Transform()

void Mesh::Transform ( const FrameScaled frame)

Transforms the mesh given a transformation.

Parameters
frameTransformation.

◆ Transformed()

Mesh Mesh::Transformed ( const FrameScaled frame) const

Transforms the mesh given a transformation.

Parameters
frameTransformation.

◆ Translate()

void Mesh::Translate ( const Vector t)

Translate the mesh.

Parameters
tTranslation vector.

◆ Vertex() [1/3]

Vector & Mesh::Vertex ( int  i)
inline

Acces to a vertex.

Parameters
iThe index of the vertex.

◆ Vertex() [2/3]

const Vector Mesh::Vertex ( int  i) const
inline

Get a vertex.

Parameters
iThe index of the vertex.
Returns
The vertex position.

◆ Vertex() [3/3]

Vector Mesh::Vertex ( int  t,
int  v 
) const
inline

Get a vertex from a specific triangle.

Parameters
tThe number of the triangle wich contain the wanted vertex.
vThe triangle vertex: 0, 1, or 2.
Returns
The wanted vertex (as a 3D Vector).

◆ Vertexes()

int Mesh::Vertexes ( ) const
inline

Get the number of vertices in the geometry.

Returns
The number of vertices in the geometry, in other words the size of vertices.

◆ VertexIndex()

int Mesh::VertexIndex ( int  t,
int  i 
) const
inline

Get the vertex index of a given triangle.

Parameters
tTriangle index.
iVertex index.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  s,
const Mesh mesh 
)
friend

Overloaded.

Parameters
sStream.
meshThe mesh.