GitHub link
Polygon Mesh Processing Library
core

Core data structure and utilities. More...

Classes

class  BoundingBox
 Simple class for representing a bounding box. More...
 
class  InvalidInputException
 Exception indicating invalid input passed to a function. More...
 
class  SolverException
 Exception indicating failure so solve an equation system. More...
 
class  AllocationException
 Exception indicating failure to allocate a new resource. More...
 
class  TopologyException
 Exception indicating a topological error has occurred. More...
 
class  IOException
 Exception indicating an error occurred while performing IO. More...
 
class  Matrix< Scalar, M, N >
 Base class for MxN matrix. More...
 
class  MemoryUsage
 A simple class to retrieve memory usage information. More...
 
class  Handle
 Base class for all entity handles types. More...
 
class  Vertex
 this type represents a vertex (internally it is basically an index) More...
 
class  Halfedge
 this type represents a halfedge (internally it is basically an index) More...
 
class  Edge
 this type represents an edge (internally it is basically an index) More...
 
class  Face
 this type represents a face (internally it is basically an index) More...
 
class  VertexProperty< T >
 Vertex property of type T. More...
 
class  HalfedgeProperty< T >
 Halfedge property of type T. More...
 
class  EdgeProperty< T >
 Edge property of type T. More...
 
class  FaceProperty< T >
 Face property of type T. More...
 
class  ObjectProperty< T >
 Object property of type T. More...
 
class  SurfaceMesh
 A halfedge data structure for polygonal meshes. More...
 
class  Timer
 A simple timer class. More...
 
struct  IOFlags
 Common IO flags for reading and writing. More...
 

Typedefs

template<typename Scalar , int M>
using Vector = Matrix< Scalar, M, 1 >
 template specialization for Vector as Nx1 matrix More...
 
template<typename Scalar >
using Mat4 = Matrix< Scalar, 4, 4 >
 template specialization for 4x4 matrices More...
 
template<typename Scalar >
using Mat3 = Matrix< Scalar, 3, 3 >
 template specialization for 3x3 matrices More...
 
template<typename Scalar >
using Mat2 = Matrix< Scalar, 2, 2 >
 template specialization for 2x2 matrices More...
 
typedef Vector< float, 2 > vec2
 template specialization for a vector of two float values More...
 
typedef Vector< double, 2 > dvec2
 template specialization for a vector of two double values More...
 
typedef Vector< bool, 2 > bvec2
 template specialization for a vector of two bool values More...
 
typedef Vector< int, 2 > ivec2
 template specialization for a vector of two int values More...
 
typedef Vector< unsigned int, 2 > uvec2
 template specialization for a vector of two unsigned int values More...
 
typedef Vector< float, 3 > vec3
 template specialization for a vector of three float values More...
 
typedef Vector< double, 3 > dvec3
 template specialization for a vector of three double values More...
 
typedef Vector< bool, 3 > bvec3
 template specialization for a vector of three bool values More...
 
typedef Vector< int, 3 > ivec3
 template specialization for a vector of three int values More...
 
typedef Vector< unsigned int, 3 > uvec3
 template specialization for a vector of three unsigned int values More...
 
typedef Vector< float, 4 > vec4
 template specialization for a vector of four float values More...
 
typedef Vector< double, 4 > dvec4
 template specialization for a vector of four double values More...
 
typedef Vector< bool, 4 > bvec4
 template specialization for a vector of four bool values More...
 
typedef Vector< int, 4 > ivec4
 template specialization for a vector of four int values More...
 
typedef Vector< unsigned int, 4 > uvec4
 template specialization for a vector of four unsigned int values More...
 
typedef Vector< float, 8 > vec8
 template specialization for a vector of four float values More...
 
typedef Vector< double, 8 > dvec8
 template specialization for a vector of four double values More...
 
typedef Vector< bool, 8 > bvec8
 template specialization for a vector of four bool values More...
 
typedef Vector< int, 8 > ivec8
 template specialization for a vector of four int values More...
 
typedef Vector< unsigned int, 8 > uvec8
 template specialization for a vector of four unsigned int values More...
 
typedef Mat2< float > mat2
 template specialization for a 2x2 matrix of float values More...
 
typedef Mat2< double > dmat2
 template specialization for a 2x2 matrix of double values More...
 
typedef Mat3< float > mat3
 template specialization for a 3x3 matrix of float values More...
 
typedef Mat3< double > dmat3
 template specialization for a 3x3 matrix of double values More...
 
typedef Mat4< float > mat4
 template specialization for a 4x4 matrix of float values More...
 
typedef Mat4< double > dmat4
 template specialization for a 4x4 matrix of double values More...
 
typedef float Scalar
 Scalar type. More...
 
typedef Vector< Scalar, 3 > Point
 Point type. More...
 
typedef Vector< Scalar, 3 > Normal
 Normal type. More...
 
typedef Vector< Scalar, 3 > Color
 Color type. More...
 
typedef Vector< Scalar, 2 > TexCoord
 Texture coordinate type. More...
 

Functions

template<typename Scalar , int M, int N>
std::ostream & operator<< (std::ostream &os, const Matrix< Scalar, M, N > &m)
 output a matrix by printing its space-separated compontens More...
 
template<typename Scalar , int M, int N, int K>
Matrix< Scalar, M, N > operator* (const Matrix< Scalar, M, K > &m1, const Matrix< Scalar, K, N > &m2)
 matrix-matrix multiplication More...
 
template<typename Scalar , int M, int N>
Matrix< Scalar, M, N > cmult (const Matrix< Scalar, M, N > &m1, const Matrix< Scalar, M, N > &m2)
 component-wise multiplication More...
 
template<typename Scalar , int M, int N>
Matrix< Scalar, N, M > transpose (const Matrix< Scalar, M, N > &m)
 transpose MxN matrix to NxM matrix More...
 
template<typename Scalar , int M, int N>
Matrix< Scalar, M, N > operator+ (const Matrix< Scalar, M, N > &m1, const Matrix< Scalar, M, N > &m2)
 matrix addition: m1 + m2 More...
 
template<typename Scalar , int M, int N>
Matrix< Scalar, M, N > operator- (const Matrix< Scalar, M, N > &m1, const Matrix< Scalar, M, N > &m2)
 matrix subtraction: m1 - m2 More...
 
template<typename Scalar , int M, int N>
Matrix< Scalar, M, N > operator- (const Matrix< Scalar, M, N > &m)
 matrix negation: -m More...
 
template<typename Scalar , typename Scalar2 , int M, int N>
Matrix< Scalar, M, N > operator* (const Scalar2 s, const Matrix< Scalar, M, N > &m)
 scalar multiplication of matrix: s*m More...
 
template<typename Scalar , typename Scalar2 , int M, int N>
Matrix< Scalar, M, N > operator* (const Matrix< Scalar, M, N > &m, const Scalar2 s)
 scalar multiplication of matrix: m*s More...
 
template<typename Scalar , typename Scalar2 , int M, int N>
Matrix< Scalar, M, N > operator/ (const Matrix< Scalar, M, N > &m, const Scalar2 s)
 divide matrix by scalar: m/s More...
 
template<typename Scalar , int M, int N>
Scalar norm (const Matrix< Scalar, M, N > &m)
 compute the Frobenius norm of a matrix (or Euclidean norm of a vector) More...
 
template<typename Scalar , int M, int N>
Scalar sqrnorm (const Matrix< Scalar, M, N > &m)
 compute the squared Frobenius norm of a matrix (or squared Euclidean norm of a vector) More...
 
template<typename Scalar , int M, int N>
Matrix< Scalar, M, N > normalize (const Matrix< Scalar, M, N > &m)
 return a normalized copy of a matrix or a vector More...
 
template<typename Scalar , int M, int N>
Matrix< Scalar, M, N > min (const Matrix< Scalar, M, N > &m1, const Matrix< Scalar, M, N > &m2)
 return component-wise minimum More...
 
template<typename Scalar , int M, int N>
Matrix< Scalar, M, N > max (const Matrix< Scalar, M, N > &m1, const Matrix< Scalar, M, N > &m2)
 return component-wise maximum More...
 
template<typename Scalar >
Mat4< Scalarviewport_matrix (Scalar l, Scalar b, Scalar w, Scalar h)
 OpenGL viewport matrix with parameters left, bottom, width, height. More...
 
template<typename Scalar >
Mat4< Scalarinverse_viewport_matrix (Scalar l, Scalar b, Scalar w, Scalar h)
 inverse of OpenGL viewport matrix with parameters left, bottom, width, height More...
 
template<typename Scalar >
Mat4< Scalarfrustum_matrix (Scalar l, Scalar r, Scalar b, Scalar t, Scalar n, Scalar f)
 OpenGL frustum matrix with parameters left, right, bottom, top, near, far. More...
 
template<typename Scalar >
Mat4< Scalarinverse_frustum_matrix (Scalar l, Scalar r, Scalar b, Scalar t, Scalar n, Scalar f)
 inverse of OpenGL frustum matrix with parameters left, right, bottom, top, near, far More...
 
template<typename Scalar >
Mat4< Scalarperspective_matrix (Scalar fovy, Scalar aspect, Scalar zNear, Scalar zFar)
 OpenGL perspective matrix with parameters field of view in y-direction, aspect ratio, and distance of near and far planes. More...
 
template<typename Scalar >
Mat4< Scalarinverse_perspective_matrix (Scalar fovy, Scalar aspect, Scalar zNear, Scalar zFar)
 inverse of perspective matrix More...
 
template<typename Scalar >
Mat4< Scalarortho_matrix (Scalar left, Scalar right, Scalar bottom, Scalar top, Scalar zNear=-1, Scalar zFar=1)
 OpenGL orthogonal projection matrix with parameters left, right, bottom, top, near, far. More...
 
template<typename Scalar >
Mat4< Scalarlook_at_matrix (const Vector< Scalar, 3 > &eye, const Vector< Scalar, 3 > &center, const Vector< Scalar, 3 > &up)
 OpenGL look-at camera matrix with parameters eye position, scene center, up-direction. More...
 
template<typename Scalar >
Mat4< Scalartranslation_matrix (const Vector< Scalar, 3 > &t)
 OpenGL matrix for translation by vector t. More...
 
template<typename Scalar >
Mat4< Scalarscaling_matrix (const Scalar s)
 OpenGL matrix for scaling x/y/z by s. More...
 
template<typename Scalar >
Mat4< Scalarscaling_matrix (const Vector< Scalar, 3 > &s)
 OpenGL matrix for scaling x/y/z by the components of s. More...
 
template<typename Scalar >
Mat4< Scalarrotation_matrix_x (Scalar angle)
 OpenGL matrix for rotation around x-axis by given angle (in degrees) More...
 
template<typename Scalar >
Mat4< Scalarrotation_matrix_y (Scalar angle)
 OpenGL matrix for rotation around y-axis by given angle (in degrees) More...
 
template<typename Scalar >
Mat4< Scalarrotation_matrix_z (Scalar angle)
 OpenGL matrix for rotation around z-axis by given angle (in degrees) More...
 
template<typename Scalar >
Mat4< Scalarrotation_matrix (const Vector< Scalar, 3 > &axis, Scalar angle)
 OpenGL matrix for rotation around given axis by given angle (in degrees) More...
 
template<typename Scalar >
Mat4< Scalarrotation_matrix (const Vector< Scalar, 4 > &quat)
 OpenGL matrix for rotation specified by unit quaternion. More...
 
template<typename Scalar >
Mat3< Scalarlinear_part (const Mat4< Scalar > &m)
 return upper 3x3 matrix from given 4x4 matrix, corresponding to the linear part of an affine transformation More...
 
template<typename Scalar >
Vector< Scalar, 3 > projective_transform (const Mat4< Scalar > &m, const Vector< Scalar, 3 > &v)
 projective transformation of 3D vector v by a 4x4 matrix m: add 1 as 4th component of v, multiply m*v, divide by 4th component More...
 
template<typename Scalar >
Vector< Scalar, 3 > affine_transform (const Mat4< Scalar > &m, const Vector< Scalar, 3 > &v)
 affine transformation of 3D vector v by a 4x4 matrix m: add 1 as 4th component of v, multiply m*v, do NOT divide by 4th component More...
 
template<typename Scalar >
Vector< Scalar, 3 > linear_transform (const Mat4< Scalar > &m, const Vector< Scalar, 3 > &v)
 linear transformation of 3D vector v by a 4x4 matrix m: transform vector by upper-left 3x3 submatrix of m More...
 
template<typename Scalar >
Mat4< Scalarinverse (const Mat4< Scalar > &m)
 return the inverse of a 4x4 matrix More...
 
template<typename Scalar >
Scalar determinant (const Mat3< Scalar > &m)
 return determinant of 3x3 matrix More...
 
template<typename Scalar >
Mat3< Scalarinverse (const Mat3< Scalar > &m)
 return the inverse of a 3x3 matrix More...
 
template<typename Scalar >
bool symmetric_eigendecomposition (const Mat3< Scalar > &m, Scalar &eval1, Scalar &eval2, Scalar &eval3, Vector< Scalar, 3 > &evec1, Vector< Scalar, 3 > &evec2, Vector< Scalar, 3 > &evec3)
 compute eigenvector/eigenvalue decomposition of a 3x3 matrix More...
 
template<typename Scalar , int N>
std::istream & operator>> (std::istream &is, Vector< Scalar, N > &vec)
 read the space-separated components of a vector from a stream More...
 
template<typename Scalar , int N>
std::ostream & operator<< (std::ostream &os, const Vector< Scalar, N > &vec)
 output a vector by printing its space-separated compontens More...
 
template<typename Scalar , int N>
Scalar dot (const Vector< Scalar, N > &v0, const Vector< Scalar, N > &v1)
 compute the dot product of two vectors More...
 
template<typename Scalar , int N>
Scalar distance (const Vector< Scalar, N > &v0, const Vector< Scalar, N > &v1)
 compute the Euclidean distance between two points More...
 
template<typename Scalar >
Vector< Scalar, 2 > perp (const Vector< Scalar, 2 > &v)
 compute perpendicular vector (rotate vector counter-clockwise by 90 degrees) More...
 
template<typename Scalar >
Vector< Scalar, 3 > cross (const Vector< Scalar, 3 > &v0, const Vector< Scalar, 3 > &v1)
 compute the cross product of two vectors (only valid for 3D vectors) More...
 
std::ostream & operator<< (std::ostream &os, Vertex v)
 output a Vertex to a stream More...
 
std::ostream & operator<< (std::ostream &os, Halfedge h)
 output a Halfedge to a stream More...
 
std::ostream & operator<< (std::ostream &os, Edge e)
 output an Edge to a stream More...
 
std::ostream & operator<< (std::ostream &os, Face f)
 output a Face to a stream More...
 
static Matrix< Scalar, M, N > identity ()
 return identity matrix (only for square matrices, N==M) More...
 

Detailed Description

Core data structure and utilities.

Typedef Documentation

◆ bvec2

typedef Vector<bool, 2> bvec2

template specialization for a vector of two bool values

◆ bvec3

typedef Vector<bool, 3> bvec3

template specialization for a vector of three bool values

◆ bvec4

typedef Vector<bool, 4> bvec4

template specialization for a vector of four bool values

◆ bvec8

typedef Vector<bool, 8> bvec8

template specialization for a vector of four bool values

◆ Color

typedef Vector<Scalar, 3> Color

Color type.

◆ dmat2

typedef Mat2<double> dmat2

template specialization for a 2x2 matrix of double values

◆ dmat3

typedef Mat3<double> dmat3

template specialization for a 3x3 matrix of double values

◆ dmat4

typedef Mat4<double> dmat4

template specialization for a 4x4 matrix of double values

◆ dvec2

typedef Vector<double, 2> dvec2

template specialization for a vector of two double values

◆ dvec3

typedef Vector<double, 3> dvec3

template specialization for a vector of three double values

◆ dvec4

typedef Vector<double, 4> dvec4

template specialization for a vector of four double values

◆ dvec8

typedef Vector<double, 8> dvec8

template specialization for a vector of four double values

◆ ivec2

typedef Vector<int, 2> ivec2

template specialization for a vector of two int values

◆ ivec3

typedef Vector<int, 3> ivec3

template specialization for a vector of three int values

◆ ivec4

typedef Vector<int, 4> ivec4

template specialization for a vector of four int values

◆ ivec8

typedef Vector<int, 8> ivec8

template specialization for a vector of four int values

◆ Mat2

using Mat2 = Matrix<Scalar, 2, 2>

template specialization for 2x2 matrices

◆ mat2

typedef Mat2<float> mat2

template specialization for a 2x2 matrix of float values

◆ Mat3

using Mat3 = Matrix<Scalar, 3, 3>

template specialization for 3x3 matrices

◆ mat3

typedef Mat3<float> mat3

template specialization for a 3x3 matrix of float values

◆ Mat4

using Mat4 = Matrix<Scalar, 4, 4>

template specialization for 4x4 matrices

◆ mat4

typedef Mat4<float> mat4

template specialization for a 4x4 matrix of float values

◆ Normal

typedef Vector<Scalar, 3> Normal

Normal type.

◆ Point

typedef Vector<Scalar, 3> Point

Point type.

◆ Scalar

typedef float Scalar

Scalar type.

◆ TexCoord

typedef Vector<Scalar, 2> TexCoord

Texture coordinate type.

◆ uvec2

typedef Vector<unsigned int, 2> uvec2

template specialization for a vector of two unsigned int values

◆ uvec3

typedef Vector<unsigned int, 3> uvec3

template specialization for a vector of three unsigned int values

◆ uvec4

typedef Vector<unsigned int, 4> uvec4

template specialization for a vector of four unsigned int values

◆ uvec8

typedef Vector<unsigned int, 8> uvec8

template specialization for a vector of four unsigned int values

◆ vec2

typedef Vector<float, 2> vec2

template specialization for a vector of two float values

◆ vec3

typedef Vector<float, 3> vec3

template specialization for a vector of three float values

◆ vec4

typedef Vector<float, 4> vec4

template specialization for a vector of four float values

◆ vec8

typedef Vector<float, 8> vec8

template specialization for a vector of four float values

◆ Vector

using Vector = Matrix<Scalar, M, 1>

template specialization for Vector as Nx1 matrix

Function Documentation

◆ affine_transform()

Vector< Scalar, 3 > pmp::affine_transform ( const Mat4< Scalar > &  m,
const Vector< Scalar, 3 > &  v 
)

affine transformation of 3D vector v by a 4x4 matrix m: add 1 as 4th component of v, multiply m*v, do NOT divide by 4th component

◆ cmult()

Matrix< Scalar, M, N > pmp::cmult ( const Matrix< Scalar, M, N > &  m1,
const Matrix< Scalar, M, N > &  m2 
)

component-wise multiplication

◆ cross()

Vector< Scalar, 3 > pmp::cross ( const Vector< Scalar, 3 > &  v0,
const Vector< Scalar, 3 > &  v1 
)
inline

compute the cross product of two vectors (only valid for 3D vectors)

◆ determinant()

Scalar pmp::determinant ( const Mat3< Scalar > &  m)

return determinant of 3x3 matrix

◆ distance()

Scalar pmp::distance ( const Vector< Scalar, N > &  v0,
const Vector< Scalar, N > &  v1 
)
inline

compute the Euclidean distance between two points

◆ dot()

Scalar pmp::dot ( const Vector< Scalar, N > &  v0,
const Vector< Scalar, N > &  v1 
)
inline

compute the dot product of two vectors

◆ frustum_matrix()

Mat4< Scalar > pmp::frustum_matrix ( Scalar  l,
Scalar  r,
Scalar  b,
Scalar  t,
Scalar  n,
Scalar  f 
)

OpenGL frustum matrix with parameters left, right, bottom, top, near, far.

◆ identity()

Matrix< Scalar, M, N > identity
static

return identity matrix (only for square matrices, N==M)

identity matrix (work only for square matrices)

◆ inverse() [1/2]

Mat3< Scalar > pmp::inverse ( const Mat3< Scalar > &  m)

return the inverse of a 3x3 matrix

◆ inverse() [2/2]

Mat4< Scalar > pmp::inverse ( const Mat4< Scalar > &  m)

return the inverse of a 4x4 matrix

◆ inverse_frustum_matrix()

Mat4< Scalar > pmp::inverse_frustum_matrix ( Scalar  l,
Scalar  r,
Scalar  b,
Scalar  t,
Scalar  n,
Scalar  f 
)

inverse of OpenGL frustum matrix with parameters left, right, bottom, top, near, far

See also
frustum_matrix

◆ inverse_perspective_matrix()

Mat4< Scalar > pmp::inverse_perspective_matrix ( Scalar  fovy,
Scalar  aspect,
Scalar  zNear,
Scalar  zFar 
)

inverse of perspective matrix

See also
perspective_matrix

◆ inverse_viewport_matrix()

Mat4< Scalar > pmp::inverse_viewport_matrix ( Scalar  l,
Scalar  b,
Scalar  w,
Scalar  h 
)

inverse of OpenGL viewport matrix with parameters left, bottom, width, height

See also
viewport_matrix

◆ linear_part()

Mat3< Scalar > pmp::linear_part ( const Mat4< Scalar > &  m)

return upper 3x3 matrix from given 4x4 matrix, corresponding to the linear part of an affine transformation

◆ linear_transform()

Vector< Scalar, 3 > pmp::linear_transform ( const Mat4< Scalar > &  m,
const Vector< Scalar, 3 > &  v 
)

linear transformation of 3D vector v by a 4x4 matrix m: transform vector by upper-left 3x3 submatrix of m

◆ look_at_matrix()

Mat4< Scalar > pmp::look_at_matrix ( const Vector< Scalar, 3 > &  eye,
const Vector< Scalar, 3 > &  center,
const Vector< Scalar, 3 > &  up 
)

OpenGL look-at camera matrix with parameters eye position, scene center, up-direction.

◆ max()

Matrix< Scalar, M, N > pmp::max ( const Matrix< Scalar, M, N > &  m1,
const Matrix< Scalar, M, N > &  m2 
)
inline

return component-wise maximum

◆ min()

Matrix< Scalar, M, N > pmp::min ( const Matrix< Scalar, M, N > &  m1,
const Matrix< Scalar, M, N > &  m2 
)
inline

return component-wise minimum

◆ norm()

Scalar pmp::norm ( const Matrix< Scalar, M, N > &  m)
inline

compute the Frobenius norm of a matrix (or Euclidean norm of a vector)

◆ normalize()

Matrix< Scalar, M, N > pmp::normalize ( const Matrix< Scalar, M, N > &  m)
inline

return a normalized copy of a matrix or a vector

◆ operator*() [1/3]

Matrix< Scalar, M, N > pmp::operator* ( const Matrix< Scalar, M, K > &  m1,
const Matrix< Scalar, K, N > &  m2 
)

matrix-matrix multiplication

◆ operator*() [2/3]

Matrix< Scalar, M, N > pmp::operator* ( const Matrix< Scalar, M, N > &  m,
const Scalar2  s 
)
inline

scalar multiplication of matrix: m*s

◆ operator*() [3/3]

Matrix< Scalar, M, N > pmp::operator* ( const Scalar2  s,
const Matrix< Scalar, M, N > &  m 
)
inline

scalar multiplication of matrix: s*m

◆ operator+()

Matrix< Scalar, M, N > pmp::operator+ ( const Matrix< Scalar, M, N > &  m1,
const Matrix< Scalar, M, N > &  m2 
)
inline

matrix addition: m1 + m2

◆ operator-() [1/2]

Matrix< Scalar, M, N > pmp::operator- ( const Matrix< Scalar, M, N > &  m)
inline

matrix negation: -m

◆ operator-() [2/2]

Matrix< Scalar, M, N > pmp::operator- ( const Matrix< Scalar, M, N > &  m1,
const Matrix< Scalar, M, N > &  m2 
)
inline

matrix subtraction: m1 - m2

◆ operator/()

Matrix< Scalar, M, N > pmp::operator/ ( const Matrix< Scalar, M, N > &  m,
const Scalar2  s 
)
inline

divide matrix by scalar: m/s

◆ operator<<() [1/6]

std::ostream & pmp::operator<< ( std::ostream &  os,
const Matrix< Scalar, M, N > &  m 
)
inline

output a matrix by printing its space-separated compontens

◆ operator<<() [2/6]

std::ostream & pmp::operator<< ( std::ostream &  os,
const Vector< Scalar, N > &  vec 
)
inline

output a vector by printing its space-separated compontens

◆ operator<<() [3/6]

std::ostream & pmp::operator<< ( std::ostream &  os,
Edge  e 
)
inline

output an Edge to a stream

◆ operator<<() [4/6]

std::ostream & pmp::operator<< ( std::ostream &  os,
Face  f 
)
inline

output a Face to a stream

◆ operator<<() [5/6]

std::ostream & pmp::operator<< ( std::ostream &  os,
Halfedge  h 
)
inline

output a Halfedge to a stream

◆ operator<<() [6/6]

std::ostream & pmp::operator<< ( std::ostream &  os,
Vertex  v 
)
inline

output a Vertex to a stream

◆ operator>>()

std::istream & pmp::operator>> ( std::istream &  is,
Vector< Scalar, N > &  vec 
)
inline

read the space-separated components of a vector from a stream

◆ ortho_matrix()

Mat4< Scalar > pmp::ortho_matrix ( Scalar  left,
Scalar  right,
Scalar  bottom,
Scalar  top,
Scalar  zNear = -1,
Scalar  zFar = 1 
)

OpenGL orthogonal projection matrix with parameters left, right, bottom, top, near, far.

◆ perp()

Vector< Scalar, 2 > pmp::perp ( const Vector< Scalar, 2 > &  v)
inline

compute perpendicular vector (rotate vector counter-clockwise by 90 degrees)

◆ perspective_matrix()

Mat4< Scalar > pmp::perspective_matrix ( Scalar  fovy,
Scalar  aspect,
Scalar  zNear,
Scalar  zFar 
)

OpenGL perspective matrix with parameters field of view in y-direction, aspect ratio, and distance of near and far planes.

◆ projective_transform()

Vector< Scalar, 3 > pmp::projective_transform ( const Mat4< Scalar > &  m,
const Vector< Scalar, 3 > &  v 
)

projective transformation of 3D vector v by a 4x4 matrix m: add 1 as 4th component of v, multiply m*v, divide by 4th component

◆ rotation_matrix() [1/2]

Mat4< Scalar > pmp::rotation_matrix ( const Vector< Scalar, 3 > &  axis,
Scalar  angle 
)

OpenGL matrix for rotation around given axis by given angle (in degrees)

◆ rotation_matrix() [2/2]

Mat4< Scalar > pmp::rotation_matrix ( const Vector< Scalar, 4 > &  quat)

OpenGL matrix for rotation specified by unit quaternion.

◆ rotation_matrix_x()

Mat4< Scalar > pmp::rotation_matrix_x ( Scalar  angle)

OpenGL matrix for rotation around x-axis by given angle (in degrees)

◆ rotation_matrix_y()

Mat4< Scalar > pmp::rotation_matrix_y ( Scalar  angle)

OpenGL matrix for rotation around y-axis by given angle (in degrees)

◆ rotation_matrix_z()

Mat4< Scalar > pmp::rotation_matrix_z ( Scalar  angle)

OpenGL matrix for rotation around z-axis by given angle (in degrees)

◆ scaling_matrix() [1/2]

Mat4< Scalar > pmp::scaling_matrix ( const Scalar  s)

OpenGL matrix for scaling x/y/z by s.

◆ scaling_matrix() [2/2]

Mat4< Scalar > pmp::scaling_matrix ( const Vector< Scalar, 3 > &  s)

OpenGL matrix for scaling x/y/z by the components of s.

◆ sqrnorm()

Scalar pmp::sqrnorm ( const Matrix< Scalar, M, N > &  m)
inline

compute the squared Frobenius norm of a matrix (or squared Euclidean norm of a vector)

◆ symmetric_eigendecomposition()

bool pmp::symmetric_eigendecomposition ( const Mat3< Scalar > &  m,
Scalar eval1,
Scalar eval2,
Scalar eval3,
Vector< Scalar, 3 > &  evec1,
Vector< Scalar, 3 > &  evec2,
Vector< Scalar, 3 > &  evec3 
)

compute eigenvector/eigenvalue decomposition of a 3x3 matrix

◆ translation_matrix()

Mat4< Scalar > pmp::translation_matrix ( const Vector< Scalar, 3 > &  t)

OpenGL matrix for translation by vector t.

◆ transpose()

Matrix< Scalar, N, M > pmp::transpose ( const Matrix< Scalar, M, N > &  m)

transpose MxN matrix to NxM matrix

◆ viewport_matrix()

Mat4< Scalar > pmp::viewport_matrix ( Scalar  l,
Scalar  b,
Scalar  w,
Scalar  h 
)

OpenGL viewport matrix with parameters left, bottom, width, height.