SuperDex Physics C++ API
Loading...
Searching...
No Matches
superdex::GridSdfParams Struct Reference

Parameters controlling the resolution of grid-based Signed Distance Fields (SDF). More...

#include <grid_sdf_params.h>

Public Member Functions

bool operator== (GridSdfParams const &) const =default

Public Attributes

real boundaryPaddingDist = kGridSdfDefaultBoundaryPadding
 Additional distance (in meters) to expand the mesh's axis-aligned bounding box (AABB) when determining the SDF grid bounds.
Int3 minGridResolution = {6, 6, 6}
 The minimum grid resolution measured in number of voxels per axis.
Real3 resolutionDelta = {0.25_r, 0.25_r, 0.25_r}
 The maximum voxel size will be resolutionDelta times the reference measurement computed using resolutionMode.
GridSdfResolutionMode resolutionMode = GridSdfResolutionMode::MeanEdge
 Defines the mesh feature used as reference measurement for computing the voxel size.

Detailed Description

Parameters controlling the resolution of grid-based Signed Distance Fields (SDF).

A GridSdf represents the SDF to a closed surface mesh as a 3D grid where each vertex stores the signed distance to the surface mesh. The SDF grid resolution and bounds are controlled by these parameters.

Definition at line 97 of file grid_sdf_params.h.

Member Function Documentation

◆ operator==()

bool superdex::GridSdfParams::operator== ( GridSdfParams const & ) const
default

Member Data Documentation

◆ boundaryPaddingDist

real superdex::GridSdfParams::boundaryPaddingDist = kGridSdfDefaultBoundaryPadding

Additional distance (in meters) to expand the mesh's axis-aligned bounding box (AABB) when determining the SDF grid bounds.

The SDF grid will cover the mesh's AABB expanded by this distance in all directions. This ensures the SDF has valid distance values even slightly outside the mesh's AABB.

Note
In practice, this value should be greater than the value returned by ContactParams::GetPenaltyThresholdDist. If the SDF did not have enough padding, then Mochi would have to use a less efficient algorithm for collision detection, but it would still work.
When you load a model and bake a uniform scale value less than 1.0, the model's pre-computed SDF will also be scaled, resulting in less absolute padding. The default padding value is larger than the default contact penalty threshold distance for this reason.
See also
kGridSdfDefaultBoundaryPadding

Definition at line 138 of file grid_sdf_params.h.

◆ minGridResolution

Int3 superdex::GridSdfParams::minGridResolution = {6, 6, 6}

The minimum grid resolution measured in number of voxels per axis.

Note
This may override the voxel count (and voxel size) computed using resolutionMode and resolutionDelta.

Definition at line 146 of file grid_sdf_params.h.

◆ resolutionDelta

Real3 superdex::GridSdfParams::resolutionDelta = {0.25_r, 0.25_r, 0.25_r}

The maximum voxel size will be resolutionDelta times the reference measurement computed using resolutionMode.

Note
The actual voxel size may be smaller because the number of grid cells will be rounded up to an integer value and clamped to a minimum of minGridResolution.
Increasing resolutionDelta will result in larger voxels. Doing so will make it harder for the SDF to resolve fine details of the mesh, but it will save memory and improve SDF generation speed.
Decreasing resolutionDelta will improve the SDF's ability to resolve fine details, but it will take more memory and more time to generate. This cost scales proportional to N^3. Use with care.
See also
resolutionMode

Definition at line 120 of file grid_sdf_params.h.

◆ resolutionMode

GridSdfResolutionMode superdex::GridSdfParams::resolutionMode = GridSdfResolutionMode::MeanEdge

Defines the mesh feature used as reference measurement for computing the voxel size.

See also
resolutionDelta

Definition at line 103 of file grid_sdf_params.h.


The documentation for this struct was generated from the following file: