Files
UnrealEngineUWP/Engine/Plugins/Runtime/GeometryProcessing/Source/DynamicMesh/Public/Operations/PolyEditingEdgeUtil.h
ryan schmidt 8c5b55b152 GeometryProcessing: Refactor edge-loop inset calculation code from InsetMeshRegion into new utility functions in PolyEditingEdgeUtil.h. Use in FMeshBevel::DisplaceVertices() to improve edge insetting. Also add FMeshBevel::FixUpUnlinkedBevelEdges(), to repair vertex and edge ID lsits in unlinked open-span edges after unlinking vertices.
#rnx
#jira none
#preflight 61821056dd10170001f4d541

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 18041664 in //UE5/Release-5.0/... via CL 18041669
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v885-17909292)
#ROBOMERGE[STARSHIP]: UE5-Main

[CL 18041673 by ryan schmidt in ue5-release-engine-test branch]
2021-11-03 17:40:43 -04:00

58 lines
1.7 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "MathUtil.h"
#include "VectorTypes.h"
#include "IntVectorTypes.h"
#include "GeometryTypes.h"
#include "LineTypes.h"
class FProgressCancel;
namespace UE
{
namespace Geometry
{
class FDynamicMesh3;
/**
* For each edge in EdgeList, compute a line segment offset from the original edge by
* distance InsetDistance. Assumes that each Edge is a boundary edge and so Triangle0
* of that edge defines "inside" direction.
*/
DYNAMICMESH_API void ComputeInsetLineSegmentsFromEdges(
const FDynamicMesh3& Mesh,
const TArray<int32>& EdgeList,
double InsetDistance,
TArray<FLine3d>& InsetLinesOut );
/**
* For each vertex in VertexIDs, compute inset position based on list of precomputed
* inset lines and store in VertexPositionsOut. Assumption is that each vertex position
* was at the intersection point of the pre-inset lines, ie sequential edge-line-pairs
* determine each sequential vertex position
* @param bIsLoop if true, vertex list is treated as a loop, otherwise as an open span
*/
DYNAMICMESH_API void SolveInsetVertexPositionsFromInsetLines(
const FDynamicMesh3& Mesh,
const TArray<FLine3d>& InsetEdgeLines,
const TArray<int32>& VertexIDs,
TArray<FVector3d>& VertexPositionsOut,
bool bIsLoop);
/**
* Solve for a new inset position by finding the intersection point
* a pair of inset-lines (or handle parallel-lines case). Assumption
* is that Position is the location of the initial vertex on the
* pre-inset edge-line-pair, ie at their intersection point.
*/
DYNAMICMESH_API FVector3d SolveInsetVertexPositionFromLinePair(
const FVector3d& Position,
const FLine3d& InsetEdgeLine1,
const FLine3d& InsetEdgeLine2);
} // end namespace UE::Geometry
} // end namespace UE