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

#include <Grid.h>

+ Inheritance diagram for UE::CADKernel::FGrid:

Public Member Functions

 FGrid (FTopologicalFace &InFace, FModelMesh &InShellMesh)
 
virtual ~FGrid ()=default
 
void DefineCuttingParameters ()
 
void DefineCuttingParameters (EIso Iso, FCuttingGrid &Neighbors)
 
bool GeneratePointCloud ()
 
void ProcessPointCloud ()
 
constexpr const int32 GetCuttingCount (EIso Iso) const
 
const int32 GetTotalCuttingCount () const
 
const double GetTolerance (EIso Iso) const
 
const bool IsNodeInsideAndMeshable (int32 Index) const
 
const bool IsNodeInsideButTooCloseToLoop (int32 Index) const
 
const bool IsNodeFarFromFace (int32 Index) const
 
const bool IsNodeOutsideFace (int32 Index) const
 
const bool IsNodeInsideAndCloseToLoop (int32 Index) const
 
const bool IsNodeOusideFaceButClose (int32 Index) const
 
void SetNodeInside (int32 Index)
 
const int32 InnerNodesCount () const
 
const bool IsNodeCloseToLoop (int32 Index) const
 
const bool IsNodeTooCloseToLoop (int32 Index) const
 
void SetCloseToLoop (int32 Index)
 
void SetTooCloseToLoop (int32 Index)
 
void ResetInsideLoop (int32 Index)
 
void SetInner2DPoint (EGridSpace Space, int32 Index, const FVector2d &NewCoordinate)
 
const FVector3fGetPointNormal (int32 IndexU, int32 IndexV) const
 
const FVector3fGetPointNormal (int32 Index) const
 
const TArray< double > & GetCuttingCoordinatesAlongIso (EIso Iso) const
 
const FCoordinateGridGetCuttingCoordinates () const
 
TArray< FVector3f > & GetNormals ()
 
const TArray< TArray< int32 > > & GetNodeIdsOfFaceLoops () const
 
const FVector2dGetLoop2DPoint (EGridSpace Space, int32 LoopIndex, int32 Index) const
 
void SetLoop2DPoint (EGridSpace Space, int32 LoopIndex, int32 Index, const FVector2d &NewCoordinate)
 
const FVectorGetLoop3DPoint (int32 LoopIndex, int32 Index) const
 
const int32 GetLoopCount () const
 
const TArray< TArray< FVector2d > > & GetLoops2D (EGridSpace Space) const
 
TArray< TArray< FVector > > & GetLoops3D ()
 
const TArray< TArray< FVector > > & GetLoops3D () const
 
const TArray< TArray< FVector3f > > & GetLoopNormals () const
 
void UVIndexFromGlobalIndex (int32 GLobalIndex, int32 &OutIndexU, int32 &OutIndexV) const
 
double GetMinElementSize () const
 
- Public Member Functions inherited from UE::CADKernel::FGridBase
 FGridBase (FTopologicalFace &InFace)
 
virtual ~FGridBase ()
 
void TransformPoints (EGridSpace DestinationSpace, const TArray< FVector2d > &InPointsToScale, TArray< FVector2d > &OutScaledPoints) const
 
bool ScaleGrid ()
 
double GetTolerance () const
 
const FVector2dGetInner2DPoint (EGridSpace Space, int32 Index) const
 
const FVector2dGetInner2DPoint (EGridSpace Space, int32 IndexU, int32 IndexV) const
 
const FVectorGetInner3DPoint (int32 Index) const
 
constexpr const TArray< double > & GetUniformCuttingCoordinatesAlongIso (EIso Iso) const
 
const FCoordinateGridGetUniformCuttingCoordinates () const
 
TArray< FVector > & GetInner3DPoints ()
 
const TArray< FVector > & GetInner3DPoints () const
 
const TArray< FVector2d > & GetInner2DPoints (EGridSpace Space) const
 
const FTopologicalFaceGetFace () const
 
FTopologicalFaceGetFace ()
 
int32 GobalIndex (int32 IndexU, int32 IndexV) const
 
- Public Member Functions inherited from UE::CADKernel::FHaveStates
 FHaveStates ()
 
void Serialize (FCADKernelArchive &Ar)
 
void ResetElementStatus ()
 
bool HasMarker1 () const
 
bool HasMarker2 () const
 
bool HasMarker1And2 () const
 
bool HasMarker1Or2 () const
 
void SetMarker1 () const
 
void SetMarker2 () const
 
void ResetMarker1 () const
 
void ResetMarker2 () const
 
void ResetMarkers () const
 
bool IsDeleted () const
 
void SetDeletedMarker () const
 
void ResetDeleted () const
 
virtual bool IsDeletedOrDegenerated () const
 
virtual bool IsDegenerated () const
 
virtual void SetAsDegenerated () const
 
virtual void ResetDegenerated () const
 
void SetWaitingMarker () const
 
void ResetWaitingMarker () const
 
virtual bool IsWaiting () const
 
void SetProcessedMarker () const
 
void ResetProcessedMarker () const
 
virtual bool IsProcessed () const
 
virtual bool IsProcessedDeletedOrDegenerated () const
 
void SetToProcessMarker () const
 
void ResetToProcessMarker () const
 
virtual bool IsToProcess () const
 
virtual bool IsNotToProcess () const
 
virtual bool IsNotToOrAlreadyProcess () const
 

Protected Member Functions

virtual const FCoordinateGridGetCoordinateGrid () const override
 
void ScaleLoops ()
 
void FindInnerFacePoints ()
 
void FindPointsCloseToLoop ()
 
void RemovePointsCloseToLoop ()
 
void GetPreferredUVCuttingParametersFromLoops (FCuttingGrid &CuttingFromLoops)
 
bool GetMeshOfLoops ()
 
void GetMeshOfLoop (const FTopologicalLoop &Loop)
 
void GetMeshOfThinZone (const FThinZone2D &ThinZone)
 
bool CheckIfExternalLoopIsDegenerate () const
 
bool CheckIf2DGridIsDegenerate () const
 
- Protected Member Functions inherited from UE::CADKernel::FGridBase
void EvaluatePointGrid (const FCoordinateGrid &CoordinateGrid, bool bWithNormals)
 
void ComputeNewCoordinate (const TArray< FVector2d > &NewGrid, int32 IndexU, int32 IndexV, const FVector2d &InPoint, FVector2d &OutNewScaledPoint) const
 

Protected Attributes

FCoordinateGridCoordinateGrid
 
const FSurfacicTolerance FaceTolerance
 
const double MinimumElementSize
 
FModelMeshMeshModel
 
TArray< TArray< FVector2d > > FaceLoops2D [EGridSpace::EndGridSpace]
 
TArray< TArray< FVector > > FaceLoops3D
 
TArray< TArray< FVector3f > > NormalsOfFaceLoops
 
TArray< TArray< int32 > > NodeIdsOfFaceLoops
 
int32 CountOfInnerNodes = 0
 
double MinOfMaxElementSize = 0
 
TArray< ENodeMarkerNodeMarkers
 
- Protected Attributes inherited from UE::CADKernel::FGridBase
FTopologicalFaceFace
 
const double Tolerance3D
 
int32 CuttingCount [2] = { 0 , 0 }
 
int32 CuttingSize = 0
 
FCoordinateGrid UniformCuttingCoordinates
 
TArray< FVector2dPoints2D [EGridSpace::EndGridSpace]
 
TArray< FVectorPoints3D
 
TArray< FVector3fNormals
 
- Protected Attributes inherited from UE::CADKernel::FHaveStates
EHaveStates States
 

Additional Inherited Members

- Public Attributes inherited from UE::CADKernel::FGridBase
FGridChronos Chronos
 

Constructor & Destructor Documentation

◆ FGrid()

UE::CADKernel::FGrid::FGrid ( FTopologicalFace InFace,
FModelMesh InShellMesh 
)

◆ ~FGrid()

virtual UE::CADKernel::FGrid::~FGrid ( )
virtualdefault

Member Function Documentation

◆ CheckIf2DGridIsDegenerate()

bool UE::CADKernel::FGrid::CheckIf2DGridIsDegenerate ( ) const
protected
Returns
true if along an Iso, all (U(i+1) - U(i)) < FaceTolerance

◆ CheckIfExternalLoopIsDegenerate()

bool UE::CADKernel::FGrid::CheckIfExternalLoopIsDegenerate ( ) const
protected
Returns
true if the grid is not consistent to build a mesh as composed of only two border nodes.

◆ DefineCuttingParameters() [1/2]

void UE::CADKernel::FGrid::DefineCuttingParameters ( )

Defines the cutting coordinate of the grid according to mesh criteria and the existing mesh of bordering edges (loop's edges)

See also
GetPreferredUVCoordinatesFromNeighbours

◆ DefineCuttingParameters() [2/2]

void UE::CADKernel::FGrid::DefineCuttingParameters ( EIso  Iso,
FCuttingGrid Neighbors 
)

◆ FindInnerFacePoints()

void UE::CADKernel::FGrid::FindInnerFacePoints ( )
protected

◆ FindPointsCloseToLoop()

void UE::CADKernel::FGrid::FindPointsCloseToLoop ( )
protected

Define if an inner node is close to a loop i.e. if the loop cross the cell [[IndexU - 1, IndexU], [IndexV - 1, IndexV]], each corner node of the cell is close to the loop

This algorithm is inspired of Bresenham's line algorithm The loop is traversed segment by segment For each segment, according to the slop of the segment, each cell intersecting the segment is selected (FindIntersectionsCaseSlope_) i.e. each corner node of the cell is flagged IsCloseToLoop (SetCellCloseToLoop)

See also
SlopeUtils
IsNodeCloseToLoop
ProcessPointCloud (called in ProcessPointClound)

◆ GeneratePointCloud()

bool UE::CADKernel::FGrid::GeneratePointCloud ( )

Computes the 2d Points, 3D points and Normals of the grid. call of DefineCuttingParameters is mandatory called before

Returns
false if the grid is degenerated

◆ GetCoordinateGrid()

virtual const FCoordinateGrid & UE::CADKernel::FGrid::GetCoordinateGrid ( ) const
inlineoverrideprotectedvirtual

◆ GetCuttingCoordinates()

const FCoordinateGrid & UE::CADKernel::FGrid::GetCuttingCoordinates ( ) const
inline

◆ GetCuttingCoordinatesAlongIso()

const TArray< double > & UE::CADKernel::FGrid::GetCuttingCoordinatesAlongIso ( EIso  Iso) const
inline

◆ GetCuttingCount()

constexpr const int32 UE::CADKernel::FGrid::GetCuttingCount ( EIso  Iso) const
inlineconstexpr

◆ GetLoop2DPoint()

const FVector2d & UE::CADKernel::FGrid::GetLoop2DPoint ( EGridSpace  Space,
int32  LoopIndex,
int32  Index 
) const
inline

◆ GetLoop3DPoint()

const FVector & UE::CADKernel::FGrid::GetLoop3DPoint ( int32  LoopIndex,
int32  Index 
) const
inline

◆ GetLoopCount()

const int32 UE::CADKernel::FGrid::GetLoopCount ( ) const
inline

◆ GetLoopNormals()

const TArray< TArray< FVector3f > > & UE::CADKernel::FGrid::GetLoopNormals ( ) const
inline
Returns
the array of array of normal of the points of the loops

◆ GetLoops2D()

const TArray< TArray< FVector2d > > & UE::CADKernel::FGrid::GetLoops2D ( EGridSpace  Space) const
inline
Returns
the array of array of 2d points of the loops according to the defined grid space

◆ GetLoops3D() [1/2]

TArray< TArray< FVector > > & UE::CADKernel::FGrid::GetLoops3D ( )
inline
Returns
the array of array of 3d points of the loops

◆ GetLoops3D() [2/2]

const TArray< TArray< FVector > > & UE::CADKernel::FGrid::GetLoops3D ( ) const
inline
Returns
the array of array of 3d points of the loops

◆ GetMeshOfLoop()

void UE::CADKernel::FGrid::GetMeshOfLoop ( const FTopologicalLoop Loop)
protected

◆ GetMeshOfLoops()

bool UE::CADKernel::FGrid::GetMeshOfLoops ( )
protected

@ return false if the mesh of the loop is degenerated

◆ GetMeshOfThinZone()

void UE::CADKernel::FGrid::GetMeshOfThinZone ( const FThinZone2D ThinZone)
protected

◆ GetMinElementSize()

double UE::CADKernel::FGrid::GetMinElementSize ( ) const
inline
Returns
the minimal size of the mesh elements according to 3d geometric tolerance

◆ GetNodeIdsOfFaceLoops()

const TArray< TArray< int32 > > & UE::CADKernel::FGrid::GetNodeIdsOfFaceLoops ( ) const
inline

◆ GetNormals()

TArray< FVector3f > & UE::CADKernel::FGrid::GetNormals ( )
inline
Returns
the array of normal of the points of the grid

◆ GetPointNormal() [1/2]

const FVector3f & UE::CADKernel::FGrid::GetPointNormal ( int32  Index) const
inline
Returns
the normal of the surface at the point at the Index of the grid

◆ GetPointNormal() [2/2]

const FVector3f & UE::CADKernel::FGrid::GetPointNormal ( int32  IndexU,
int32  IndexV 
) const
inline
Returns
the normal of the surface at the point at the Index of the grid

◆ GetPreferredUVCuttingParametersFromLoops()

void UE::CADKernel::FGrid::GetPreferredUVCuttingParametersFromLoops ( FCuttingGrid CuttingFromLoops)
protected

Gets the cutting coordinates of the existing mesh of bordering edges (loop's edges)

See also
DefineCuttingParameters (called in DefineCuttingParameters)

◆ GetTolerance()

const double UE::CADKernel::FGrid::GetTolerance ( EIso  Iso) const
inline

◆ GetTotalCuttingCount()

const int32 UE::CADKernel::FGrid::GetTotalCuttingCount ( ) const
inline

Return the number of points (inner and outer points) of the grid (i.e. CuttingCount[IsoU] x CuttingCount[IsoV]).

◆ InnerNodesCount()

const int32 UE::CADKernel::FGrid::InnerNodesCount ( ) const
inline
Returns
the count of inner nodes

◆ IsNodeCloseToLoop()

const bool UE::CADKernel::FGrid::IsNodeCloseToLoop ( int32  Index) const
inline
Returns
true if the node is close to a loop i.e. the loop cross the space [[IndexU - 1, IndexU + 1], [IndexV - 1, IndexV + 1]]

◆ IsNodeFarFromFace()

const bool UE::CADKernel::FGrid::IsNodeFarFromFace ( int32  Index) const
inline
Returns
true if the bits EPointMarker::IsInside, EPointMarker::IsInsideButTooCloseToLoop and EPointMarker::IsCloseToLoop are alls equal to 0

◆ IsNodeInsideAndCloseToLoop()

const bool UE::CADKernel::FGrid::IsNodeInsideAndCloseToLoop ( int32  Index) const
inline

◆ IsNodeInsideAndMeshable()

const bool UE::CADKernel::FGrid::IsNodeInsideAndMeshable ( int32  Index) const
inline
Returns
true if the node is inner the external loop and outer the inner loops and not too close

◆ IsNodeInsideButTooCloseToLoop()

const bool UE::CADKernel::FGrid::IsNodeInsideButTooCloseToLoop ( int32  Index) const
inline

◆ IsNodeOusideFaceButClose()

const bool UE::CADKernel::FGrid::IsNodeOusideFaceButClose ( int32  Index) const
inline
Returns
true if the bits EPointMarker::IsInside and EPointMarker::IsInsideButTooCloseToLoop are booth equal to 0 and EPointMarker::IsCloseToLoop is equal to 1

◆ IsNodeOutsideFace()

const bool UE::CADKernel::FGrid::IsNodeOutsideFace ( int32  Index) const
inline
Returns
true if the bits EPointMarker::IsInside, EPointMarker::IsInsideButTooCloseToLoop and EPointMarker::IsCloseToLoop are alls equal to 0

◆ IsNodeTooCloseToLoop()

const bool UE::CADKernel::FGrid::IsNodeTooCloseToLoop ( int32  Index) const
inline

◆ ProcessPointCloud()

void UE::CADKernel::FGrid::ProcessPointCloud ( )

Process the generated point cloud to compute the scaled parametric spaces and to identify outer points of the face

See also
IsNodeInsideFace
Points2D

◆ RemovePointsCloseToLoop()

void UE::CADKernel::FGrid::RemovePointsCloseToLoop ( )
protected

Find all node close to the boundary. For each node, the 3d distance to the boundary is estimated If this distance is bigger than the Tolerance, the node is remove Removing a node can make its neighbor removable, Each removed node make its direct neighbor removable, the process is recursive as long as it is possible to remove a node

See also
ProcessPointClound (called in ProcessPointClound)

◆ ResetInsideLoop()

void UE::CADKernel::FGrid::ResetInsideLoop ( int32  Index)
inline

◆ ScaleLoops()

void UE::CADKernel::FGrid::ScaleLoops ( )
protected

Projects loop's points in the scaled parametric spaces

See also
FaceLoops2D
ProcessPointClound (called in ProcessPointClound)

◆ SetCloseToLoop()

void UE::CADKernel::FGrid::SetCloseToLoop ( int32  Index)
inline

◆ SetInner2DPoint()

void UE::CADKernel::FGrid::SetInner2DPoint ( EGridSpace  Space,
int32  Index,
const FVector2d NewCoordinate 
)
inline

◆ SetLoop2DPoint()

void UE::CADKernel::FGrid::SetLoop2DPoint ( EGridSpace  Space,
int32  LoopIndex,
int32  Index,
const FVector2d NewCoordinate 
)
inline

◆ SetNodeInside()

void UE::CADKernel::FGrid::SetNodeInside ( int32  Index)
inline

◆ SetTooCloseToLoop()

void UE::CADKernel::FGrid::SetTooCloseToLoop ( int32  Index)
inline

◆ UVIndexFromGlobalIndex()

void UE::CADKernel::FGrid::UVIndexFromGlobalIndex ( int32  GLobalIndex,
int32 OutIndexU,
int32 OutIndexV 
) const
inline
Returns
the Index of the position in the arrays of a point [IndexU, IndexV] of the grid

Member Data Documentation

◆ CoordinateGrid

FCoordinateGrid& UE::CADKernel::FGrid::CoordinateGrid
protected

◆ CountOfInnerNodes

int32 UE::CADKernel::FGrid::CountOfInnerNodes = 0
protected

count of node inside the face i.e. node inside the external loop and outer the inner loops

◆ FaceLoops2D

TArray<TArray<FVector2d> > UE::CADKernel::FGrid::FaceLoops2D[EGridSpace::EndGridSpace]
protected

2D Coordinate of Loop's nodes in each space

◆ FaceLoops3D

TArray<TArray<FVector> > UE::CADKernel::FGrid::FaceLoops3D
protected

3D Coordinate of Loop nodes in each space

◆ FaceTolerance

const FSurfacicTolerance UE::CADKernel::FGrid::FaceTolerance
protected

◆ MeshModel

FModelMesh& UE::CADKernel::FGrid::MeshModel
protected

◆ MinimumElementSize

const double UE::CADKernel::FGrid::MinimumElementSize
protected

◆ MinOfMaxElementSize

double UE::CADKernel::FGrid::MinOfMaxElementSize = 0
protected

◆ NodeIdsOfFaceLoops

TArray<TArray<int32> > UE::CADKernel::FGrid::NodeIdsOfFaceLoops
protected

◆ NodeMarkers

TArray<ENodeMarker> UE::CADKernel::FGrid::NodeMarkers
protected

Array to flag each points as inside, close, ... the face

See also
IsNode...,

◆ NormalsOfFaceLoops

TArray<TArray<FVector3f> > UE::CADKernel::FGrid::NormalsOfFaceLoops
protected

Surface Normal at each boundary nodes


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