UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ParametricFaceMesher.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "Core/Chrono.h"
5#include "Core/Types.h"
7
8namespace UE::CADKernel
9{
10class FCriterion;
11class FGrid;
12class FMeshingTolerances;
13class FThinZoneSide;
14class FThinZone2D;
15class FTopologicalEntity;
16class FTopologicalLoop;
17
18namespace ParametricMesherTool
19{
20
68
69
71{
72private:
73 const TArray<FEdgeSegment>& Side1Segments;
74 const TArray<FEdgeSegment>& Side2Segments;
75 TArray<FCrossZoneElement*> SelectedCrossZoneElement;
76
77public:
78
85
87 {
88 FSegment2D CrossZoneSegment(CrossZoneElement.VertexPoint2D, CrossZoneElement.OppositePoint2D);
89 if (IsIntersectSide(Side1Segments, CrossZoneSegment) || IsIntersectSide(Side2Segments, CrossZoneSegment) || IsIntersectCrossZoneElement(CrossZoneSegment))
90 {
91 return true;
92 }
93 return false;
94 }
95
97 {
98 SelectedCrossZoneElement.Add(&Element);
99 }
100
101private:
102
103 bool IsIntersectSide(const TArray<FEdgeSegment>& Segments, const FSegment2D& CrossZoneSegment)
104 {
105 for (const FEdgeSegment& Segment : Segments)
106 {
107 FSegment2D SideSegment(Segment.GetExtemity(Start), Segment.GetExtemity(End));
108
110 {
111 return true;
112 }
113 }
114 return false;
115 }
116
117 bool IsIntersectCrossZoneElement(const FSegment2D& CrossZoneSegment)
118 {
119 for (const FCrossZoneElement* Segment : SelectedCrossZoneElement)
120 {
121 FSegment2D SideSegment(Segment->VertexPoint2D, Segment->OppositePoint2D);
122
124 {
125 return true;
126 }
127 }
128 return false;
129 }
130};
131
132}
133
135{
136protected:
139
141 bool bThinZoneMeshing = false;
142
144
145public:
146
148
149 void Mesh();
150
151private:
152
153 void Mesh(FTopologicalEdge& InEdge, bool bFinalMeshing = true);
155 void MeshVerticesOfFace(FTopologicalFace& Face);
156 bool MeshPlanarFace();
157
158 void MeshFaceLoops();
159
160
161 void ApplyEdgeCriteria(FTopologicalEdge& Edge);
162
166 bool GenerateCloud();
167
168 // Thin zone meshing data / context =================================================================
169 TArray<FThinZone2D*> WaitingThinZones;
170
171 TArray<FTopologicalEdge*> ZoneAEdges;
172 TArray<FTopologicalEdge*> ZoneBEdges;
173
174 // Meshing thin zone methodes =================================================================
178 void MeshThinZones();
179 void MeshThinZones(TArray<FThinZone2D*>& ThinZones);
180
185 void SortThinZoneSides(TArray<FThinZone2D*>& ThinZones);
186
187 void MeshThinZones(TArray<FTopologicalEdge*>& EdgesToMesh, const bool bFinalMeshing);
188
189 void MeshThinZoneSide(FThinZoneSide& Side, bool bFinalMeshing);
190 void DefineImposedCuttingPointsBasedOnOtherSideMesh(FThinZoneSide& SideToConstrain);
191
192#ifdef CADKERNEL_DEBUG
194 void DisplayThinZoneEdges(const TCHAR* Text, TArray<FTopologicalEdge*>& Edges, EVisuProperty Color, EVisuProperty Color2);
195#endif
196
197};
198
199} // namespace UE::CADKernel
200
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
@ Vertex
Definition MetalRHIPrivate.h:223
Definition Array.h:670
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
UE_FORCEINLINE_HINT void Reserve(SizeType Number)
Definition Array.h:3016
Definition EdgeSegment.h:22
Definition Grid.h:46
Definition ParametricMesherConstantes.h:17
Definition ModelMesh.h:21
Definition ParametricFaceMesher.h:135
FModelMesh & MeshModel
Definition ParametricFaceMesher.h:138
void Mesh()
Definition ParametricFaceMesher.cpp:44
const FMeshingTolerances & Tolerances
Definition ParametricFaceMesher.h:140
FGrid Grid
Definition ParametricFaceMesher.h:143
FTopologicalFace & Face
Definition ParametricFaceMesher.h:137
bool bThinZoneMeshing
Definition ParametricFaceMesher.h:141
Definition ThinZone2D.h:40
Definition TopologicalEdge.h:63
Definition TopologicalFace.h:56
Definition TopologicalVertex.h:83
Definition ParametricFaceMesher.h:71
bool IsIntersectSides(const FCrossZoneElement &CrossZoneElement)
Definition ParametricFaceMesher.h:86
void AddCrossZoneElement(FCrossZoneElement &Element)
Definition ParametricFaceMesher.h:96
FIntersectionTool(const TArray< FEdgeSegment > &InSide1Segments, const TArray< FEdgeSegment > &InSide2Segments, int32 MaxCrossZoneElementCount)
Definition ParametricFaceMesher.h:79
Definition CADEntity.cpp:23
bool DoIntersectInside(const FSegment2D &SegmentAB, const FSegment2D &SegmentCD)
Definition Geometry.cpp:252
@ Undefined
Definition GeoEnum.h:89
TSegment< FVector2d > FSegment2D
Definition Geometry.h:286
@ End
Definition GeoEnum.h:101
@ Start
Definition GeoEnum.h:100
EVisuProperty
Definition Visu.h:15
@ Element
Definition Visu.h:18
Definition Types.h:33
void Add(const int32 Value)
Definition Types.h:59
Definition ParametricFaceMesher.h:22
FCrossZoneElement(const int32 InVertexId, const FVector2d InPoint2D, const double InTolerance3D, const FEdgeSegment *InSegment, const FPairOfIndex &InOppositeVertexIndices)
Definition ParametricFaceMesher.h:37
const double Tolerance3D
Definition ParametricFaceMesher.h:25
FPairOfIndex OppositeVertexIndices
Definition ParametricFaceMesher.h:27
FCrossZoneElement()
Definition ParametricFaceMesher.h:50
FVector2d VertexPoint2D
Definition ParametricFaceMesher.h:24
const FEdgeSegment * Segment
Definition ParametricFaceMesher.h:26
double SquareThickness
Definition ParametricFaceMesher.h:33
const int32 VertexId
Definition ParametricFaceMesher.h:23
FEdgeSegment * OppositeSegment
Definition ParametricFaceMesher.h:30
double OppositePointCoordinate
Definition ParametricFaceMesher.h:31
bool bIsSelected
Definition ParametricFaceMesher.h:35
void Add(const FPairOfIndex &VertexIndices)
Definition ParametricFaceMesher.h:63
FVector2d OppositePoint2D
Definition ParametricFaceMesher.h:29
Definition Geometry.h:250