Navigation
API > API/Runtime > API/Runtime/GeometryCore > API/Runtime/GeometryCore/Implicit
References
| Module | GeometryCore |
| Header | /Engine/Source/Runtime/GeometryCore/Public/Implicit/CachingMeshSDF.h |
| Include | #include "Implicit/CachingMeshSDF.h" |
Syntax
template<class TriangleMeshType>
class TCachingMeshSDF
Remarks
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
Variables
| Type | 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. | |
| bool | bComputeSigns | Should we try to compute signs? if not, Grid remains unsigned | |
| bool | bUseParallel | Most of this parallelizes very well, makes a huge speed difference. | |
| bool | 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) | |
| bool | bWantIntersectionsGrid | Grid of per-cell crossing or parity counts. | |
| TFunction< bool(void)> | CancelF | If this function returns true, we should abort calculation | |
| float | CellSize | ||
| FDenseGrid3i | ClosestTriGrid | ||
| FVector3d | ExpandBounds | Bounds of Grid will be expanded this much in positive and negative directions. | |
| FDenseGrid3f | Grid | ||
| FVector3f | GridOrigin | ||
| EInsideModes | InsideMode | ||
| FDenseGrid3i | IntersectionsGrid | ||
| double | MaxDistQueryDist | ||
| float | MaxOffsetDistance | Max distance away from surface that we might need to evaluate | |
| const TriangleMeshType * | Mesh | ||
| const TMeshAABBTree3< TriangleMeshType > * | Spatial | ||
| float | UpperBoundDistance |
Constructors
| Type | Name | Description | |
|---|---|---|---|
TCachingMeshSDF
(
float CellSizeIn |
|||
TCachingMeshSDF
(
const TriangleMeshType* MeshIn, |
Functions
| Type | Name | Description | |
|---|---|---|---|
| float | At
(
int I, |
||
| FVector3f | CellCenter
(
int I, |
||
| void | |||
| FVector3i | Dimensions () |
||
| const FDenseGrid3i & | |||
| const FDenseGrid3f & | GetGrid () |
SDF Grid available after calling Compute() | |
| const FVector3f & | Origin of the SDF Grid, in same coordinates as mesh | ||
| const FDenseGrid3i & | |||
| float | |||
| void | Initialize () |
||
| TTriLinearGridInterpolant< TCachingMeshSDF > | |||
| int | Orientation
(
double X1, |
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) | |
| bool | PointInTriangle2d
(
double X0, |
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. | |
| bool | Validate () |
Operators
| Type | Name | Description | |
|---|---|---|---|
| constexpr const float | operator[]
(
FVector3i Idx |
Enums
| Type | Name | Description | |
|---|---|---|---|
| EInsideModes | What counts as "inside" the mesh. |