31 const double Coordinate = 0;
32 const int32 OppositNodeIndex = -1;
47template<
typename FCuttingPo
intType>
69 const double FactorToComputeMaxTol = 0.1;
82 mutable double Length3D = -1.;
85 mutable double Max2DTolerance = -1;
148 bool CheckVertices();
169 FTopologicalEdge::Empty();
172 virtual void Empty()
override;
177 SerializeIdent(Ar, StartVertex);
178 SerializeIdent(Ar, EndVertex);
179 SerializeIdent(Ar,
Curve);
181 SerializeIdent(Ar, &
Loop);
183 Max2DTolerance = Length3D * FactorToComputeMaxTol;
191 StartVertex->ResetMarkersRecursively();
192 EndVertex->ResetMarkersRecursively();
194 Curve->ResetMarkersRecursively();;
203 return GetCurve()->GetCarrierSurface()->Get3DTolerance();
208 return FMath::Min(Max2DTolerance, GetCurve()->GetToleranceAt(Coordinate));
213 return EEntity::TopologicalEdge;
224 bool CheckIfDegenerated()
const;
295 if (TwinEdges.
Num() > 1)
297 return TwinEdges[0] ==
this ? TwinEdges[1] : TwinEdges[0];
317 return StartVertex->GetLinkActiveEntity() == EndVertex->GetLinkActiveEntity();
410 return (
Vertex.GetLink() == StartVertex->GetLink() ? EndVertex.
Get() : (
Vertex.GetLink() == EndVertex->GetLink() ? StartVertex.
Get() :
nullptr));
415 return (
Vertex.GetLink() == StartVertex->GetLink() ? EndVertex.
Get() : (
Vertex.GetLink() == EndVertex->GetLink() ? StartVertex.
Get() :
nullptr));
451 return StartVertex->GetBarycenter();
459 return EndVertex->GetBarycenter();
467 return StartVertex->GetCoordinates();
475 return EndVertex->GetCoordinates();
481 GetTangentsAtExtremities(StartTangent, EndTangent,
Orientation == EOrientation::Front);
488 if (GetLinkActiveEntity() != AsShared())
490 return GetLinkActiveEdge()->GetMesh();
505 void RemovePreMesh();
518 void ComputeCrossingPointCoordinates();
520 int32 EvaluateCuttingPointNum();
528 CrossingPointDeltaUMaxs.
Init(2.0 * (GetEndCurvilinearCoordinates() - GetStartCurvilinearCoordinates()),
Size - 1);
533 return CrossingPointUs;
538 return CrossingPointUs;
543 return CrossingPointDeltaUMins;
548 return CrossingPointDeltaUMaxs;
553 return CrossingPointDeltaUMaxs;
560 if (Coordinate < CrossingPointUs[
Index + 1])
567 if(Coordinate < CrossingPointUs[1])
573 return CrossingPointDeltaUMaxs[
Index];
578 return CuttingPointUs;
583 return CuttingPointUs;
596 void SortImposedCuttingPoints();
600 return ImposedCuttingPointUs;
614 return ThinZoneSides.
Num();
619 return ThinZoneSides;
624 return ThinZoneBounds;
628 void AddTwinsCuttingPoint(
const double Coord,
const double DeltaU);
630 void GenerateMeshElements(
FModelMesh& MeshModel);
636 return Curve.ToSharedRef();
641 return Curve.ToSharedRef();
644 void ComputeLength();
721 template<
class Po
intType>
757 template<
class Po
intType>
763 double TransformLocalCoordinateToActiveEdgeCoordinate(
const double LocalCoordinate)
const;
781 void Offset2D(
const FVector2d& OffsetDirection);
800 bool IsSharpEdge()
const;
813 return FHaveStates::IsDegenerated();
864 return GetTwinEntityCount() == 1;
872 return GetTwinEntityCount() == 2;
890 double StandardDeviation = 0;
891 double MediumSlope = 0;
893 EIso IsoType = EIso::UndefinedIso;
894 bool bIsMesh =
false;
895 double MeshedLength = 0;
902 StandardDeviation += Temp;
910 MediumSlope = MediumSlope * Length3D +
Property.MediumSlope *
Property.Length3D;
913 MediumSlope /= Length3D;
914 StandardDeviation /= Length3D;
916 StandardDeviation =
sqrt(StandardDeviation);
922 StandardDeviation +=
Property.StandardDeviation;
923 MediumSlope +=
Property.MediumSlope;
929 MediumSlope /= Length3D;
930 StandardDeviation /= Length3D;
932 if (StandardDeviation < 0)
934 StandardDeviation = 0;
938 StandardDeviation =
sqrt(StandardDeviation);
940 IsoType = EIso::UndefinedIso;
942 if (MediumSlope < 0.2)
944 if (StandardDeviation < 0.1)
946 IsoType = EIso::IsoU;
949 else if (MediumSlope > 1.8)
951 if (StandardDeviation < 0.1)
953 IsoType = EIso::IsoV;
971 double IsoDeltaU = 0;
1013 return Coordinates[
Iso];
1019 return Coordinates[
Iso];
1024template<
typename FCuttingPo
intType>
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define ensureCADKernel(InExpression)
Definition Types.h:115
#define DOUBLE_SMALL_NUMBER
Definition UnrealMathUtility.h:72
uint32 Size
Definition VulkanMemory.cpp:4034
UE_REWRITE SizeType Num() const
Definition Array.h:1144
void SetNum(SizeType NewNum, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2308
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
void Init(const ElementType &Element, SizeType Number)
Definition Array.h:3043
UE_FORCEINLINE_HINT SizeType AddUnique(ElementType &&Item)
Definition Array.h:2993
Definition AndroidPlatformMisc.h:14
Definition SharedPointer.h:692
UE_FORCEINLINE_HINT ObjectType * Get() const
Definition SharedPointer.h:1065
TSharedRef< ObjectType, Mode > ToSharedRef() const &
Definition SharedPointer.h:1028
Definition SharedPointer.h:153
Definition CADKernelArchive.h:19
Definition CADEntity.h:56
Definition ModelMesh.h:21
Definition TopologicalLoop.h:21
Definition SurfacicPolyline.h:30
Definition ThinZone2D.h:157
Definition ThinZone2D.h:40
Definition TopologicalEdge.h:63
void Unlink()
Definition TopologicalEdge.h:260
TArray< FCuttingPoint > CuttingPointUs
Definition TopologicalEdge.h:94
bool IsThinPeak() const
Definition TopologicalEdge.h:829
const TArray< FImposedCuttingPoint > & GetImposedCuttingPoints() const
Definition TopologicalEdge.h:598
FTopologicalVertex * GetOtherVertex(FTopologicalVertex &Vertex)
Definition TopologicalEdge.h:408
TArray< double > & GetCrossingPointUs()
Definition TopologicalEdge.h:536
TArray< FThinZoneSide * > ThinZoneSides
Definition TopologicalEdge.h:101
FVector GetTangentAt(const double InCoordinate) const
Definition TopologicalEdge.h:702
TSharedRef< const FTopologicalEdge > GetLinkActiveEdge() const
Definition TopologicalEdge.h:266
FVector GetStartBarycenter()
Definition TopologicalEdge.h:449
virtual void SetVirtuallyMeshedMarker() const
Definition TopologicalEdge.h:849
const TSharedPtr< FTopologicalVertex > GetOtherVertex(const TSharedRef< FTopologicalVertex > &Vertex) const
Definition TopologicalEdge.h:418
virtual EEntity GetEntityType() const override
Definition TopologicalEdge.h:211
const TSharedRef< FTopologicalVertex > GetEndVertex(EOrientation Forward) const
Definition TopologicalEdge.h:368
const FLinearBoundary & GetBoundary() const
Definition TopologicalEdge.h:431
const TArray< double > & GetDeltaUMaxs() const
Definition TopologicalEdge.h:551
TSharedPtr< FTopologicalVertex > EndVertex
Definition TopologicalEdge.h:74
virtual ~FTopologicalEdge() override
Definition TopologicalEdge.h:167
const TSharedRef< FTopologicalVertex > GetStartVertex() const
Definition TopologicalEdge.h:383
TArray< double > & GetDeltaUMins()
Definition TopologicalEdge.h:541
virtual void Serialize(FCADKernelArchive &Ar) override
Definition TopologicalEdge.h:174
const FEdgeMesh * GetMesh() const
Definition TopologicalEdge.h:486
const TArray< FCuttingPoint > & GetCuttingPoints() const
Definition TopologicalEdge.h:581
TArray< FImposedCuttingPoint > ImposedCuttingPointUs
Definition TopologicalEdge.h:99
TArray< double > & GetDeltaUMaxs()
Definition TopologicalEdge.h:546
virtual bool IsDegenerated() const override
Definition TopologicalEdge.h:811
FVector GetStartCoordinate()
Definition TopologicalEdge.h:465
void ProjectPoints(const TArray< FVector > &InPointsToProject, TArray< double > &OutProjectedPointCoords, TArray< FVector > &OutProjectedPoints) const
Definition TopologicalEdge.h:730
void AddThinZone(FThinZoneSide *InThinZoneSide, const FLinearBoundary &InThinZoneBounds)
Definition TopologicalEdge.h:603
void Approximate2DPoints(const TArray< double > &InCoordinates, TArray< FVector2d > &OutPoints) const
Definition TopologicalEdge.h:689
bool IsVirtuallyMeshed() const
Definition TopologicalEdge.h:844
const TArray< FLinearBoundary > & GetThinZoneBounds() const
Definition TopologicalEdge.h:622
TSharedPtr< FTopologicalVertex > GetOtherVertex(const TSharedRef< FTopologicalVertex > &Vertex)
Definition TopologicalEdge.h:403
FLinearBoundary Boundary
Definition TopologicalEdge.h:79
double GetDeltaUFor(double Coordinate, int32 &Index) const
Definition TopologicalEdge.h:556
TArray< double > CrossingPointDeltaUMins
Definition TopologicalEdge.h:112
FTopologicalLoop * GetLoop()
Definition TopologicalEdge.h:351
double GetTolerance3D() const
Definition TopologicalEdge.h:201
bool IsBorder() const
Definition TopologicalEdge.h:862
FVector2d GetTangent2DAt(const double InCoordinate) const
Definition TopologicalEdge.h:707
double GetTolerance2DAt(double Coordinate) const
Definition TopologicalEdge.h:206
virtual void ResetMarkersRecursively() const override
Definition TopologicalEdge.h:188
virtual void ResetThinPeakMarker() const
Definition TopologicalEdge.h:839
FVector2d Approximate2DPoint(const double InCoordinate) const
Definition TopologicalEdge.h:681
TArray< FCuttingPoint > & GetCuttingPoints()
Definition TopologicalEdge.h:576
void GetDiscretization2DPoints(EOrientation Orientation, TArray< PointType > &OutPoints) const
Definition TopologicalEdge.h:758
const TArray< double > & GetCrossingPointUs() const
Definition TopologicalEdge.h:531
void ApproximatePolyline(FSurfacicPolyline &Polyline) const
Definition TopologicalEdge.h:697
const TSharedRef< FTopologicalVertex > GetEndVertex(bool Forward) const
Definition TopologicalEdge.h:378
virtual void SetThinPeakMarker() const
Definition TopologicalEdge.h:834
TSharedRef< FTopologicalEdge > GetLinkActiveEdge()
Definition TopologicalEdge.h:271
TSharedRef< FRestrictionCurve > GetCurve() const
Definition TopologicalEdge.h:634
bool IsSurfacic() const
Definition TopologicalEdge.h:870
TArray< double > CrossingPointDeltaUMaxs
Definition TopologicalEdge.h:117
const FTopologicalLoop * GetLoop() const
Definition TopologicalEdge.h:343
const FTopologicalVertex * GetOtherVertex(const FTopologicalVertex &Vertex) const
Definition TopologicalEdge.h:413
TSharedRef< FRestrictionCurve > GetCurve()
Definition TopologicalEdge.h:639
TSharedPtr< FEdgeMesh > Mesh
Definition TopologicalEdge.h:89
double GetEndCurvilinearCoordinates() const
Definition TopologicalEdge.h:441
FVector GetEndBarycenter()
Definition TopologicalEdge.h:457
void InitDeltaUs()
Definition TopologicalEdge.h:522
int32 GetThinZoneCount() const
Definition TopologicalEdge.h:612
TSharedPtr< FTopologicalVertex > StartVertex
Definition TopologicalEdge.h:73
FVector GetEndCoordinate()
Definition TopologicalEdge.h:473
void ApproximatePoints(const TArray< double > &InCoordinates, TArray< FVector > &OutPoints) const
Definition TopologicalEdge.h:673
TSharedPtr< FRestrictionCurve > Curve
Definition TopologicalEdge.h:81
TArray< FLinearBoundary > ThinZoneBounds
Definition TopologicalEdge.h:102
TArray< double > CrossingPointUs
Definition TopologicalEdge.h:107
bool IsClosed() const
Definition TopologicalEdge.h:315
const TSharedRef< FTopologicalVertex > GetStartVertex(bool Forward) const
Definition TopologicalEdge.h:373
FTopologicalEdge * GetTwinEdge() const
Definition TopologicalEdge.h:292
TSharedRef< FTopologicalVertex > GetEndVertex()
Definition TopologicalEdge.h:398
const TSharedRef< FTopologicalVertex > GetStartVertex(EOrientation Forward) const
Definition TopologicalEdge.h:363
double GetStartCurvilinearCoordinates() const
Definition TopologicalEdge.h:436
void GetTangentsAtExtremities(FVector &StartTangent, FVector &EndTangent, EOrientation Orientation) const
Definition TopologicalEdge.h:479
void ProjectTwinEdgePoints(const TArray< FVector > &InPointsToProject, bool bSameOrientation, TArray< double > &OutProjectedPointCoords) const
Definition TopologicalEdge.h:738
FTopologicalEdge * GetPreMeshedTwin()
Definition TopologicalEdge.h:508
void ComputeIntersectionsWithIsos(const TArray< double > &InIsoCoordinates, const EIso InTypeIso, const FSurfacicTolerance &ToleranceIso, TArray< double > &OutIntersection) const
Definition TopologicalEdge.h:749
void EvaluatePoint(double InCoordinate, int32 Derivative, FCurvePoint &Point) const
Definition TopologicalEdge.h:656
void GetExtremities(FSurfacicCurveExtremities &Extremities) const
Definition TopologicalEdge.h:776
const TArray< FThinZoneSide * > & GetThinZoneSides() const
Definition TopologicalEdge.h:617
virtual void ResetVirtuallyMeshedMarker() const
Definition TopologicalEdge.h:854
FTopologicalEdge * GetFirstTwinEdge() const
Definition TopologicalEdge.h:276
double ProjectPoint(const PointType &InPointToProject, PointType &OutProjectedPoint) const
Definition TopologicalEdge.h:722
TSharedRef< FTopologicalVertex > GetStartVertex()
Definition TopologicalEdge.h:393
const TSharedRef< FTopologicalVertex > GetEndVertex() const
Definition TopologicalEdge.h:388
void EvaluatePoints(const TArray< double > &InCoordinates, int32 DerivativeOrder, TArray< FCurvePoint > &OutPoints) const
Definition TopologicalEdge.h:665
Definition TopologicalFace.h:56
Definition TopologicalLoop.h:60
Definition TopologicalVertex.h:83
Definition TopologicalLink.h:17
Definition CADEntity.cpp:23
EOrientation
Definition GeoEnum.h:82
TTopologicalLink< FTopologicalEdge > FEdgeLink
Definition TopologicalEdge.h:17
ECoordinateType
Definition MeshEnum.h:32
@ OtherCoordinate
Definition MeshEnum.h:38
void GetCuttingPointCoordinates(const TArray< FCuttingPointType > &CuttingPoints, TArray< double > &CuttingPointCoordinates)
Definition TopologicalEdge.h:1025
EIso
Definition GeoEnum.h:66
@ Curve
Definition Visu.h:19
@ Iso
Definition Visu.h:20
EEntity
Definition CADEntity.h:18
U16 Index
Definition radfft.cpp:71
static constexpr UE_FORCEINLINE_HINT T Square(const T A)
Definition UnrealMathUtility.h:578
Definition TopologicalEdge.h:1007
constexpr const TArray< FCuttingPoint > & operator[](EIso Iso) const
Definition TopologicalEdge.h:1016
constexpr TArray< FCuttingPoint > & operator[](EIso Iso)
Definition TopologicalEdge.h:1010
Definition TopologicalEdge.h:964
ECoordinateType Type
Definition TopologicalEdge.h:969
FPairOfIndex OppositNodeIndices
Definition TopologicalEdge.h:970
FCuttingPoint(double InCoordinate, ECoordinateType InType)
Definition TopologicalEdge.h:981
FCuttingPoint(double InCoordinate, ECoordinateType InType, int32 InOppositeNodeId, double DeltaU)
Definition TopologicalEdge.h:997
FCuttingPoint()
Definition TopologicalEdge.h:973
double Coordinate
Definition TopologicalEdge.h:968
FCuttingPoint(double InCoordinate, ECoordinateType InType, FPairOfIndex InOppositNodeIndices, double DeltaU)
Definition TopologicalEdge.h:989
Definition TopologicalEdge.h:889
void Add2(FEdge2DProperties &Property)
Definition TopologicalEdge.h:907
void Add(double InSlope, double InLength)
Definition TopologicalEdge.h:897
void Add(FEdge2DProperties &Property)
Definition TopologicalEdge.h:920
void Finalize()
Definition TopologicalEdge.h:927
Definition TopologicalEdge.h:27
FImposedCuttingPoint()
Definition TopologicalEdge.h:35
FImposedCuttingPoint(const double InCoordinate, const int32 NodeIndex1, const double InDeltaU=0.)
Definition TopologicalEdge.h:39
constexpr double GetMin() const
Definition Boundary.h:61
constexpr double GetMax() const
Definition Boundary.h:66