Navigation
API > API/Runtime > API/Runtime/GeometryCore
| Name | FMarchingCubes |
| Type | class |
| Header File | /Engine/Source/Runtime/GeometryCore/Public/Generators/MarchingCubes.h |
| Include Path | #include "Generators/MarchingCubes.h" |
Syntax
class FMarchingCubes : public UE::Geometry::FMeshShapeGenerator
Inheritance Hierarchy
- FMeshShapeGenerator → FMarchingCubes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMarchingCubes() |
Generators/MarchingCubes.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FMarchingCubes() |
Generators/MarchingCubes.h |
Structs
| Name | Remarks |
|---|---|
| FGridCell | We pass Cells around, this makes code cleaner |
| FIndexedVertex |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| EdgeIndices | int | Below here are standard marching-cubes tables. | Generators/MarchingCubes.h |
| EdgeTable | int | Generators/MarchingCubes.h | |
| TriTable | int | Generators/MarchingCubes.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bEnableValueCaching | bool | If true, code will assume that Implicit() is expensive enough that it is worth it to cache evaluations when possible. | Generators/MarchingCubes.h | |
| Bounds | TAxisAlignedBox3< double > | Bounding-box we will mesh inside of. | Generators/MarchingCubes.h | |
| bParallelCompute | bool | Use multi-threading? Generally a good idea unless problem is very small or you are multi-threading at a higher level (which may be more efficient) | Generators/MarchingCubes.h | |
| CancelF | TFunction< bool(void)> | If this function returns true, we should abort calculation | Generators/MarchingCubes.h | |
| CellDimensions | FVector3i | Cube indices range from [Origin,CellDimensions) | Generators/MarchingCubes.h | |
| CubeSize | double | Length of edges of cubes that are marching. | Generators/MarchingCubes.h | |
| Implicit | TFunction< double(TVector< double >)> | This is the function we will evaluate | Generators/MarchingCubes.h | |
| IsoValue | double | Mesh surface will be at this isovalue. | Generators/MarchingCubes.h | |
| RootMode | ERootfindingModes | Which rootfinding method will be used to converge on surface along edges | Generators/MarchingCubes.h | |
| RootModeSteps | int | Number of iterations of rootfinding method (ignored for SingleLerp) | Generators/MarchingCubes.h | |
| SafetyMaxDimension | int | Max number of cells on any dimension; if exceeded, CubeSize will be automatically increased to fix | Generators/MarchingCubes.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMeshShapeGenerator & GenerateContinuation
(
TArrayView< const FVector3d > Seeds |
Generators/MarchingCubes.h | ||
bool Validate() |
Generators/MarchingCubes.h |
Overridden from FMeshShapeGenerator
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FMeshShapeGenerator & Generate() |
Run MC algorithm and generate Output mesh | Generators/MarchingCubes.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void append_triangle
(
int A, |
Add triangle to mesh, with locking if we are computing in parallel | Generators/MarchingCubes.h | |
int append_vertex
(
TVector< double > V, |
Add vertex to mesh, with locking if we are computing in parallel | Generators/MarchingCubes.h | |
int AppendOrFindVertexID
(
int64 hash, |
Generators/MarchingCubes.h | ||
void BuildMesh() |
Populate FMeshShapeGenerator data structures from accumulated vertex/triangle sets | Generators/MarchingCubes.h | |
| Generators/MarchingCubes.h | |||
int64 corner_hash
(
int X, |
Generators/MarchingCubes.h | ||
int64 corner_hash
(
const FVector3i& Idx |
Corner and edge hash functions, these pack the coordinate integers into 16-bits, so max of 65536 in any dimension. | Generators/MarchingCubes.h | |
TVector< double > corner_pos
(
const FVector3i& IJK |
Generators/MarchingCubes.h | ||
void corner_pos
(
const FVector3i& IJK, |
Generators/MarchingCubes.h | ||
double corner_value_grid
(
const FVector3i& Idx |
Generators/MarchingCubes.h | ||
double corner_value_grid_parallel
(
const FVector3i& Idx |
Generators/MarchingCubes.h | ||
double corner_value_nohash
(
const FVector3i& Idx |
Explicitly compute corner values as necessary | Generators/MarchingCubes.h | |
| Generators/MarchingCubes.h | |||
| Generators/MarchingCubes.h | |||
| Root-find the intersection along edge from f(P1)=ValP1 to f(P2)=ValP2 | Generators/MarchingCubes.h | ||
int FindVertexID
(
int64 hash |
Generators/MarchingCubes.h | ||
void generate_basic() |
Fully sequential version, no threading | Generators/MarchingCubes.h | |
void generate_continuation
(
TArrayView< const FVector3d > Seeds |
Fully sequential version, no threading | Generators/MarchingCubes.h | |
void generate_continuation_parallel
(
TArrayView< const FVector3d > Seeds |
Parallel seed evaluation | Generators/MarchingCubes.h | |
void generate_parallel() |
Processing z-slabs of cells in parallel | Generators/MarchingCubes.h | |
int GetTriangleSectionIndex
(
int64 hash |
Generators/MarchingCubes.h | ||
int GetVertexSectionIndex
(
int64 hash |
Generators/MarchingCubes.h | ||
void InitHashTables() |
Generators/MarchingCubes.h | ||
| Compute 3D corner-positions and field values for cell at index | Generators/MarchingCubes.h | ||
void initialize_cell_values_grid
(
FGridCell& Cell, |
Generators/MarchingCubes.h | ||
void initialize_cell_values_nohash
(
FGridCell& Cell, |
Generators/MarchingCubes.h | ||
bool polygonize_cell
(
FGridCell& Cell, |
Find edge crossings and generate triangles for this cell | Generators/MarchingCubes.h | |
void ResetMesh() |
Reset internal mesh-assembly data structures | Generators/MarchingCubes.h | |
bool set_cell_if_not_done
(
const FVector3i& Idx |
Generators/MarchingCubes.h | ||
void SetDimensions() |
Generators/MarchingCubes.h | ||
void shift_cell_x
(
FGridCell& Cell, |
Assume we just want to slide cell at XIdx-1 to cell at XIdx, while keeping yi and ZIdx constant. | Generators/MarchingCubes.h |