UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::FProfileSweepGenerator Class Reference

#include <SweepGenerator.h>

+ Inheritance diagram for UE::Geometry::FProfileSweepGenerator:

Public Member Functions

virtual GEOMETRYCORE_API FMeshShapeGeneratorGenerate () override
 
- Public Member Functions inherited from UE::Geometry::FMeshShapeGenerator
virtual ~FMeshShapeGenerator ()
 
bool HasAttributes () const
 
void ResetAttributes (bool bResetPolygonIDs=false)
 
void Reset ()
 
void SetBufferSizes (int NumVertices, int NumTriangles, int NumUVs, int NumNormals)
 
void ExtendBufferSizes (int AddVertices, int AddTriangles, int AddUVs, int AddNormals)
 
void SetVertex (int Index, const FVector3d &Position)
 
int AppendVertex (const FVector3d &Position)
 
void SetUV (int Index, const FVector2f &UV, int ParentVertex)
 
int AppendUV (const FVector2f &UV, int ParentVertex)
 
void SetNormal (int Index, const FVector3f &Normal, int ParentVertex)
 
int AppendNormal (const FVector3f &Normal, int ParentVertex)
 
void SetTriangle (int Index, const FIndex3i &Tri)
 
void SetTriangle (int Index, int A, int B, int C)
 
void SetTriangle (int Index, int A, int B, int C, bool bClockwiseOverride)
 
int AppendTriangle (int A, int B, int C)
 
void SetTriangleUVs (int Index, const FIndex3i &Tri)
 
void SetTriangleUVs (int Index, int A, int B, int C)
 
void SetTriangleUVs (int Index, int A, int B, int C, bool bClockwiseOverride)
 
void SetTriangleNormals (int Index, const FIndex3i &Tri)
 
void SetTriangleNormals (int Index, int A, int B, int C)
 
void SetTriangleNormals (int Index, int A, int B, int C, bool bClockwiseOverride)
 
void SetTrianglePolygon (int Index, int PolygonID)
 
void SetTriangleWithMatchedUVNormal (int Index, int A, int B, int C)
 

Public Attributes

TArray< FVector3dProfileCurve
 
TArray< FFrame3dSweepCurve
 
TArray< FVector3dSweepScaleCurve
 
TSet< int32WeldedVertices
 
FVector2d UVScale = FVector2d(1,1)
 
FVector2d UVOffset = FVector2d(0, 0)
 
bool bUVScaleRelativeWorld = false
 
float UnitUVInWorldCoordinates = 100
 
bool bSweepCurveIsClosed = false
 
bool bProfileCurveIsClosed = false
 
bool bSharpNormals = true
 
bool bUVsSkipFullyWeldedEdges = true
 
EProfileSweepQuadSplit QuadSplitMethod = EProfileSweepQuadSplit::ShortestDiagonal
 
double DiagonalTolerance = 0.01
 
EProfileSweepPolygonGrouping PolygonGroupingMode = EProfileSweepPolygonGrouping::PerFace
 
FProgressCancelProgress = nullptr
 
TArray< int32EndProfiles [2]
 
- Public Attributes inherited from UE::Geometry::FMeshShapeGenerator
TArray< FVector3dVertices
 
TArray< FVector2fUVs
 
TArray< int > UVParentVertex
 
TArray< FVector3fNormals
 
TArray< int > NormalParentVertex
 
TArray< FIndex3iTriangles
 
TArray< FIndex3iTriangleUVs
 
TArray< FIndex3iTriangleNormals
 
TArray< int > TrianglePolygonIDs
 
bool bReverseOrientation = false
 

Protected Member Functions

GEOMETRYCORE_API void InitializeUvBuffer (const TArray< int32 > &VertPositionOffsets, int32 &NumUvRowsOut, int32 &NumUvColumnsOut)
 
GEOMETRYCORE_API void AdjustNormalsForTriangle (int32 TriIndex, int32 FirstIndex, int32 SecondIndex, int32 ThirdIndex, TArray< FVector3d > &WeightedNormals)
 
GEOMETRYCORE_API void AdjustNormalsForTriangle (int32 TriIndex, int32 FirstIndex, int32 SecondIndex, int32 ThirdIndex, TArray< FVector3d > &WeightedNormals, const FVector3d &AbNormalized)
 

Additional Inherited Members

- Static Public Member Functions inherited from UE::Geometry::FMeshShapeGenerator
static FVector3d BilinearInterp (const FVector3d &v00, const FVector3d &v10, const FVector3d &v11, const FVector3d &v01, double tx, double ty)
 
static FVector2d BilinearInterp (const FVector2d &v00, const FVector2d &v10, const FVector2d &v11, const FVector2d &v01, double tx, double ty)
 
static FVector2f BilinearInterp (const FVector2f &v00, const FVector2f &v10, const FVector2f &v11, const FVector2f &v01, float tx, float ty)
 
static FVector3i LinearInterp (const FVector3i &a, const FVector3i &b, double t)
 

Detailed Description

Much like FGeneralizedCylinderGenerator, but allows an arbitrary profile curve to be swept, and gives control over the frames of the sweep curve. A mesh will be properly oriented if the profile curve is oriented counterclockwise when facing down the direction in which it is being swept.

Because it supports open profile curves, as well as welded points (for welding points on an axis of rotation), it cannot actually use the utility function from FSweepGeneratorBase, and so it doesn't inherit from that class.

Member Function Documentation

◆ AdjustNormalsForTriangle() [1/2]

void FProfileSweepGenerator::AdjustNormalsForTriangle ( int32  TriIndex,
int32  FirstIndex,
int32  SecondIndex,
int32  ThirdIndex,
TArray< FVector3d > &  WeightedNormals 
)
protected

Utility function for calculating the triangle normal contributions to average normals.

◆ AdjustNormalsForTriangle() [2/2]

void FProfileSweepGenerator::AdjustNormalsForTriangle ( int32  TriIndex,
int32  FirstIndex,
int32  SecondIndex,
int32  ThirdIndex,
TArray< FVector3d > &  WeightedNormals,
const FVector3d AbNormalized 
)
protected

Utility function for calculating the contribution of triangle normals to average normals. AbNormalized (ie, the normalized vector from the first vertex to the second) is taken as a parameter so that it can be reused in dealing with a planar quad.

◆ Generate()

FMeshShapeGenerator & FProfileSweepGenerator::Generate ( )
overridevirtual

Generate the mesh

Implements UE::Geometry::FMeshShapeGenerator.

◆ InitializeUvBuffer()

void FProfileSweepGenerator::InitializeUvBuffer ( const TArray< int32 > &  VertPositionOffsets,
int32 NumUvRowsOut,
int32 NumUvColumnsOut 
)
protected

Initializes the UV buffer with UV's that are set according to the diagram at the start of Generate(), with an extra element on each end in the case of closed curves, and distances weighted by distances in the corresponding curves. This function should get called after setting vertex positions so that the function can use them in case bUVScaleRelativeWorld is true.

Parameters
VertPositionOffsetsOffsets needed to get the correct vertex indices, for setting the parents of UV elements
NumUvRowsOutNumber of resulting UV rows allocated (a row corresponds to an instance of the profile curve)
NumUvColumnsOutNumber of resulting UV columns allocated (number of columns relates to number of profile points)

Member Data Documentation

◆ bProfileCurveIsClosed

bool UE::Geometry::FProfileSweepGenerator::bProfileCurveIsClosed = false

◆ bSharpNormals

bool UE::Geometry::FProfileSweepGenerator::bSharpNormals = true

◆ bSweepCurveIsClosed

bool UE::Geometry::FProfileSweepGenerator::bSweepCurveIsClosed = false

◆ bUVScaleRelativeWorld

bool UE::Geometry::FProfileSweepGenerator::bUVScaleRelativeWorld = false

◆ bUVsSkipFullyWeldedEdges

bool UE::Geometry::FProfileSweepGenerator::bUVsSkipFullyWeldedEdges = true

◆ DiagonalTolerance

double UE::Geometry::FProfileSweepGenerator::DiagonalTolerance = 0.01

◆ EndProfiles

TArray<int32> UE::Geometry::FProfileSweepGenerator::EndProfiles[2]

If the sweep curve is not closed, this will store the vertex ids of the first and last instances of the profile curve. Note that even if the profile curve is closed, depending on the welding, these could be part of a single boundary (ie, a square revolved 90 degrees around a welded side actually has one open boundary rather than two, since they are joined), but the user likely wants to be given them separately for ease in making end caps.

◆ PolygonGroupingMode

EProfileSweepPolygonGrouping UE::Geometry::FProfileSweepGenerator::PolygonGroupingMode = EProfileSweepPolygonGrouping::PerFace

◆ ProfileCurve

TArray<FVector3d> UE::Geometry::FProfileSweepGenerator::ProfileCurve

◆ Progress

FProgressCancel* UE::Geometry::FProfileSweepGenerator::Progress = nullptr

◆ QuadSplitMethod

EProfileSweepQuadSplit UE::Geometry::FProfileSweepGenerator::QuadSplitMethod = EProfileSweepQuadSplit::ShortestDiagonal

◆ SweepCurve

TArray<FFrame3d> UE::Geometry::FProfileSweepGenerator::SweepCurve

◆ SweepScaleCurve

TArray<FVector3d> UE::Geometry::FProfileSweepGenerator::SweepScaleCurve

◆ UnitUVInWorldCoordinates

float UE::Geometry::FProfileSweepGenerator::UnitUVInWorldCoordinates = 100

◆ UVOffset

FVector2d UE::Geometry::FProfileSweepGenerator::UVOffset = FVector2d(0, 0)

◆ UVScale

FVector2d UE::Geometry::FProfileSweepGenerator::UVScale = FVector2d(1,1)

◆ WeldedVertices

TSet<int32> UE::Geometry::FProfileSweepGenerator::WeldedVertices

The documentation for this class was generated from the following files: