FMeshNormals

[FMeshNormals](API\Plugins\DynamicMesh\FMeshNormals) is a utility class that can calculate and store various types of normal vectors for a FDynamicMesh.

Windows
MacOS
Linux

References

Module

DynamicMesh

Header

/Engine/Plugins/Experimental/GeometryProcessing/Source/DynamicMesh/Public/MeshNormals.h

Include

#include "MeshNormals.h"

Syntax

class FMeshNormals

Remarks

FMeshNormals is a utility class that can calculate and store various types of normal vectors for a FDynamicMesh.

Variables

Name Description

Protected variable

const FDynamicM...

 

Mesh

Target Mesh

Protected variable

TArray< FVector...

 

Normals

Set of computed normals

Constructors

Name Description

Public function

FMeshNormals()

Public function

FMeshNormals

(
    const FDynamicMesh3* Mesh
)

Functions

Name Description

Protected function

void

 

Compute_FaceAvg

(
    bool bWeightByArea,
    bool bWeightByAngle
)

Compute per-vertex normals using a custom combination of area-weighted and angle-weighted averaging of one-ring triangle normals

Protected function

void

 

Compute_FaceAvg_AreaWeighted()

Compute per-vertex normals using area-weighted averaging of one-ring triangle normals

Protected function

void

 

Compute_Overlay_FaceAvg

(
    const FDynamicMeshNormalOverlay...,
    bool bWeightByArea,
    bool bWeightByAngle
)

Recompute the element Normals of the given attribute overlay using a custom combination of area-weighted and angle-weighted averaging of one-ring triangle normals

Protected function

void

 

Compute_Overlay_FaceAvg_AreaWeighted

(
    const FDynamicMeshNormalOverlay...
)

Recompute the element Normals of the given attribute overlay using area-weighted averaging of one-ring triangle normals

Protected function

void

 

Compute_Triangle()

Compute per-triangle normals

Public function Static

FVector3d

 

ComputeOverlayNormal

(
    const FDynamicMesh3& Mesh,
    const FDynamicMeshNormalOverlay...,
    int ElemIdx
)

Public function

void

 

ComputeTriangleNormals()

Compute per-triangle normals

Public function Static

FVector3d

 

ComputeVertexNormal

(
    const FDynamicMesh3& Mesh,
    int32 VertIdx,
    TFunctionRef< bool)> Triangle...,
    bool bWeightByArea,
    bool bWeightByAngle
)

Compute normal at mesh vertex by weighted sum of subset of one-ring triangle normals.

Public function Static

FVector3d

 

ComputeVertexNormal

(
    const FDynamicMesh3& Mesh,
    int VertIdx,
    bool bWeightByArea,
    bool bWeightByAngle
)

Compute normal at mesh vertex by weighted sum of one-ring triangle normals.

Public function

void

 

ComputeVertexNormals

(
    bool bWeightByArea,
    bool bWeightByAngle
)

Compute standard per-vertex normals by averaging one-ring face normals

Public function Const

void

 

CopyToOverlay

(
    FDynamicMeshNormalOverlay* Nor...,
    bool bInvert
)

Copy the current set of normals to the NormalOverlay attribute layer

Public function Const

void

 

CopyToVertexNormals

(
    FDynamicMesh3* SetMesh,
    bool bInvert
)

Copy the current set of normals to the vertex normals of SetMesh

Public function Const

const TArray...

 

GetNormals()

Protected function Static

FVector3d

 

GetVertexWeightsOnTriangle

(
    const FDynamicMesh3* Mesh,
    int TriID,
    double TriArea,
    bool bWeightByArea,
    bool bWeightByAngle
)

Public function Static

void

 

InitializeMeshToPerTriangleNormals

(
    FDynamicMesh3* Mesh
)

Initialize the given Mesh with per-face normals, ie separate overlay element for each vertex of each triangle.

Public function Static

void

 

InitializeOverlayRegionToPerVertexNormals

(
    FDynamicMeshNormalOverlay* Nor...,
    const TArray< int32 >& Triangles
)

Initialize the given triangles of NormalOverlay with per-vertex normals, ie single overlay element for each mesh vertex.

Public function Static

void

 

InitializeOverlayToPerTriangleNormals

(
    FDynamicMeshNormalOverlay* Nor...
)

Initialize the given NormalOverlay with per-face normals, ie separate overlay element for each vertex of each triangle.

Public function Static

void

 

InitializeOverlayToPerVertexNormals

(
    FDynamicMeshNormalOverlay* Nor...,
    bool bUseMeshVertexNormalsIfAvailab...
)

Initialize the given NormalOverlay with per-vertex normals, ie single overlay element for each mesh vertex.

Public function Static

void

 

InitializeOverlayTopologyFromFaceGroups

(
    const FDynamicMesh3* Mesh,
    FDynamicMeshNormalOverlay* Nor...
)

Public function Static

void

 

InitializeOverlayTopologyFromOpeningAngle

(
    const FDynamicMesh3* Mesh,
    FDynamicMeshNormalOverlay* Nor...,
    double AngleThresholdDeg
)

Public function Static

void

 

QuickComputeVertexNormals

(
    FDynamicMesh3& Mesh,
    bool bInvert
)

Compute per-vertex normals for the given Mesh

Public function Static

void

 

QuickComputeVertexNormalsForTriangles

(
    FDynamicMesh3& Mesh,
    const TArray< int32 >& Triangles,
    bool bWeightByArea,
    bool bWeightByAngle,
    bool bInvert
)

Compute per-vertex normals for the vertices of a set of triangles of a Mesh

Public function Static

bool

 

QuickRecomputeOverlayNormals

(
    FDynamicMesh3& Mesh,
    bool bInvert,
    bool bWeightByArea,
    bool bWeightByAngle
)

Compute overlay normals for the given mesh

Public function

void

 

RecomputeOverlayNormals

(
    const FDynamicMeshNormalOverlay...,
    bool bWeightByArea,
    bool bWeightByAngle
)

Recompute the per-element normals of the given overlay by averaging one-ring face normals

Public function

void

 

SetCount

(
    int Count,
    bool bClearToZero
)

Set the size of the Normals array to Count, and optionally clear all values to (0,0,0)

Public function

void

 

SetMesh

(
    const FDynamicMesh3* MeshIn
)

Operators

Name Description

Public function

FVector3d &

 

operator[]

(
    int i
)

Public function Const

const FVecto...

 

operator[]

(
    int i
)

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