Commit Graph

34 Commits

Author SHA1 Message Date
Jimmy Andrews
6459e6d93f Make C-array exact predicate calls const-correct, and remove/deprecate confusing 'template VectorType' versions that were making the C-array versions difficult to call. To do the deprecation, the 'template VectorType' has been replaced with explicit inline functions that handle the existing vector types.
#rb david.hill
#preflight 637556d4953c19d4352a7bee

[CL 23184198 by Jimmy Andrews in ue5-main branch]
2022-11-17 16:46:44 -05:00
Jimmy Andrews
941db20dc4 fix incorrect direct assignments to TFunctionRef
#rb rex.hill
#preflight 63769b2cf514e1ded961caed

[CL 23183068 by Jimmy Andrews in ue5-main branch]
2022-11-17 15:52:12 -05:00
Jimmy Andrews
0a7d11eeb3 fix broken tet mesh test by making tets consistently generate by default in the UE orientation (orient3d gives negative sign), and switching the Validate function back to expecting that orientation
#rb tyson.brochu
#preflight 636d86315368a3230a6629e2

[CL 23090187 by Jimmy Andrews in ue5-main branch]
2022-11-10 18:45:07 -05:00
Jimmy Andrews
48486e8cb5 Add 3D Delaunay + tests
#rb david.hill
#preflight 636d3d0db839cb7ec554f864

[CL 23086658 by Jimmy Andrews in ue5-main branch]
2022-11-10 15:20:34 -05:00
Jimmy Andrews
c9905f983c Add InSphere to exact predicates + test coverage
#rb tyson.brochu
#preflight 636932a3ed07daaa9ab89d3b

[CL 23016482 by Jimmy Andrews in ue5-main branch]
2022-11-07 15:16:04 -05:00
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
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
Bryan sefcik
b4a6e947d8 Ran IWYU on Public headers under Engine/Source/Runtime/...
Headers are updated to contain any missing #includes needed to compile and #includes are sorted.  Nothing is removed.

#ushell-cherrypick of 21065896 by bryan.sefcik
#preflight 62d4b1a5a6141b6adfb0c892
#jira

#ROBOMERGE-OWNER: Bryan.sefcik
#ROBOMERGE-AUTHOR: bryan.sefcik
#ROBOMERGE-SOURCE: CL 21150156 via CL 21151754 via CL 21154719
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)
#ROBOMERGE-CONFLICT from-shelf

[CL 21181076 by Bryan sefcik in ue5-main branch]
2022-07-20 11:31:36 -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
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
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
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
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
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
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
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
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
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