HDK
|
#include <meshUtil.h>
Public Member Functions | |
HdMeshEdgeIndexTable (HdMeshTopology const *topology) | |
~HdMeshEdgeIndexTable () | |
bool | GetVerticesForEdgeIndex (int edgeId, GfVec2i *edgeVerticesOut) const |
bool | GetVerticesForEdgeIndices (std::vector< int > const &edgeIndices, std::vector< GfVec2i > *edgeVerticesOut) const |
bool | GetEdgeIndices (GfVec2i const &edgeVertices, std::vector< int > *edgeIndicesOut) const |
Mesh edges are described as a pair of adjacent vertices encoded as GfVec2i.
The encoding of mesh edge indices is derived from the enumeration of face vertex index pairs provided by HdMeshUtil::EnumerateEdges().
This encoding is consistent across triangulation or quadrangulation of the base mesh faces as well as for non-manifold faces on refined subdivision surface meshes.
There can be multiple edge indices associated with each pair of topological vertices in the mesh, e.g. one for each face incident on the edge.
For example, here is a typical edge index assignment for a mesh with 2 quad faces and 6 vertices:
faceVertexCounts: [4, 4] faceVertexIndices: [0, 1, 4, 3, 1, 2, 5, 4]
edgeId:(edgeVertex[0], edgeVertex[1])
2:(3,4) 6:(4,5)
3-------------—4-------------—5 | | |
Face 0 | Face 1 |
---|---|
3:(0,3) 1:(1,4) | 7:(1,4) 5:(2,5) |
0-------------—1-------------—2 0:(0,1) 4:(1,2)
Notice that with this assignment, there are eight edge indices even though the mesh has seven topological edges. The mesh edge between vertex 1 and vertex 4 is associated with two edgeIds (1 and 7), one for each incident face.
This kind of edge index assignment can be implemented efficiently on the GPU since it falls out automatically from the primitive drawing order and requires minimal additional GPU data.
Definition at line 312 of file meshUtil.h.
|
explicit |
HdMeshEdgeIndexTable::~HdMeshEdgeIndexTable | ( | ) |
bool HdMeshEdgeIndexTable::GetEdgeIndices | ( | GfVec2i const & | edgeVertices, |
std::vector< int > * | edgeIndicesOut | ||
) | const |
bool HdMeshEdgeIndexTable::GetVerticesForEdgeIndices | ( | std::vector< int > const & | edgeIndices, |
std::vector< GfVec2i > * | edgeVerticesOut | ||
) | const |