PxRemeshingExt

Defined in include/extensions/PxRemeshingExt.h

class PxRemeshingExt

Provides methods to adjust the tessellation of meshes.

Public Static Functions

static bool limitMaxEdgeLength(PxArray<PxU32> &triangles, PxArray<PxVec3> &points, PxReal maxEdgeLength, PxU32 maxIterations = 100, PxArray<PxU32> *triangleMap = NULL, PxU32 triangleCountThreshold = 0xFFFFFFFF)

Processes a triangle mesh and makes sure that no triangle edge is longer than the maximal edge length specified.

To shorten edges that are too long, additional points get inserted at their center leading to a subdivision of the input mesh. This process is executed repeatedly until the maximum edge length criterion is satisfied

Parameters
  • triangles[inout] The triangles of the mesh where a maximum edge length should be enforced. They will be modified in place during the process.

  • points[inout] The vertices of the mesh where a maximum edge length should be enforced. They will be modified in place during the process.

  • maxEdgeLength[in] The maximum edge length allowed after processing the input

  • maxIterations[in] The maximum number of subdivision iterations

  • triangleMap[out] An optional map that provides the index of the original triangle for every triangle after the subdivision

  • triangleCountThreshold[in] Optional limit to the number of triangles. Not guaranteed to match exactly, the algorithm will just stop as soon as possible after reaching the limit.

Returns

True if any remeshing was applied

static bool reduceSliverTriangles(PxArray<PxU32> &triangles, PxArray<PxVec3> &points, PxReal maxEdgeLength, PxU32 maxIterations = 3, PxArray<PxU32> *triangleMap = NULL, PxU32 triangleCountThreshold = 0xFFFFFFFF)

Processes a triangle mesh and makes sure that no triangle edge is longer than the maximal edge length specified.

To shorten edges that are too long, additional points get inserted at their center leading to a subdivision of the input mesh. This process is executed repeatedly until the maximum edge length criterion is satisfied

Parameters
  • triangles[inout] The triangles of the mesh where a maximum edge length should be enforced. They will be modified in place during the process.

  • points[inout] The vertices of the mesh where a maximum edge length should be enforced. They will be modified in place during the process.

  • maxEdgeLength[in] The maximum edge length allowed after processing the input

  • maxIterations[in] The maximum number of subdivision iterations

  • triangleMap[out] An optional map that provides the index of the original triangle for every triangle after the subdivision

  • triangleCountThreshold[in] Optional limit to the number of triangles. Not guaranteed to match exactly, the algorithm will just stop as soon as possible after reaching the limit.

Returns

True if any remeshing was applied