Commit Graph

411 Commits

Author SHA1 Message Date
jimmy andrews
793ef9a727 Add angle-tolerance method of convex hull simplification to the geometry script convex hull simplify options
Add a face normal clustering function that returns the vertices at corners of the clusters (vertices touching at least 3 different clusters), for use in the angle-tolerance convex hull simplification method

#rb rinat.abdrashitov

[CL 28467181 by jimmy andrews in ue5-main branch]
2023-10-04 14:29:39 -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
edc21b808e Add a normal-based clustering algorithm which groups connected triangle groups based on the current average normal of the group.
Use this algorithm in the polygroups generator tool, so we get more useful groups on smooth surfaces (like a cylinder)

Also add a helper to the FSizedDisjointSet class to easily get the number of groups in the set and a mapping between compact group indices and sparse group IDs

#rb david.hill

[CL 28433389 by jimmy andrews in ue5-main branch]
2023-10-03 17:20:18 -04:00
jimmy andrews
6688c1703d add cbrt (cube root) function to mathutil
#rb matija.kecman

[CL 28386084 by jimmy andrews in ue5-main branch]
2023-10-02 14:06:11 -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
bryan sefcik
34b5c4034a Updated Clip and DoClipping to be forceinlined. This saved roughly 100ms from calling functions on average. Overall it saved 8secs on average when generating from **Model assets.
#jira

[CL 28065851 by bryan sefcik in ue5-main branch]
2023-09-20 19:31:05 -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
xuelongmu
845f05d3aa PR #10364: Migrate to new Distance method
#jira UE-183754
#rb jimmy.andrews

[CL 27712607 by xuelongmu in ue5-main branch]
2023-09-08 11:26:29 -04:00
matija kecman
fccb4f9aff Scene sampling using a Render Capture approach
#rb jimmy.andrews
#jira UE-193152,UE-194653

[CL 27637471 by matija kecman in ue5-main branch]
2023-09-06 11:39:40 -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
matija kecman
84bdab0304 Support Geometry Selection in the Tangents tool and fix some bugs
#jira UE-181650
#rb jimmy.andrews

[CL 27584315 by matija kecman in ue5-main branch]
2023-09-04 07:29:03 -04:00
frederic doll
38efdf8a4a Add missing 2d/3d features :
- ZeroValue and NoneValue in TIntVector2 (from TIntVector3)
- GridValues() in TDenseGrid3 (from TDenseGrid2)

#rb jimmy.andrews

[CL 27294375 by frederic doll in ue5-main branch]
2023-08-22 20:17:39 -04:00
george rolfe
06330436e4 [Geometry] Added profiler traces to mesh generators
#rb rinat.abdrashitov

[CL 27125582 by george rolfe in ue5-main branch]
2023-08-15 19:00:48 -04:00
semion piskarev
e5ed38cb9e DynamicMesh: Fix overlay elements not being freed and prevent changing some overlay values arbitrarily when the collapsed triangles were unset.
#rb
#jira UE-192831

[CL 27093233 by semion piskarev in ue5-main branch]
2023-08-14 19:43:18 -04:00
ryan schmidt
65908bc2d4 DynamicMesh: trivial conversion of Async/TFuture usage to new UE::Tasks
#rb tyson.brochu, jimmy.andrews
#rnx

[CL 27093045 by ryan schmidt in ue5-main branch]
2023-08-14 19:35:15 -04:00
frederic doll
4424dbfc7b Add missing feature in 2d classes based on 3d implementation :
- == and != in AxisAlignedBox2i
- default constructor in ScaleGridIndexer2

#rb jimmy.andrews

[CL 27045283 by frederic doll in ue5-main branch]
2023-08-11 16:41:38 -04:00
lonnie li
b61dc7b9df ModelingTools: Fixed gap in gutter when baking MaterialID in the Bake Textures tool.
#rb jimmy.andrews
#jira UE-191491

[CL 26813067 by lonnie li in ue5-main branch]
2023-08-03 11:48:32 -04:00
jimmy andrews
6e47422884 Add K-Means clustering to GeometryCore
Add initial PointSetFunctions to Geometry Script, including: K-Means Clustering, Flatten/Unflatten, Make Bounding Box, Transforms -> Points
Add a custom For Each-style macro to provide a more convenient interface for working with the clustering result

#rb semion.piskarev, ryan.schmidt, david.hill

[CL 26785428 by jimmy andrews in ue5-main branch]
2023-08-02 15:56:15 -04:00
david hill
c53a0fb1d8 Mesh Modeling Tools, For the "normal aware" simplification method in the modeling mode simplification tool. Makes an internal computation more robust for the specific case when triangles being collapsed are on a plane that intersects the origin.
Specifically the computations of attribute gradients now uses a local coordinate system defined in terms of the triangle faces.

#rb jimmy.andrews

[CL 26771504 by david hill in ue5-main branch]
2023-08-02 10:24:10 -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
benoit gadreau
bc524589f4 Skin Binding: fixed pos to grid/cell center indexation
+ removed occupancy grid computation when useless (this is only used for debug purposes and slows down the binding calculation)

#jira UE-187013
#jira UE-180559
#rb halfdan.ingvarsson

[CL 26506572 by benoit gadreau in ue5-main branch]
2023-07-21 04:56:52 -04:00