Euclid
Geometry Processing and Shape Analysis in C++
Input Fixer

Input fixer. More...

Functions

template<typename T >
size_t Euclid::remove_duplicate_vertices (std::vector< T > &positions)
 Remove duplicate vertices. More...
 
template<int N, typename T1 , typename T2 >
size_t Euclid::remove_duplicate_vertices (std::vector< T1 > &positions, std::vector< T2 > &indices)
 Remove duplicate vertices and fix indices. More...
 
template<int N, typename T >
size_t Euclid::remove_duplicate_faces (std::vector< T > &indices)
 Remove duplicate faces of a mesh. More...
 
template<int N, typename T1 , typename T2 >
size_t Euclid::remove_unreferenced_vertices (std::vector< T1 > &positions, std::vector< T2 > &indices)
 Remove unreferenced vertices and fix indices. More...
 
template<int N, typename T1 , typename T2 >
size_t Euclid::remove_degenerate_faces (const std::vector< T1 > &positions, std::vector< T2 > &indices)
 Remove degenerate faces of a mesh. More...
 

Detailed Description

There is no quality assurance for 3D contents in the wild. This package provides some utilities to detect and fix some types of degeneracies.

Function Documentation

template<int N, typename T1 , typename T2 >
size_t Euclid::remove_degenerate_faces ( const std::vector< T1 > &  positions,
std::vector< T2 > &  indices 
)

A face is degenerate when two consecutive edges are collinear.

Parameters
positionsA vector of point positions.
indicesA vector of point indices.
Returns
Number of degenerate faces.
template<int N, typename T >
size_t Euclid::remove_duplicate_faces ( std::vector< T > &  indices)
Parameters
indicesA vector point indices.
Returns
Number of duplicate faces.
template<typename T >
size_t Euclid::remove_duplicate_vertices ( std::vector< T > &  positions)
Parameters
positionsA vector of point positions.
Returns
Number of duplicate vertices.

Note

If you want to remove duplicate vertices of a mesh, use the other overload to fix indices.

template<int N, typename T1 , typename T2 >
size_t Euclid::remove_duplicate_vertices ( std::vector< T1 > &  positions,
std::vector< T2 > &  indices 
)
Parameters
positionsA vector of point positions.
indicesA vector of point indices.
Returns
Number of duplicate vertices.
template<int N, typename T1 , typename T2 >
size_t Euclid::remove_unreferenced_vertices ( std::vector< T1 > &  positions,
std::vector< T2 > &  indices 
)
Parameters
positionsA vector of point positions.
indicesA vector of point indices.
Returns
Number of unreferenced vertices.