Skip to main content

Post-processing tools 2023 R2

ANSYS::Nexus::GLTFWriter::Utils Namespace Reference

Last update: 17.04.2023

Set of functions and classes that perform often required tasks. More...

Classes

class  Repack
 Manages repacking of indices from unsigned int type to unsigned short type. This only works for POINTS, LINES, or TRIANGLES. More...
 

Functions

void ComputeElementNormals3 (const unsigned int numVertices, const float *vertices, const unsigned int numElements, const unsigned int elementSize, const unsigned short *indices, float *normals)
 
void ComputeElementNormals3 (const unsigned int numVertices, const float *vertices, const unsigned int numElements, const unsigned int elementSize, const unsigned int *indices, float *normals)
 
void ComputeVertexNormals3 (const unsigned int numVertices, const float *vertices, const unsigned int numElements, const unsigned int elementSize, const unsigned short *indices, float *normals)
 
void ComputeVertexNormals3 (const unsigned int numVertices, const float *vertices, const unsigned int numElements, const unsigned int elementSize, const unsigned int *indices, float *normals)
 

Detailed Description

Set of functions and classes that perform often required tasks.

Function Documentation

◆ ComputeElementNormals3() [1/2]

void ANSYS::Nexus::GLTFWriter::Utils::ComputeElementNormals3 ( const unsigned int  numVertices,
const float *  vertices,
const unsigned int  numElements,
const unsigned int  elementSize,
const unsigned int *  indices,
float *  normals 
)

Computes XYZ element normals from vertices and elements. unsigned int and unsigned short indices are supported.

Parameters
[in]numVerticesNumber of vertices.
[in]verticesXYZ vertex data.
[in]numElementsNumber of elements.
[in]elementSizeNumber of vertices in element.
[in]indicesVertex indices of element.
[in]normalsMemory into which element normals are inserted. This is preallocated to a size of 3 * numVertices floats.

◆ ComputeElementNormals3() [2/2]

void ANSYS::Nexus::GLTFWriter::Utils::ComputeElementNormals3 ( const unsigned int  numVertices,
const float *  vertices,
const unsigned int  numElements,
const unsigned int  elementSize,
const unsigned short *  indices,
float *  normals 
)

Computes XYZ element normals from vertices and elements. unsigned int and unsigned short indices are supported.

Parameters
[in]numVerticesNumber of vertices.
[in]verticesXYZ vertex data.
[in]numElementsNumber of elements.
[in]elementSizeNumber of vertices in element.
[in]indicesVertex indices of element.
[in]normalsMemory into which element normals are inserted. This is preallocated to a size of 3 * numVertices floats.

◆ ComputeVertexNormals3() [1/2]

void ANSYS::Nexus::GLTFWriter::Utils::ComputeVertexNormals3 ( const unsigned int  numVertices,
const float *  vertices,
const unsigned int  numElements,
const unsigned int  elementSize,
const unsigned int *  indices,
float *  normals 
)

Computes XYZ vertex normals from vertices and elements. The element normals for all elements adjacent to a vertex are combined to get the vertex normal. unsigned int and unsigned short indices are supported.

Parameters
[in]numVerticesNumber of vertices.
[in]verticesXYZ vertex data.
[in]numElementsNumber of elements.
[in]elementSizeNumber of vertices in element.
[in]indicesVertex indices of element.
[in]normalsMemory into which vertex normals are inserted. This is preallocated to a size of 3 * numElements floats.

◆ ComputeVertexNormals3() [2/2]

void ANSYS::Nexus::GLTFWriter::Utils::ComputeVertexNormals3 ( const unsigned int  numVertices,
const float *  vertices,
const unsigned int  numElements,
const unsigned int  elementSize,
const unsigned short *  indices,
float *  normals 
)

Computes XYZ vertex normals from vertices and elements. The element normals for all elements adjacent to a vertex are combined to get the vertex normal. unsigned int and unsigned short indices are supported.

Parameters
[in]numVerticesNumber of vertices.
[in]verticesXYZ vertex data.
[in]numElementsNumber of elements.
[in]elementSizeNumber of vertices in element.
[in]indicesVertex indices of element.
[in]normalsMemory into which vertex normals are inserted. This is preallocated to a size of 3 * numElements floats.
Examples
Test002.cpp, Test005.cpp, and Test010.cpp.