FMeshSimpleShapeApproximation

[FMeshSimpleShapeApproximation](API\Plugins\DynamicMesh\ShapeApproximation\FMeshSimpleShapeApproximation) can calculate various "simple" shape approximations for a set of meshes, by fitting various primitives/hulls/etc to each mesh.

Windows
MacOS
Linux

References

Module

DynamicMesh

Header

/Engine/Plugins/Experimental/GeometryProcessing/Source/DynamicMesh/Public/ShapeApproximation/MeshSimpleShapeApproximation.h

Include

#include "ShapeApproximation/MeshSimpleShapeApproximation.h"

Syntax

class FMeshSimpleShapeApproximation

Remarks

FMeshSimpleShapeApproximation can calculate various "simple" shape approximations for a set of meshes, by fitting various primitives/hulls/etc to each mesh. The assumption is that the input mesh(es) are already partitioned into pieces.

There are various Generate_X() functions which apply different strategies, generally to fit a containing simple shape or hull to the mesh. However in addition to these explicit strategies, input meshes that are very close to approximations of spheres/boxes/capsules (ie basically meshed versions of these primitives) can be identified and used directly, skipping the fitting process.

Variables

Name Description

Public variable

bool

 

bDetectBoxes

Should boxes be auto-detected

Public variable

bool

 

bDetectCapsules

Should capsules be auto-detected

Public variable

bool

 

bDetectConvexes

Should convex be auto-detected

Public variable

bool

 

bDetectSpheres

Configuration parametersShould spheres be auto-detected

Public variable

bool

 

bSimplifyHulls

Should hulls be simplified as a post-process

Public variable

bool

 

bUseExactComputationForBox

Public variable

double

 

HullSimplifyTolerance

Simplification tolerance when simplifying 2D convex hulls, eg for swept/projected hulls

Public variable

int32

 

HullTargetFaceCount

Target number of triangles when simplifying 3D convex hulls

Public variable

double

 

MinDimension

Minimal dimension of fit shapes, eg thickness/radius/etc (currently only enforced in certain cases)

Protected variable

TArray< FSource...

 

SourceMeshCaches

Protected variable

TArray< const F...

 

SourceMeshes

Functions

Name Description

Protected function

void

 

DetectAndCacheSimpleShapeType

(
    const FDynamicMesh3* SourceMes...,
    FSourceMeshCache& CacheOut
)

Public function

void

 

Generate_AlignedBoxes

(
    FSimpleShapeSet3d& ShapeSetOut
)

Approximation generators Fit containing axis-aligned boxes to each input mesh and store in ShapeSetOut

Public function

void

 

Generate_Capsules

(
    FSimpleShapeSet3d& ShapeSetOut
)

Fit containing approximate-minimum-volume capsules to each input mesh and store in ShapeSetOut

Public function

void

 

Generate_ConvexHulls

(
    FSimpleShapeSet3d& ShapeSetOut
)

Calculate 3D Convex Hulls for each input mesh and store in ShapeSetOut.

Public function

void

 

Generate_MinimalSpheres

(
    FSimpleShapeSet3d& ShapeSetOut
)

Fit containing minimal-volume spheres to each input mesh and store in ShapeSetOut

Public function

void

 

Generate_MinVolume

(
    FSimpleShapeSet3d& ShapeSetOut
)

Fit containing axis-aligned box, oriented box, capsule, and sphere to each input mesh, and store the one with smallest volume in ShapeSetOut

Public function

void

 

Generate_OrientedBoxes

(
    FSimpleShapeSet3d& ShapeSetOut,
    FProgressCancel* Progress
)

Fit containing minimal-volume oriented boxes to each input mesh and store in ShapeSetOut

Public function

void

 

Generate_ProjectedHulls

(
    FSimpleShapeSet3d& ShapeSetOut,
    EProjectedHullAxisMode AxisMode
)

Calculate Projected Convex Hulls for each input mesh and store in ShapeSetOut.

Protected function

bool

 

GetDetectedSimpleShape

(
    const FSourceMeshCache& Cache,
    FSimpleShapeSet3d& ShapeSetOut,
    FCriticalSection& ShapeSetLock
)

Public function

void

 

InitializeSourceMeshes

(
    const TArray< const FDynamicMesh3&...
)

Setup/initialization Initialize internal mesh sets.

Classes

Name

Description

Protected struct

FSourceMeshCache

Enums

Name

Description

Public enum

EProjectedHullAxisMode

Type/Mode for deciding 3D axis to use in Generate_ProjectedHulls()

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