Commit Graph

71 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
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
Ryan Schmidt
6783e1ee61 GeometryProcessing:
Add FDynamicMeshEditor::AppendMesh() variant that takes a TTriangleMeshAdapter<double>
Add FMeshDescriptionMeshAdapterd that wraps FMeshDescriptionTriangleMeshAdapter in TTriangleMeshAdapter<double> API
Add TTransform3::HasNonUniformScale()
#rb david.hill
#rnx
#jira none
#preflight 609a0a570ba7b600013cce27

[CL 16278551 by Ryan Schmidt in ue5-main branch]
2021-05-11 15:50:30 -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
Ryan Schmidt
3ee8ff857f GeometryProcessing: define FVector2i/3i, FInterval1i, and FAxisAlignedBox2i/3i as explicit classes rather than template instantiations of real-vector types. Update usage. This is necessary to avoid conflict with engine LWC vector template types.
#rb none
#rnx
#jira none

[CL 15792712 by Ryan Schmidt in ue5-main branch]
2021-03-24 01:53:29 -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
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
tyson brochu
49d64a7e11 Add a Thicken node to GeometryFlow. Accepts vertex weights and a scalar and moves vertices in the normal direction accordingly.
#jira UETOOL-2943
#rb jimmy.andrews

#ROBOMERGE-OWNER: tyson.brochu
#ROBOMERGE-AUTHOR: tyson.brochu
#ROBOMERGE-SOURCE: CL 15424119 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
#ROBOMERGE-CONFLICT from-shelf

[CL 15426283 by tyson brochu in ue5-main branch]
2021-02-16 19:58:02 -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
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
Jimmy Andrews
a0f1437af0 add option to shrink (erode) the set of triangles removed by the jacketing tool
#rb tyson.brochu

[CL 14984287 by Jimmy Andrews in ue5-main branch]
2021-01-04 16:55:56 -04:00
Jimmy Andrews
ef78fd3601 for self-union, check if winding would remove the triangle before checking for coplanarity. Otherwise, we could erroneously keep geometry that is 'inside' the combined surface just because it's coplanar with other geometry.
#rb tyson.brochu
#rnx

[CL 14955164 by Jimmy Andrews in ue5-main branch]
2020-12-18 12:32:00 -04:00
tyson brochu
e70f34f410 Add an option to pre-filter mesh vertices before computing convex hull. Result is not a convex hull in general, but might be faster to compute.
#jira UETOOL-2786
#rnx
#rb jimmy.andrews

[CL 14942978 by tyson brochu in ue5-main branch]
2020-12-16 18:35:29 -04:00
Ryan Schmidt
ad9f0ea712 GeometryProcessing: add DynamicMeshAttributeSet::SplitAllBowties() function, splits bowties in NormalOverlay and UVOverlays
ModelingTools: Expose Simplify To Minimal Planar simplification mode in Simplify Tool. Add edge filter to this simplification mode in TMeshSimplification. Add support for returning all edges along intersection curves in FMeshBoolean and FMeshSelfUnion. Add option BooleanMeshesOp and SelfUnionMeshesOp to apply minimal-planar simplification along these cut/intersection edges. Expose as toggles in CSGMeshesTool and SelfUnionMeshesTool
#rb jimmy.andrews
#rnx
#jira none

[CL 14890297 by Ryan Schmidt in ue5-main branch]
2020-12-09 14:18:38 -04:00