Commit Graph

87 Commits

Author SHA1 Message Date
jimmy andrews
78d8ab4884 deprecate convex decomposition's negative space compute's assumption of default-flipped triangle orientations by making the triangle orientation an explicit function parameter (rather than a settings struct member) and deprecating the old function w/out this parameter.
#rb matija.kecman

[CL 29321127 by jimmy andrews in ue5-main branch]
2023-11-01 12:20:40 -04:00
jimmy andrews
609a443699 Fix performance and memory issues when merging a large number of collision shapes:
- More aggressively prune the cache of computed merge shapes after it reaches a threshold size
 - By default compute a proximity graph based on actual proximity, not the full n^2 possible connections
 - After finding the best of a number of possilbe merges, optionally only look for local improvements to the current best rather than doing a full search for the absolute best connection.

#rb david.hill, shaun.kime

[CL 29158488 by jimmy andrews in ue5-main branch]
2023-10-26 20:24:56 -04:00
jimmy andrews
dcdd199f26 expose out convex decomposition negative space's voxel search 'min voxels per dimension' parameter to the setting structs, rather than hardcoding it as 128
#rb tyson.brochu

[CL 28877619 by jimmy andrews in ue5-main branch]
2023-10-18 11:04:33 -04:00
jimmy andrews
f0d473d3d5 expose min part thickness out to geometry script collision functions + make min part thickness apply with compact shapes (just skipping the inapplicable cutting step)
#rb shaun.kime

[CL 28829793 by jimmy andrews in ue5-main branch]
2023-10-16 23:03:12 -04:00
jimmy andrews
f3260123e2 add outer-only negative space sampling via continuation marching cubes
#rb tyson.brochu, rinat.abdrashitov

[CL 28771065 by jimmy andrews in ue5-main branch]
2023-10-13 16:45:04 -04:00
jimmy andrews
64873765ab fix crash in convex hull simplification due to not tracking polygon group IDs correctly
#rb rinat.abdrashitov

[CL 28552567 by jimmy andrews in ue5-main branch]
2023-10-06 15:11:54 -04:00
jimmy andrews
4a3292849c Fix issue in negative space voxel mesh generation where eroding the (convex hull - original mesh) by the distance tolerance could delete valid negative space when the convex hull was thinner than the distance tolerance.
We now directly construct the initial voxel mesh to be the tolerance distance from the input mesh (while allowing it to follow the convex hull), and also ensure clamp the grid cell size to not be larger than half the width of the region bounding box's min dimension.

[CL 28455930 by jimmy andrews in ue5-main branch]
2023-10-04 10:41:47 -04:00
jimmy andrews
ced12de0f4 Add negative space protection to the geometry script collision merging algorithm
#rb david.hill

[CL 28234875 by jimmy andrews in ue5-main branch]
2023-09-26 12:59:58 -04:00
jimmy andrews
2d32fa2e5f Add a MergeSimpleCollisionShapes function to Geometry Script, which can reduce the number of simple collision shapes by merging them. Currently works via convex hull merging, so merged shapes will always be convex hulls, but shapes that are not merged will be left with their original type.
Add a 'source ID' concept to the convex part decomposition, to enable tracking of which hulls were not merged to any other hulls when running the convex hull merging algorithm.

#rb rinat.abdrashitov

[CL 28106868 by jimmy andrews in ue5-main branch]
2023-09-21 17:12:08 -04:00
jimmy andrews
f12520cfcf Add a new k-DOP fitting algorithm to GeometryCore and swap it in to GeomFitUtils so it will be used by the Static Mesh Editor.
#rb rinat.abdrashitov
#rb richard.talbotwatkin
#jira UE-194152

[CL 28048380 by jimmy andrews in ue5-main branch]
2023-09-20 14:46:30 -04:00
jimmy andrews
ce33cacf43 Move TConvexHull3 simplification-related settings to a separate struct, to make it easier to manage these settings (inside the convex hull code and also for other classes that call into it, like convex decomposition)
Note: These settings were all introduced post-5.3, so moving them should not require deprecation

#rb rinat.abdrashitov

[CL 27715888 by jimmy andrews in ue5-main branch]
2023-09-08 12:43:50 -04:00
Jimmy Andrews
7065fe745d Add support for direct construction of a simplified convex hull in GeometryCore's ConvexHull3 via:
1. A MaxHullVertices setting. If positive, the convex hull algorithm will greedily add vertices to best expand the hull, generating a simplified hull if the exact hull would exceed the specified budget.
2. SkipAtHullDistanceAbsolute/SkipAtHullDistanceAsFraction settings. If positive, the convex hull algorithm will ignore points that are closer than the threshold value, resulting in a simpler hull.

Also stop relying on the Orient3 exact predicate to find the farthest hull points (regardless of whether PointsBudget is specified) both so that the PointsBudget and SkipAtHullDistance settings can accurately compare distances from different triangles and also to fix an issue where the Orient3 magnitude was discarded when requesting a single-precision Orient3 value.

Update convex hull unit test to also test these new settings.

Also adds a small optimization the reduces the number of duplicate points considered.

#rb rinat.abdrashitov
#jira none

[CL 27604026 by Jimmy Andrews in ue5-main branch]
2023-09-05 13:49:30 -04:00
Jimmy Andrews
b2b72084ba remove unused local variable in Delaunay2.cpp
#jira none
#rb trivial

[CL 27594790 by Jimmy Andrews in ue5-main branch]
2023-09-05 09:44:22 -04:00
jimmy andrews
389b3473ff Refine ConvexHull3's simplification algorithm to remove vertices that looked like corners vertices only due to face groups that were deleted
#rb david.hill

[CL 26740088 by jimmy andrews in ue5-main branch]
2023-08-01 11:23:57 -04:00
jimmy andrews
b8887e57ed Add a new polygon-based simplification method to ConvexHull3, and a tolerance for the initial hull build, to support use cases where we do not need an exact hull and can prioritize using fewer plane + avoiding near-degenerate planes in the output. This simplification is especially effective for cases where a large number of near-coplanar faces would exist in the exact-hull output.
#rb rinat.abdrashitov

[CL 26683043 by jimmy andrews in ue5-main branch]
2023-07-28 15:02:49 -04:00
jimmy andrews
874bb70ad5 Add option to drive adding more negative space samples when the current samples don't cover the space identified by Voxel Search (and are farther apart than the target Sample Spacing), to make the negative space coverage algorithm better able to protect space in challenging cases where a smaller fixed number of samples would fail.
#rb rinat.abdrashitov

[CL 26314665 by jimmy andrews in ue5-main branch]
2023-06-29 11:28:58 -04:00
jimmy andrews
e1ff718256 Fix crash when spline mesh tool has a spline with too few points, and generally make polygon triangulation not crash when passed an input with too few points
#rb rinat.abdrashitov

[CL 26295671 by jimmy andrews in ue5-main branch]
2023-06-28 15:30:03 -04:00
jimmy andrews
f70dd3a744 Add a convex decomposition sphere covering mode that uses vox-solidify/difference/offset operations to better place the negative space sphere sampling
[CL 26154533 by jimmy andrews in ue5-main branch]
2023-06-21 13:34:37 -04:00
jimmy andrews
7ca84cf8c5 Add a new hull merge node for reducing the hulls used on convex decompositions
+ minor cleanup/fixes of hull merging algorithms
(v2 with compile/link fixes)

[CL 25964124 by jimmy andrews in ue5-main branch]
2023-06-13 17:18:13 -04:00
jimmy andrews
98cc9bc6be [Backout] - CL25959112
[FYI] Jimmy.Andrews
Original CL Desc
-----------------------------------------------------------------
Add a new hull merge node for reducing the hulls used on convex decompositions
+ minor cleanup/fixes of hull merging algorithms

[CL 25960651 by jimmy andrews in ue5-main branch]
2023-06-13 15:37:18 -04:00
jimmy andrews
59daad6f82 Add a new hull merge node for reducing the hulls used on convex decompositions
+ minor cleanup/fixes of hull merging algorithms

[CL 25959212 by jimmy andrews in ue5-main branch]
2023-06-13 14:52:04 -04:00
jimmy andrews
51c778d2a1 make the convex decomposition sphere covering do a better job of covering shape concavities near the border of the shape by expanding the sampling region by the sphere radius + moving the samples out to better cover the sampling region
#rb rinat.abdrashitov
#preflight 646d469a64351d76f352fdd2

[CL 25597234 by jimmy andrews in ue5-main branch]
2023-05-23 21:22:12 -04:00
jimmy andrews
a88d570315 add convex decomposition options to leaf node convex hull dataflow node
+ add a 'max hulls' option to convex decomposition, which functions like 'target num hulls' but can still cap the number of hulls when an error tolerance is specified (target num hulls is ignored when error tolerance is set)

#rb rinat.abdrashitov
#preflight 646d1033f85111e06c3a8fb7

[CL 25593250 by jimmy andrews in ue5-main branch]
2023-05-23 18:33:43 -04:00
Jimmy Andrews
281e28afae add precise math for exact predicates on clang, where supported
#preflight 646465044404e3cdd2c0fb87
#jira none

[CL 25509390 by Jimmy Andrews in ue5-main branch]
2023-05-17 12:25:46 -04:00
marc audy
31c6de2226 [Backout] - CL25502609
#fyi Jimmy.Andrews
Original CL Desc
-----------------------------------------------------------------
set exact predicate float control for clang as well as msvc

#preflight 64643a472d446eac96856f8c
#rb rinat.abdrashitov
#jira none

[CL 25502827 by marc audy in ue5-main branch]
2023-05-17 00:05:24 -04:00