Vuo  2.0.2
Macros | Enumerations | Functions
VuoMeshUtility.cc File Reference

Description

VuoMeshUtility implementation.

Definition in file VuoMeshUtility.cc.

Go to the source code of this file.

Macros

#define PI   3.14159265359f
 Constant providing the ratio of a circle's circumference to its diameter. More...
 

Enumerations

enum  Plane {
  PlaneX, PlaneY, PlaneZ, PlaneNegX,
  PlaneNegY, PlaneNegZ
}
 Defines a direction on the X, Y, or Z axis (and their negated direction). More...
 

Functions

void VuoMeshUtility_calculateNormals (VuoMesh mesh)
 Calculates the normal for each vertex in this mesh. More...
 
bool VuoMeshUtility_bounds (const VuoMesh mesh, VuoPoint3d *min, VuoPoint3d *max)
 Get the bounds of a mesh. More...
 
void VuoMeshUtility_calculateSphericalUVs (VuoMesh mesh)
 Generate UVs by calculating each vertex position as projected onto a bounding sphere. More...
 
Plane VuoMeshUtility_calculateBestPlane (VuoPoint3d normal)
 Returns the plane with the axis most similar to normal. More...
 
static VuoPoint3d VuoMeshUtility_averageNormal (VuoPoint3d a, VuoPoint3d b, VuoPoint3d c)
 Averages the x, y, z components of points a, b, c. More...
 
void VuoMeshUtility_calculateCubicUVs (VuoMesh mesh)
 Generate cubic UVs for this mesh. More...
 
void VuoMeshUtility_calculateCubicUVsPerTriangle (VuoMesh mesh)
 Generate cubic UVs for this mesh, using the triangle normal to project UV instead of vertex normal. More...
 
void VuoMeshUtility_insertSeam (VuoMesh mesh)
 Inserts a seam on a mesh. More...
 
static int compare (const void *lhs, const void *rhs)
 Compare function for triangle ordering qsort in removeUnusedVertices. More...
 
void VuoMeshUtility_removeUnusedVertices (VuoMesh mesh)
 Removes unused vertices from a mesh. More...
 

Macro Definition Documentation

◆ PI

#define PI   3.14159265359f

Constant providing the ratio of a circle's circumference to its diameter.

Definition at line 28 of file VuoMeshUtility.cc.

Enumeration Type Documentation

◆ Plane

enum Plane

Defines a direction on the X, Y, or Z axis (and their negated direction).

Definition at line 226 of file VuoMeshUtility.cc.

Function Documentation

◆ compare()

static int compare ( const void *  lhs,
const void *  rhs 
)
static

Compare function for triangle ordering qsort in removeUnusedVertices.

Definition at line 528 of file VuoMeshUtility.cc.

◆ VuoMeshUtility_averageNormal()

static VuoPoint3d VuoMeshUtility_averageNormal ( VuoPoint3d  a,
VuoPoint3d  b,
VuoPoint3d  c 
)
inlinestatic

Averages the x, y, z components of points a, b, c.

Definition at line 257 of file VuoMeshUtility.cc.

◆ VuoMeshUtility_bounds()

bool VuoMeshUtility_bounds ( const VuoMesh  mesh,
VuoPoint3d *  min,
VuoPoint3d *  max 
)

Get the bounds of a mesh.

Definition at line 130 of file VuoMeshUtility.cc.

◆ VuoMeshUtility_calculateBestPlane()

Plane VuoMeshUtility_calculateBestPlane ( VuoPoint3d  normal)

Returns the plane with the axis most similar to normal.

Ex: { .2, .1, .9 } returns PlaneZ.

Definition at line 239 of file VuoMeshUtility.cc.

◆ VuoMeshUtility_calculateCubicUVs()

void VuoMeshUtility_calculateCubicUVs ( VuoMesh  mesh)

Generate cubic UVs for this mesh.

Works best with IndividualTriangles meshes where no vertex is shared between triangles.

Definition at line 267 of file VuoMeshUtility.cc.

◆ VuoMeshUtility_calculateCubicUVsPerTriangle()

void VuoMeshUtility_calculateCubicUVsPerTriangle ( VuoMesh  mesh)

Generate cubic UVs for this mesh, using the triangle normal to project UV instead of vertex normal.

Definition at line 319 of file VuoMeshUtility.cc.

◆ VuoMeshUtility_calculateNormals()

void VuoMeshUtility_calculateNormals ( VuoMesh  mesh)

Calculates the normal for each vertex in this mesh.

Generate normals for this mesh.

Vertices pointed at by multiple element indices will be averaged.

Definition at line 34 of file VuoMeshUtility.cc.

◆ VuoMeshUtility_calculateSphericalUVs()

void VuoMeshUtility_calculateSphericalUVs ( VuoMesh  mesh)

Generate UVs by calculating each vertex position as projected onto a bounding sphere.

Generate spherical UVs for this mesh.

https://en.wikipedia.org/wiki/UV_mapping

Definition at line 154 of file VuoMeshUtility.cc.

◆ VuoMeshUtility_insertSeam()

void VuoMeshUtility_insertSeam ( VuoMesh  mesh)

Inserts a seam on a mesh.

Inserts a seam along a vertical line on the left side of a mesh.

May (probably will) leave unused vertices.

Definition at line 397 of file VuoMeshUtility.cc.

◆ VuoMeshUtility_removeUnusedVertices()

void VuoMeshUtility_removeUnusedVertices ( VuoMesh  mesh)

Removes unused vertices from a mesh.

Remove unused vertices in a mesh.

Definition at line 536 of file VuoMeshUtility.cc.