Commit Graph

85 Commits

Author SHA1 Message Date
Jimmy Andrews
483735ed38 #jira UE-117587
fixes for potential crash / invalid operations on radial fracture of pillar
 - make 'embed surface path' find the intended start vertex for its path when it's known
 - guard against path being empty before accessing element 0
 - guard against invalid edge collapse in mesh boolean that was triggered by this example

#rb david.hill
#rnx

#ushell-cherrypick of 16760529 by Jimmy.Andrews
#preflight 60d49b4557b30200011a0594

[CL 16775195 by Jimmy Andrews in ue5-main branch]
2021-06-24 12:29:49 -04:00
Ryan Schmidt
e196c256e4 GeometryProcessing: remove forwarding headers used in GeometryCore transition, and update all affected includes.
#rb none
#rnx
#jira none
#preflight 60c52c5db9446100014da02d

[CL 16653115 by Ryan Schmidt in ue5-main branch]
2021-06-13 00:35:22 -04:00
tyson brochu
9d2b0fdde3 Move ConvexHull2, ConvexHull3, and exact predicates into GeometryCore/CompGeom. Change them all to use the UE::Geometry namespace. Copy associated TPS files as needed.
#ushell-cherrypick of 16542896 by swarm
#rb ryan.schmidt

[CL 16575323 by tyson brochu in ue5-main branch]
2021-06-07 15:02:12 -04:00
lonnie li
febb75cece ModelingTools: Fix post op selection for TriEdit: Extrude, Offset, Cut Faces & Duplicate.
#rb michael.balzer
#rnx
#jira UE-114975
#preflight 60baa85f2c42ea0001d65f32

[CL 16562738 by lonnie li in ue5-main branch]
2021-06-04 19:26:45 -04:00
Ryan Schmidt
fdb2bab149 GeometryProcessing: Move MeshConversion module from GeometryProcessing plugin to Runtime. Transfer necessary additional files from DynamicMesh to GeometryCore. Move functions from MeshIndexUtil and MeshAdapterUtil namespaces to UE::Geometry namespace.
#rb none
#rnx
#jira none
#preflight 60a7e75e7d6b060001c61f47

[CL 16428413 by Ryan Schmidt in ue5-main branch]
2021-05-22 01:32:46 -04:00
ryan schmidt
d884513784 GeometryProcessing:
- Skip full-mesh normals computation in OffsetMeshRegion if using vertex normals.
- Add operator[] to MeshConnectedComponents.
- Add FSparseDynamicOctree3::ContainmentQuery() to allow for single-point range query.
- Add FMeshFaceSelection::IsSelectionBoundaryEdge() and optimize ExpandToOneRingNeighbours() and ContractBorderByOneRingNeighbours(), now significantly faster for very large selections. Convert VtxTrianglesItr calls to EnumerateVtxTriangles
- Use TestAnyHitTriangle() instead of FindNearestHitTriangle() in TRemoveOccludedTriangles. Reduces cost from 6.4s to 1.2s on a 64-core threadripper for a large-scale (1.4m triangles) visibility-based removal problem
- Optimize FMarchingCubes implementation for large thread counts. Replace single FCriticalSection with indexed sets of FCriticalSection to reduce thread contention. Instead of directly writing to mesh, accumulate mesh vertices and triangles in separate blocks (hashed on grid coordinates) and then build output mesh after generation completes. Add bEnableValueCaching option to skip caching of corner values, which causes lots of thread contention if Implicit function is very cheap (eg a grid-based SDF evaluation). Enable this option in Morphology meshing. Reduces marching cubes cost from ~3.5s to <500ms on a 64-core threadripper for a large-scale (1.4m triangles) Morphology problem.

#rb jimmy.andrews
#rnx
#jira none

#ROBOMERGE-SOURCE: CL 16370702 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v804-16311228)

[CL 16372561 by ryan schmidt in ue5-main branch]
2021-05-18 14:33:08 -04:00
Andrew Davidson
3ddc3a4da3 Merge up from //UE5/Dev-LargeWorldCoordinates
#rb none

[CL 16211417 by Andrew Davidson in ue5-main branch]
2021-05-05 15:07:25 -04:00
semion piskarev
d3f9125656 MeshModelingTools: Fixing group edge inserter not saving some needed state in retriangulate mode after the undo refactor.
#rb Michael.Balzer
#rnx
#jira none

[CL 16129001 by semion piskarev in ue5-main branch]
2021-04-27 12:21:45 -04:00
tyson brochu
3c41fe626a Make convex hull cancellable when called from GeometryFlow.
#jira UETOOL-3116
#rnx
#rb jimmy.andrews

[CL 16074529 by tyson brochu in ue5-main branch]
2021-04-21 11:35:00 -04:00
semion piskarev
97050f450a MeshModelingTools: Various fixes to make volumes work better with our tools. Specifically:
- Changed triangulation of volume polygons to Delaunay to avoid degenerate tris when possible.
- Added ability to set degenerate tri normals to neighbor normal to avoid creating nonplanar volume polygons if degenerate tris do appear.
- Created a path to use FPolys instead of bsp nodes to convert from volumes, as nodes get broken up arbitrarily.
- Gave volume conversion the ability to preserve group boundary edges.
- Changed PlanarFlipsOptimization to correctly deal with degenerate tris, and to respect group boundaries.
- Added legacy cleanup code that Ryan ported to make volume faces convex.
- Changed our version of the convexity code to avoid arbitrary precision cutoff, and to remove one of the places we were arbitrarily throwing away colinear verts.
- Changed on-the-fly conversion options to not try to fill cracks, as this seems to worsen any problems further.

#rb Jimmy.Andrews, Ryan.Schmidt
#lockdown simon.tourangeau
#rnx
#jira UE-107140

#ROBOMERGE-OWNER: semion.piskarev
#ROBOMERGE-AUTHOR: semion.piskarev
#ROBOMERGE-SOURCE: CL 15953732 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v787-15839533)
#ROBOMERGE-CONFLICT from-shelf

[CL 15971476 by semion piskarev in ue5-main branch]
2021-04-10 10:00:12 -04:00
Ryan Schmidt
196be0f6d1 GeometryProcessing: replace UE::Geometry::FVector3d/FVector3f with UE Core versions based on TVector<T>. FVector3<T> is now an extension of TVector<T>. Update all affected call sites.
#rb none
#rnx
#jira none

[CL 15870068 by Ryan Schmidt in ue5-main branch]
2021-03-30 21:25:22 -04:00
semion piskarev
2b47a6cf86 MeshModelingTools: Changing edge loop insertion and group edge insertion to use undo like PolyEdit does, both to fix invisibility bug and to prep for eventual movement into PolyEdit. Also made loop insertion highlight non-quad groups when a loop is stopped.
#rb Jimmy.Andrews, Ryan.Schmidt
#jira UETOOL-2405, UETOOL-2854
#rnx

#ROBOMERGE-OWNER: semion.piskarev
#ROBOMERGE-AUTHOR: semion.piskarev
#ROBOMERGE-SOURCE: CL 15850950 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v786-15839533)
#ROBOMERGE-CONFLICT from-shelf

[CL 15852933 by semion piskarev in ue5-main branch]
2021-03-29 13:39:32 -04:00
tyson brochu
b75f424e15 Optimize computation of normal deformation in FFD lattice
#rb david.hill
#rnx

[CL 15805617 by tyson brochu in ue5-main branch]
2021-03-24 15:07:27 -04:00
jimmy andrews
958d805e4f cleanup EmbedSurfacePath code: remove unused lambda function
#rb trivial
#rnx
#preflight 605a103be640880001f26970

#ROBOMERGE-OWNER: jimmy.andrews
#ROBOMERGE-AUTHOR: jimmy.andrews
#ROBOMERGE-SOURCE: CL 15779411 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v783-15756269)
#ROBOMERGE-CONFLICT from-shelf

[CL 15787332 by jimmy andrews in ue5-main branch]
2021-03-23 19:06:48 -04:00
Ryan Schmidt
6db97af132 GeometryProcessing: FVector2/3/4 refactoring. Move various member functions to standalone functions in UE::Geometry:: namespace, to simplify upcoming conversion to core vector types. Update all call sites.
#rb tyson.brochu, semion.piskarev
#rnx
#jira none

[CL 15732208 by Ryan Schmidt in ue5-main branch]
2021-03-17 19:32:44 -04:00
Ryan Schmidt
ffe3b401cd GeometryProcessing: move all public types in GeometryProcessing plugin into UE::Geometry:: namespace, as well as some code in MeshModelingToolset. Fix fallout in Water, Paint Mode, ChaosEditor, DataPrep, Text3D, Unit Tests, internal projects.
#rb jimmy.andrews, semion.piskarev
#jira none

[CL 15661651 by Ryan Schmidt in ue5-main branch]
2021-03-09 19:33:56 -04:00
jimmy andrews
caa2f1bf82 refactor jacketing to use one AABB tree per mesh, and transform samples into the local space of each tree, rather than a giant combined AABB tree for all meshes
#ROBOMERGE-SOURCE: CL 15561912 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15561922 by jimmy andrews in ue5-main branch]
2021-03-01 17:01:16 -04:00
ryan schmidt
f9810df402 GeometryProcessing: Added FMeshAttributeTransfer class, currently supports transferring triangle material IDs from one mesh to another, via nearest-point queries
GeometryFlow: Added FCompactMeshNode, FComputeMeshPerVertexOverlayNormalsNode (convenient), and FTransferMeshMaterialIDsNode that applies FMeshAttributeTransfer based on two input meshes. Graph InferConnection() now is more clever and can infer connections in cases where a potentially-ambiguous connection is resolved based on what is already connected (ie if two mesh inputs, and one is assigned, infer that second one is intended)

LODToolset: LODGraph now transfers materials and computes per-vertex normals before Simplify node, and Compacts afterwards (required for other downstream processes).
LODProcess now handles multiple materials, and can re-use input materials if they do not require a baked texture or normal map. In repeat applications, previously-auto-generated StaticMesh Materials are detected and removed from the material set. Normals and Tangents are explicitly computed for stored HiRes source and LOD0, and build settings updated appropriately.

#rb none
#rnx
#jira none
[FYI] tyson.brochu

#ROBOMERGE-SOURCE: CL 15470041 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15470044 by ryan schmidt in ue5-main branch]
2021-02-19 01:48:21 -04:00
ryan schmidt
a64fd037c5 GeometryProcessing: convert debugging sanity check to checkSlow to avoid runtime crashes
#rb none
#rnx
#jira none

#ROBOMERGE-SOURCE: CL 15448203 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15454438 by ryan schmidt in ue5-main branch]
2021-02-18 13:19:55 -04:00
tyson brochu
91859c599d Deform mesh normals in FFDLattice. Computes the Jacobian of the trilinear or tricubic interpolation functions and rotates the original normals by the inverse Jacobian transpose times the determinant of the Jacobian.
#rb jimmy.andrews david.hill
#rnx
#jira none

[CL 15454087 by tyson brochu in ue5-main branch]
2021-02-18 13:06:34 -04:00
Jimmy Andrews
3161509eca Add mesh quality criteria to boolean mesh simplification algorithm; don't collapse edges when it would make bad triangles even worse.
+ fix a bunch of smaller bugs w/ mesh boolean

#rb david.hill
#rnx

[CL 15420453 by Jimmy Andrews in ue5-main branch]
2021-02-16 14:40:20 -04:00
Jimmy Andrews
29ca4d2e51 add option to improve geometry on mesh boolean during the boolean operation itself, rather than as a post-process, which should be faster and work even if the edges aren't welded
(plus same for mesh self-union)

#rb tyson.brochu
#rnx

[CL 15385252 by Jimmy Andrews in ue5-main branch]
2021-02-11 01:44:27 -04:00
Ryan Schmidt
c48788b722 GeometryProcessing:
Add insights profiling tags to RemeshMeshOp and FRemesher. Small optimizations to FRemesher::ProcessEdge(), which has surprising overhead for no-ops (ie edge is not modified).
Add FUniqueIndexSet, alternative to a TSet for constructing list of unique indices (eg when finding set of one-ring tris of a list of vertices). Generally more efficient, particularly for large sets.
Improve FSubRegionRemesher. Make VertexROI private, provide accessors and update usage sites. Optimize InitializeFromVertexROI(), which is an expensive part of dynamic mesh sculpting. Make FullSmoothPass_Buffer() compute in parallel.

ModelingTools:
Major refactor of DynamicMeshSculptTool to improve performance (2-4x improvement on large brush sizes on 1m triangle mesh). A single FSubRegionRemesher is now created and maintained for entire brush stroke, rather than recreating every stamp. This avoids the high cost of initialzing full-mesh constraint set, and allows re-use of various allocated memory buffers. Reorganize major sub-steps computed in a single brush-stamp tick to allow Async computation where possible. Replace some ROI TSets with FUniqueIndexSet. Instrument for Insights, remove old cycle counting.

#rb none
#rnx
#jira none

[CL 15215321 by Ryan Schmidt in ue5-main branch]
2021-01-27 01:53:01 -04:00
Jimmy Andrews
67deaeddc0 Clean up of VoxWrap, VoxBlend, and VoxMorphology
- Rename "offset" to the more accurate "thicken shells"
 - More consistent clamp min thickening based on voxel resolution
 - Only apply thickening to meshes that are actually shells (i.e. have open boundaries)
 - Improve related comments and variable names

#rb david.hill

[CL 15118588 by Jimmy Andrews in ue5-main branch]
2021-01-15 17:33:35 -04:00
semion piskarev
30aeed7a1f MeshModelingTools: Added ability for gizmo to be repositioned using middle mouse, and used it iin Transform and PolyEdit tools. Added ability for gizmo to snap to nearby geometry when pressing Ctrl, and used it in Transform and PolyEdit tools.
#rb Ryan.Schmidt
#jira none
#rnx

[CL 15098499 by semion piskarev in ue5-main branch]
2021-01-14 19:07:52 -04:00