Commit Graph

48 Commits

Author SHA1 Message Date
jimmy andrews
56855bd081 Add a GetFace method to TConvexHull3 and use it to get polygonal faces for convex hulls when building a convex hull for Chaos. This makes us less likely to add near-degenerate faces for which we cannot compute the normals.
#rb Chris.Caulfield
#preflight 63613dae41625be270d322c4

[CL 22890192 by jimmy andrews in ue5-main branch]
2022-11-01 16:03:10 -04:00
jimmy andrews
4456058517 Make visual studio compile exact predicate code with precise math compile settings, for more consistent performance results, and change to generally compute in double precision for predicates where the 'difficult' cases can be ~50x more expensive to compute.
Add a TODO to reconsider the INEXACT volatile setting now that we compile with precise floating point math; preliminary testing indicates it should work and be significantly faster in 'difficult' cases.

#rb david.hill
#preflight 63327ebec7791417aa9b2737

[CL 22217357 by jimmy andrews in ue5-main branch]
2022-09-27 22:55:36 -04:00
jimmy andrews
4837ae2192 fix epsilon's type in extreme points class
#rb tyson.brochu
#preflight 632527cd121ffddebcc8c155

[CL 22086973 by jimmy andrews in ue5-main branch]
2022-09-19 21:55:34 -04:00
Jimmy Andrews
c0135363a4 add a Facing2 exact predicate
#rb david.hill
#preflight 62fa8554bd746abb9963712f

[CL 21400240 by Jimmy Andrews in ue5-main branch]
2022-08-15 22:08:00 -04:00
Jimmy Andrews
f29a8e9ddc fix rotating calipers failing to find extreme point due to two points on hull being close enough that they appear equal w.r.t. the extreme direction
fixes oriented bounding box not containing the output points in GeometryFlowTests

#jira UE-160567
#rb rinat.abdrashitov
#preflight 62f2c57ebc175ec68c148e6e

[CL 21298515 by Jimmy Andrews in ue5-main branch]
2022-08-09 16:57:45 -04:00
Jimmy Andrews
c21b7d49f3 Add new oriented box fit variant that starts from the fast DiTO box and optimizes the fit iteratively
+ Add ProgressCancel to box fits
+ Change editor code to use the new fit algorithms

#rb rinat.abdrashitov
#rb david.hill
#preflight 62f15a2ba035cdf05ea4d1b7

[CL 21273458 by Jimmy Andrews in ue5-main branch]
2022-08-08 15:20:28 -04:00
David Hill
9f5eeac1e3 Geometry: Suppress type conversion warnings in third party on clang
#preflight 62d6fdcdd54af4b9a29176a2
#rnx

[CL 21185144 by David Hill in ue5-main branch]
2022-07-20 14:04:32 -04:00
David Hill
5cd1c6b9cb GeometryCore: FitOrientedBox3 - fixing implicit conversion warning.
#preflight none

[CL 21165693 by David Hill in ue5-main branch]
2022-07-19 15:02:31 -04:00
David Hill
3feeb2386c Geometry: fix clang warning on android with 3rd party code.
#preflight none
#rnx

[CL 21165207 by David Hill in ue5-main branch]
2022-07-19 14:27:26 -04:00
David Hill
612f70bd55 GeometryCore, GeometryProcessing: Add pragmas to suppress implicit type conversion warnings when compiling third party code.
Predicates.cpp and  xaltas.cpp

#preflight 62d6cf9d1133256db6e4624a
#rb Jimmy.Andrews

[CL 21164760 by David Hill in ue5-main branch]
2022-07-19 13:53:50 -04:00
Jimmy Andrews
5214f714b5 Add a new FitOrientedBox3 algorithm
+ fixes to the similar Gte algorithm and to FitOrientedBox2
+ Add a Contain(Array) for TAxisAlignedBox3
+ Add option to save triangle adjacencies on computed 3D convex hull (since we already compute them)
+ Fix plane returned for degenerate convex hull result when Dimension=2
+ Let FitOrientedBox2 functions take a custom best-fit function, so that they can be used in the inner loop of FitOrientedBox3 when searching for the best-fit surface area

#rb david.hill
#preflight 62d56a783c3df32390b32263

[CL 21149570 by Jimmy Andrews in ue5-main branch]
2022-07-18 12:17:27 -04:00
Jimmy Andrews
bfe1c9e793 CIS fix: type mismatch between local functions in FitOrientedBox2.cpp
#preflight 62cefa3e127551eb254189bd

[CL 21074964 by Jimmy Andrews in ue5-main branch]
2022-07-13 13:35:58 -04:00
Jimmy Andrews
e24ae4281b Add functions to fit an oriented box2 to points, a simple polygon, or a convex hull
Add function to find a 2d convex hull of a simple polygon (faster than finding a convex hull of a point set)

#rb david.hill
#rb rinat.abdrashitov
#preflight 62cdb9a83c539c05f8145798

[CL 21070929 by Jimmy Andrews in ue5-main branch]
2022-07-13 10:39:04 -04:00
Jimmy Andrews
029c3e58ca Add new exact predicate to determine whether a triangle is "facing" a direction or not. This could be used e.g. to extract a convex horizon from a convex hull.
#rb david.hill
#preflight 62c46666a6654f97290ca62c

[CL 20950995 by Jimmy Andrews in ue5-main branch]
2022-07-05 17:58:25 -04:00
Jimmy Andrews
219d37ce96 add extra validation of CrossIdx values to make static analysis happy + be extra safe vs crash/inf loop
#preflight 62bb3610727d9bb33ba9ee01
#rb trivial
#jira UE-157840

[CL 20861873 by Jimmy Andrews in ue5-main branch]
2022-06-28 13:55:26 -04:00
Jimmy Andrews
d90649a633 add 2D Voronoi diagram support, built on the Delaunay triangulation code
#rb david.hill
#preflight 62ba64735d29d0d10af0e753

[CL 20845736 by Jimmy Andrews in ue5-main branch]
2022-06-28 00:15:39 -04:00
David Hill
857a3acd3e GeometryCore: Fixing unsafe typecast warnings in preparation for enabling such warnings for GeometryCore
#preflight 62acc6d2c0449d3dccc9b1d5
#rb Jimmy.Andrews

[CL 20710188 by David Hill in ue5-main branch]
2022-06-17 17:23:52 -04:00
David Hill
9fd3733c4d GeometryCore: DiTOrientedBox - fix bug that resulted in fallback to AABB in some cases.
#preflight 62ab406de9031caf98ab0ba4
#rb Tyson.Brochu

[CL 20691650 by David Hill in ue5-main branch]
2022-06-16 14:44:58 -04:00
Jimmy Andrews
b69ed195e9 fix convex hull's 'extreme points' algorithm not catching exactly collinear points as having dimension==1
#rb rinat.abdrashitov
#preflight 629a21fb9526040c3dea2d51

[CL 20537443 by Jimmy Andrews in ue5-main branch]
2022-06-07 10:09:45 -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
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