Commit Graph

104 Commits

Author SHA1 Message Date
Jimmy Andrews
d20f4f4012 Fixes to FPriorityOrderPoints:
1. Actually use the SpatialLevels argument
2. Only allow early stopping at level boundaries, so the priority ordering can properly sort points at the same spatial level. Fixes points being spatially clumped when early stopping is enabled.
3. Stop referring to some of the importance weights as "curvature" (we often weight by things other than curvature)
4. Expose OffsetResFactor to allow more control of how clumpy the distribution is (value was hardcoded at 4, but I think 1 or 2 tends to space things better)

#rb david.hill
#preflight 628fb6d48c23e52ef0fbec28

[CL 20381323 by Jimmy Andrews in ue5-main branch]
2022-05-26 13:37:41 -04:00
Jimmy Andrews
4688af8512 Fix constrained delaunay triangulation failing on cavity fill by switching to a different (simpler) cavity fill algorithm
Should be faster in most practical cases, though can be slower if an inserted edge must cross a lot of existing edges.

#rb rinat.abdrashitov
#preflight 62845c74ac1a933d478fcc0b

[CL 20261922 by Jimmy Andrews in ue5-main branch]
2022-05-18 11:50:40 -04:00
Jimmy Andrews
ac6d4e5e8e automatically fix mesh orientation when geometry script functions transform meshes with negative scale
#jira UE-151319
#rb semion.piskarev
#rb ryan.schmidt
#preflight 6282a2f3734d0657703f17b7

[CL 20232088 by Jimmy Andrews in ue5-main branch]
2022-05-16 17:07:25 -04:00
David Hill
bc7cab5826 Geometery Core: extends the blocked 3d grids and adds narrow band sparse SDF generation using these blocked grids.
unittests are included for the blocked grids and sdf generation, as well as benchmarks for sdf generation.
( This CL flushes out an old shelf of Ryan's.)

#preflight 62713371fe09c0cfbc3719a1
#rb Tyson.Brochu

[CL 20042490 by David Hill in ue5-main branch]
2022-05-04 11:28:18 -04:00
Jimmy Andrews
20f8e9cd7e Make a new triangulation fill mode that supports explicit boundary and hole edges
Update Arrangement2d's triangulation functions to use that fill mode, and also to be explicit about whether the boundary group is expected or not

#rb david.hill
#rb rinat.abdrashitov
#preflight 6269606c8c2782e4f2327a34

[CL 19941732 by Jimmy Andrews in ue5-main branch]
2022-04-27 12:30:18 -04:00
Steve Robb
f4d1564ffe New BitCast<>() function which works like C++20's std::bit_cast<>().
Deprecation of FPlatformMath::IsNegative*() functions.
New FPlatformMath::IsNegativeOrNegativeZero().
Fix up of existing usage to either use < 0 or IsNegativeOrNegativeZero where appropriate.
Fixes for aliasing problems in various FMath functions, including IsNegative*().

Resubmission of CL# 19833778 with fixes for problematic Mac and Android toolchains, causing spurious errors while building PCHs.

#rb devin.doucette, charles.bloom, will.damon, chris.babcock
#jira UE-148435
#preflight 6260764d91376845adf9893f

[CL 19840896 by Steve Robb in ue5-main branch]
2022-04-20 19:05:47 -04:00
Jimmy Andrews
cd48240c04 fix CIS asan failure: exact predicates accessing 1 past the end of local stack arrays
#jira UE-149726
#rb tyson.brochu
#preflight 6260735673187d30d0c4989d

[CL 19838426 by Jimmy Andrews in ue5-main branch]
2022-04-20 17:23:03 -04:00
Steve Robb
5c1f45e9a8 Undo //UE5/Main/Engine/... changelist 19833778 due to Mac and Android compilation failure.
#rb none
#jira none
#preflight none
#fyi will.damon

[CL 19835840 by Steve Robb in ue5-main branch]
2022-04-20 15:09:51 -04:00
Steve Robb
a9e89c3ed6 New BitCast<>() function which works like C++20's std::bit_cast<>().
Deprecation of FPlatformMath::IsNegative*() functions.
New FPlatformMath::IsNegativeOrNegativeZero().
Fix up of existing usage to either use < 0 or IsNegativeOrNegativeZero where appropriate.
Fixes for aliasing problems in various FMath functions, including IsNegative*().

#rb devin.doucette, charles.bloom
#jira UE-148435
#preflight 625ece48f16e0d2accab15d9

[CL 19833778 by Steve Robb in ue5-main branch]
2022-04-20 13:38:10 -04:00
Jimmy Andrews
b91c89e1b4 improve convex decompositions by adding a concept of 'too thin' parts that the decomposition must remove in the merge phase
also fix handling of splitting into connected components when some of the components don't have a valid convex hull (by bailing on the component split in that case)

#rb rinat.abdrashitov
#preflight 6255ec9eef3d24a90eb4e00f

[CL 19730210 by Jimmy Andrews in ue5-main branch]
2022-04-12 17:42:14 -04:00
Jimmy Andrews
ec5013e106 change FArrangement2d and TConstrainedDelaunay2 to use new FDelaunay2 code for triangulations
#rb david.hill
#preflight 6247dfee3a5a4c1622eb077b

[CL 19628412 by Jimmy Andrews in ue5-main branch]
2022-04-05 14:07:13 -04:00
Jimmy Andrews
4f0c122342 Add optional error tolerances to guide convex decomposition
#rb tyson.brochu
#preflight 62465633df7d23dbfe12e1f7

[CL 19582884 by Jimmy Andrews in ue5-main branch]
2022-03-31 21:49:52 -04:00
Jimmy Andrews
9d14bf8718 Initial version of a convex decomposition algorithm
Works by trying a bunch of plane cuts to break reduce the volume of the convex pieces, then merging them back together to remove those that were not helpful.  We need the merge step especially for meshes where it takes multiple plane cuts to start reducing the hull volumes, as the initial cuts in that case are not informed by the error metric.

#rb tyson.brochu
#rb matija.kecman
#preflight 624614b1b6084b98324d2059

[CL 19578614 by Jimmy Andrews in ue5-main branch]
2022-03-31 17:09:04 -04:00
tyson brochu
768cfab5db Add scalar weight maps to DynamicMeshAttributeSet
- Allow the Attribute Editor Tool to add/delete weight maps from DynamicMesh targets.
- Enable transferring scalar weight maps back and forth between DynamicMesh and MeshDescription.
- Serialize TDynamicAttributeBase::Name when its subclasses are serialized

#rb nathan.mitchell
#preflight 62439b2ab6084b9832307f6e

[CL 19551734 by tyson brochu in ue5-main branch]
2022-03-29 20:04:24 -04:00
Jimmy Andrews
dc806da34f Delaunay triangulation algorithm improvements:
- fix bug with detection of vertices on the solid segment of a ghost triangle
 - detect when 'fill' of a triangulation is ambiguous under winding rules (e.g. due to open edges)
 - optionally automatically track duplicate vertices and remap duplicate-vertex references to the vertex that was actually inserted

#rb rinat.abdrashitov
#preflight 623e11a9982d12a89973cdec

[CL 19521151 by Jimmy Andrews in ue5-main branch]
2022-03-25 23:09:50 -04:00
Jimmy Andrews
bc4f091865 Expose optional second importance weight to the FPriorityOrderPoints class
#rb rinat.abdrashitov
#preflight 623e11818330d27ee37434d4

[CL 19519241 by Jimmy Andrews in ue5-main branch]
2022-03-25 18:00:27 -04:00
Jimmy Andrews
86b896a04a update new Delaunay code to be more usable:
- Report failures to constrain edges, optionally detecting the case where the edge was flipped away by a subsequent constraint (happens if the constraint edges intersect)
 - Add options to directly triangulation TPolygon2 and TGeneralPolygon2 (+ the supporting fill algorithms to be run on any array of edges)
 - Add validation of Delaunay property for CDTs on all non-constrained edges
 - Update edge cache (if enabled) on sub-triangulation append, improving perf on CDTs with many constrained edges

add corresponding test coverage, and change the test runner to always automatically run exact predicates globalinit

#preflight 62321d0fe2541b4ff3b35efd
#rb rinat.abdrashitov

[CL 19408363 by Jimmy Andrews in ue5-main branch]
2022-03-16 13:44:59 -04:00
Jimmy Andrews
ea5e78a8e0 fix exact predicate test failures -- use volatile for INEXACT to force rounding
#preflight 622fce37ce577e3ab2e0b680

[CL 19380794 by Jimmy Andrews in ue5-main branch]
2022-03-14 20:24:15 -04:00
jimmy andrews
6b870db4fe Fix convex hull crashes (due to zero points and due to exact predicate failure)
add geometry processing low level test coverage for both cases

#jira UE-145703
#preflight 622fa7be306f46da14592f0b
#rb tyson.brochu
#lockdown simon.tourangeau

#ROBOMERGE-OWNER: jimmy.andrews
#ROBOMERGE-AUTHOR: jimmy.andrews
#ROBOMERGE-SOURCE: CL 19378695 in //UE5/Release-5.0/... via CL 19380177
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19380762 by jimmy andrews in ue5-main branch]
2022-03-14 20:15:28 -04:00
Jimmy Andrews
b885b54c1d new Delaunay triangulation code using robust predicates
Much faster and usable from non-plugin code

#rb rinat.abdrashitov
#rb tyson.brochu
#preflight 622a6e9632749f363c5a22ba

[CL 19341780 by Jimmy Andrews in ue5-main branch]
2022-03-10 16:41:30 -05:00
Jimmy Andrews
46ea937c73 make convex hull code work directly with floats if the input is in floats, rather than converting everything to doubles
#rb tyson.brochu
#preflight 622905196e026fc824ab3a4e

[CL 19326164 by Jimmy Andrews in ue5-main branch]
2022-03-09 16:45:56 -05:00
Jimmy Andrews
a624095d22 Add a ZOrderCurve class to order points such that adjacent points in the ordering are likely to be close in space, to be used for incremental Delaunay construction (but can be useful in other algorithms too)
#rb rinat.abdrashitov
#preflight 6227b36d7934051162f05962

[CL 19309261 by Jimmy Andrews in ue5-main branch]
2022-03-08 15:08:31 -05:00
Jimmy Andrews
4b4a4c2d3c Exact Predicates improvements:
- Support InCircle
 - Support float as well as double
 - Add safer, templated versions that specify whether float or double is to be used (for TVector/TVector2)

#rb rinat.abdrashitov
#preflight 62277e1e7077eb04cf6db63d

[CL 19309153 by Jimmy Andrews in ue5-main branch]
2022-03-08 15:01:31 -05:00
ryan schmidt
172058c824 GeometryCore:
- add FColliderMeshProjectionTarget to allow a FColliderMesh to be used as a projection target
- remove dead code from TDenseGrid3
- add TBlockedDenseGrid3, variant of TDenseGrid3 that lazy-allocates sub-blocks of a dense grid, to reduce memory usage in sparse/narrow-band situations on large uniform grids
- replace usage of TDenseGrid3 in FMarchingCubes with TBlockedDenseGrid3, to reduce memory footprint on large meshing problems
#rb David.Hill, Jimmy.Andrews
#jira UE-141151
#preflight 61fc0007176256ec4f744c4
#lockdown Aurel.Cordonnier

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 18846016 in //UE5/Release-5.0/... via CL 18846053 via CL 18846421
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18846468 by ryan schmidt in ue5-main branch]
2022-02-03 13:52:20 -05:00
ryan schmidt
6ad26b69f0 rename UE::Geometry::TTransform3 to TTransformSRT3, update references
#rb none
#rnx
#jira UE-139757
#preflight 61f572d9e52a8a4a910990f1

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 18784197 in //UE5/Release-5.0/... via CL 18784203 via CL 18784222
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18784226 by ryan schmidt in ue5-main branch]
2022-01-29 14:37:53 -05:00