Navigation
API > API/Runtime > API/Runtime/GeometryCore > API/Runtime/GeometryCore/Generators
Inheritance Hierarchy
- FMeshShapeGenerator
- FMarchingCubes
References
| Module | GeometryCore |
| Header | /Engine/Source/Runtime/GeometryCore/Public/Generators/MarchingCubes.h |
| Include | #include "Generators/MarchingCubes.h" |
Syntax
class FMarchingCubes : public UE::Geometry::FMeshShapeGenerator
Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bEnableValueCaching | If true, code will assume that Implicit() is expensive enough that it is worth it to cache evaluations when possible. | |
| FBlockedDenseGrid3f | BlockedCornerValuesGrid | Store corner values in pre-allocated grid that has FMathf::MaxReal as sentinel. | |
| FBlockedDenseGrid3i | BlockedDoneCells | ||
| TAxisAlignedBox3< double > | Bounds | Bounding-box we will mesh inside of. | |
| bool | bParallelCompute | 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) | |
| TFunction< bool(void)> | CancelF | If this function returns true, we should abort calculation | |
| FVector3i | CellDimensions | Cube indices range from [Origin,CellDimensions) | |
| double | CubeSize | Length of edges of cubes that are marching. | |
| const int64 | EDGE_X | ||
| const int64 | EDGE_Y | ||
| const int64 | EDGE_Z | ||
| TArray< FCriticalSection > | EdgeVertexSectionLocks | ||
| TArray< TMap< int64, int > > | EdgeVertexSections | ||
| FAxisAlignedBox3i | GridBounds | ||
| TFunction< double(TVector< double >)> | Implicit | This is the function we will evaluate | |
| double | IsoValue | Mesh surface will be at this isovalue. | |
| FAxisAlignedBox3i | LastGridBounds | ||
| const int64 | NumEdgeVertexSections | Hash table for edge vertices | |
| int64 | NumTriangleSections | ||
| int64 | NumVertexSections | ||
| bool | parallel_mesh_access | ||
| ERootfindingModes | RootMode | Which rootfinding method will be used to converge on surface along edges | |
| int | RootModeSteps | Number of iterations of rootfinding method (ignored for SingleLerp) | |
| int | SafetyMaxDimension | Max number of cells on any dimension; if exceeded, CubeSize will be automatically increased to fix | |
| TArray< TArray< FIndex3i > > | TriangleSectionLists | ||
| TArray< FCriticalSection > | TriangleSectionLocks | ||
| std::atomic< int32 > | VertexCounter | ||
| TArray< TArray< FIndexedVertex > > | VertexSectionLists | ||
| TArray< FCriticalSection > | VertexSectionLocks |
Constructors
| Type | Name | Description | |
|---|---|---|---|
Destructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | append_triangle
(
int A, |
Add triangle to mesh, with locking if we are computing in parallel | |
| int | append_vertex
(
TVector< double > V, |
Add vertex to mesh, with locking if we are computing in parallel | |
| int | AppendOrFindVertexID
(
int64 hash, |
||
| void | BuildMesh () |
Populate FMeshShapeGenerator data structures from accumulated vertex/triangle sets | |
| FVector3i | cell_index
(
const TVector< double >& Pos |
||
| int64 | corner_hash
(
int X, |
||
| 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. | |
| TVector< double > | corner_pos
(
const FVector3i& IJK |
||
| void | corner_pos
(
const FVector3i& IJK, |
||
| double | corner_value_grid
(
const FVector3i& Idx |
||
| double | corner_value_grid_parallel
(
const FVector3i& Idx |
||
| double | corner_value_nohash
(
const FVector3i& Idx |
Explicitly compute corner values as necessary | |
| int64 | |||
| int | edge_vertex_id
(
const FVector3i& Idx1, |
||
| void | Root-find the intersection along edge from f(P1)=ValP1 to f(P2)=ValP2 | ||
| int | FindVertexID
(
int64 hash |
||
| void | Fully sequential version, no threading | ||
| void | generate_continuation
(
TArrayView< const FVector3d > Seeds |
Fully sequential version, no threading | |
| void | generate_continuation_parallel
(
TArrayView< const FVector3d > Seeds |
Parallel seed evaluation | |
| void | Processing z-slabs of cells in parallel | ||
| FMeshShapeGenerator & | GenerateContinuation
(
TArrayView< const FVector3d > Seeds |
||
| int | GetTriangleSectionIndex
(
int64 hash |
||
| int | GetVertexSectionIndex
(
int64 hash |
||
| void | |||
| void | initialize_cell
(
FGridCell& Cell, |
Compute 3D corner-positions and field values for cell at index | |
| void | initialize_cell_values_grid
(
FGridCell& Cell, |
||
| void | initialize_cell_values_nohash
(
FGridCell& Cell, |
||
| bool | polygonize_cell
(
FGridCell& Cell, |
Find edge crossings and generate triangles for this cell | |
| void | ResetMesh () |
Reset internal mesh-assembly data structures | |
| bool | set_cell_if_not_done
(
const FVector3i& Idx |
||
| void | |||
| 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. | |
| bool | Validate () |
Overridden from FMeshShapeGenerator
| Type | Name | Description | |
|---|---|---|---|
| FMeshShapeGenerator & | Generate () |
Run MC algorithm and generate Output mesh |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FGridCell | We pass Cells around, this makes code cleaner | ||
| FIndexedVertex |
Constants
| Name | Description |
|---|---|
| EdgeIndices | Below here are standard marching-cubes tables. |
| EdgeTable | |
| TriTable |