Module |
|
Header |
/Engine/Plugins/Experimental/GeometryProcessing/Source/GeometricObjects/Public/Implicit/CachingMeshSDF.h |
Include |
#include "Implicit/CachingMeshSDF.h" |
template<class TriangleMeshType>
class TCachingMeshSDF
This is variant of TSweepingMeshSDF that does lazy evaluation of actual Distances, using mesh spatial data structure. This is much faster if we are doing continuation-method marching cubes as only values on surface will be computed!
Compute discretely-sampled (I.e. gridded) signed distance field for a mesh only within a narrow band of the surface (within MaxDistQueryDist = MaxOffsetDistance + (2 * CellSize * FMathf::Sqrt2))
This code is based on the implementation found at https://github.com/christopherbatty/SDFGen
Name | Description | ||
---|---|---|---|
|
int |
ApproxMaxCellsPerDimension |
If the number of cells in any dimension may exceed this, CellSize will be automatically increased to keep cell count reasonable. |
|
bComputeSigns |
Should we try to compute signs? if not, Grid remains unsigned |
|
|
bUseParallel |
Most of this parallelizes very well, makes a huge speed difference. |
|
|
bWantClosestTriGrid |
Implementation computes the triangle closest to each Grid cell, can return this Grid if desired (only reason not to is avoid hanging onto memory) |
|
|
bWantIntersectionsGrid |
Grid of per-cell crossing or parity counts. |
|
|
CancelF |
If this function returns true, we should abort calculation |
|
|
float |
CellSize |
|
|
ClosestTriGrid |
||
|
ExpandBounds |
Bounds of Grid will be expanded this much in positive and negative directions. |
|
|
Grid |
||
|
GridOrigin |
||
|
InsideMode |
||
|
IntersectionsGrid |
||
|
double |
MaxDistQueryDist |
|
|
float |
MaxOffsetDistance |
Max distance away from surface that we might need to evaluate |
|
const TriangleM... |
Mesh |
|
|
const TMeshAABB... |
Spatial |
|
|
float |
UpperBoundDistance |
Name | Description | |
---|---|---|
|
TCachingMeshSDF ( |
|
|
TCachingMeshSDF ( |
Name | Description | ||
---|---|---|---|
|
float |
At ( |
|
|
CellCenter ( |
||
|
CleanupUnwanted() |
||
|
Dimensions() |
||
|
const FDense... |
GetClosestTriGrid() |
|
|
const FDense... |
GetGrid() |
SDF Grid available after calling Compute() |
|
const FVecto... |
GetGridOrigin() |
Origin of the SDF Grid, in same coordinates as mesh |
|
const FDense... |
GetIntersectionsGrid() |
|
|
float |
GetValue ( |
|
|
Initialize() |
||
|
TTriLinearGr... |
MakeInterpolant() |
|
|
int |
Orientation ( |
Calculate twice signed area of triangle (0,0)-(X1,Y1)-(X2,Y2) return an SOS-determined sign (-1, +1, or 0 only if it's a truly degenerate triangle) |
|
PointInTriangle2d ( |
Robust test of (X0,Y0) in the triangle (X1,Y1)-(X2,Y2)-(X3,Y3) if true is returned, the barycentric coordinates are set in A,B,C. |
|
|
Validate() |
Name | Description | ||
---|---|---|---|
|
constexpr co... |
operator[] ( |
Name |
Description |
|
---|---|---|
|
EInsideModes |
What counts as "inside" the mesh. |