TMeshSpatialSort

Sorts a list meshes into a list of "Nests" where each Nest has an outer shell mesh and a list of contained-inside meshes

Windows
MacOS
Linux

References

Module

GeometricObjects

Header

/Engine/Plugins/Experimental/GeometryProcessing/Source/GeometricObjects/Public/Spatial/MeshSpatialSort.h

Include

#include "Spatial/MeshSpatialSort.h"

Syntax

template<class TriangleMeshType>
class TMeshSpatialSort

Remarks

Sorts a list meshes into a list of "Nests" where each Nest has an outer shell mesh and a list of contained-inside meshes

For example, if you have a "Russian nesting doll" arrangement of meshes [A,B,C,D] where A holds B holds C holds D:

  • If NestingMethod is InSmallestParent, the output will be: Nest 1: Outer: A, Inner: B, Parent: Invalid Nest 2: Outer; C, Inner: D, Parent: B Nest 1 conceptually corresponds to the outer and inner walls of the first doll, and Nest 2 the same of the second doll. (

if the orientation-related booleans are set to true, this would only hold if the mesh orientations are also alternating)

  • If NestingMethod is InLargestParent, the output will be: Nest 1: Outer: A; Inner: B, C, D; Parent: Invalid In this case Nest 1 conceptually corresponds to there being a single outer structure, and the inner structure is left unsorted (

for InLargestParent mode, you typically want bOnlyNestNegativeVolumes to be false) For similar functionality in 2D, see the TPlanarComplex class

Variables

Name Description

Public variable

bool

 

bOnlyCheckSingleVertexForNesting

If true, we assume meshes don't intersect, so we can check if a whole mesh is inside another by testing a single vertex If false, we only consider a mesh inside another if every vertex of the smaller is inside the larger

Public variable

bool

 

bOnlyNestNegativeVolumes

If true, only negative-volume meshes can be nested (i.e., can be included in an FMeshNesting InnerIndices array)

Public variable

bool

 

bOnlyParentPostiveVolumes

If true, only positive-volume meshes can be assigned the "OuterIndex" of an FMeshNesting Leads to more logical nesting, but

Public variable

TArrayView< con...

 

InputMeshes

Meshes to be spatially sorted

Public variable

TArray< FAxisAl...

 

MeshBounds

Optional array of bounding boxes for each mesh

Public variable

ENestingMethod

 

NestingMethod

Which algorithm is used to determine nesting

Public variable

TArray< FMeshNe...

 

Nests

Computed nests

Public variable

TArray< int >

 

SkippedMeshIndices

Indices of meshes that are not included in the "Nests" output, e.g. negative-volume meshes that are not inside any positive-volume mesh if bOnlyParentPostiveVolumes

Constructors

Name Description

Public function

TMeshSpatialSort()

Public function

TMeshSpatialSort

(
    TArrayView< const TriangleMeshType ...,
    TArrayView< const FAxisAlignedBox3d...
)

Functions

Name Description

Public function

void

 

Compute()

Classes

Name

Description

Public struct

FMeshNesting

Outputs.

Enums

Name

Description

Public enum

ENestingMethod

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss