Navigation
API > API/Plugins > API/Plugins/DynamicMesh
FMeshPlanarSymmetry detects pairwise symmetry relationships between vertices in a mesh, given a symmetry frame. Once those relationships are known, symmetry can be re-enforced after mesh edits.
Vertices within a tolerance band of the symmetry plane do not have a mirror and are considered "on plane" and will be snapped to the symmetry plane when enforcing symmetry after edits.
The Symmetry Plane is specified by a Frame3d where the XY axes define the plane and the Z axis is the plane normal. So references to "Positive" side below are relative to that Z axis/plane
| Name | FMeshPlanarSymmetry |
| Type | class |
| Header File | /Engine/Plugins/Runtime/GeometryProcessing/Source/DynamicMesh/Public/Parameterization/MeshPlanarSymmetry.h |
| Include Path | #include "Parameterization/MeshPlanarSymmetry.h" |
Syntax
class FMeshPlanarSymmetry
Structs
| Name | Remarks |
|---|---|
| FSymmetryVertex |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| MatchFeaturesTolerance | double | Note for features we specify a direct tolerance instead of a factor, as features are already in their own re-scaled space. | Parameterization/MeshPlanarSymmetry.h |
| MatchVertexToleranceFactor | double | Parameterization/MeshPlanarSymmetry.h | |
| OnPlaneToleranceFactor | double | Tolerances used for matching / hashing in symmetry-finding Point must be within this distance from the symmetry plane to be considered "on" the plane. | Parameterization/MeshPlanarSymmetry.h |
| VertexHashCellSizeFactor | double | Note performance of vertex hashing is much better when VertexHashCellSize is large enough that most hash lookups only need to look at a single cell. | Parameterization/MeshPlanarSymmetry.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bCanIgnoreDegenerateSymmetries | bool | If true, symmetry-finding can return false if it detects a symmetry where all points are on the symmetry plane, rather than attempt to fit a symmetry plane in that case. | Parameterization/MeshPlanarSymmetry.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ErrorScale | double | Internal error scale; for large meshes, we need larger tolerances because floating point values will be less accurate. | Parameterization/MeshPlanarSymmetry.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| For any vertices in VertexIndices that are on-plane, take the position in VertexPositionsInOut, apply the on-plane constraint, and return the constrained position in VertexPositionsInOut (ie VertexPositionsInOut is updated to new positions) | Parameterization/MeshPlanarSymmetry.h | ||
void ComputeSymmetryConstrainedPositions
(
const TArray< int >& SourceVertexROI, |
Given the pairing (SourceVertexROI, SourceVertexPositions), compute the symmetry-constrained vertex positions for MirrorVertexROI and store in MirrorVertexPositionsOut. | Parameterization/MeshPlanarSymmetry.h | |
bool FindPlaneAndInitialize
(
FDynamicMesh3* Mesh, |
Given a Mesh and its bounding box, find a Symmetry Plane/Frame and detect any pairs of vertices with planar/mirror-symmetry relationships, as well as "on plane" vertices | Parameterization/MeshPlanarSymmetry.h | |
void FullSymmetryUpdate () |
Update all the symmetry vertex positions based on their Positive-side pair vertex. | Parameterization/MeshPlanarSymmetry.h | |
FVector3d GetMirroredAxis
(
const FVector3d& Axis |
Parameterization/MeshPlanarSymmetry.h | ||
FQuaterniond GetMirroredOrientation
(
const FQuaterniond& Orientation |
Parameterization/MeshPlanarSymmetry.h | ||
FVector3d GetMirroredPosition
(
const FVector3d& Position |
Parameterization/MeshPlanarSymmetry.h | ||
void GetMirrorVertexROI
(
const TArray< int >& VertexROI, |
The set of functions below are intended to be used together in situations like 3D sculpting where we want to apply symmetry constraints within a "brush region of interest (ROI)" See UMeshVertexSculptTool for example usage Computes list of vertices that are mirror-constrained to vertices in VertexROI. | Parameterization/MeshPlanarSymmetry.h | |
FFrame3d GetPositiveSideFrame
(
FFrame3d FromFrame |
Parameterization/MeshPlanarSymmetry.h | ||
bool Initialize
(
FDynamicMesh3* Mesh, |
Given a Mesh, an AABBTree, and a Symmetry Plane/Frame, detect any pairs of vertices with planar/mirror-symmetry relationships, as well as "on plane" vertices | Parameterization/MeshPlanarSymmetry.h | |
bool Initialize
(
FDynamicMesh3* Mesh, |
Given a Mesh and its bounding box, and a Symmetry Plane/Frame, detect any pairs of vertices with planar/mirror-symmetry relationships, as well as "on plane" vertices | Parameterization/MeshPlanarSymmetry.h | |
bool ValidateSymmetry
(
const FDynamicMesh3& TestMesh |
Parameterization/MeshPlanarSymmetry.h | ||
bool ValidateSymmetry
(
const FDynamicMesh3& TestMesh, |
Parameterization/MeshPlanarSymmetry.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void UpdatePlaneVertex
(
int32 VertexID |
Parameterization/MeshPlanarSymmetry.h | ||
void UpdateSourceVertex
(
int32 VertexID |
Parameterization/MeshPlanarSymmetry.h |