DOTS Geometry
 
Loading...
Searching...
No Matches
HullAlgorithms Class Reference

Classes

struct  LexicographicPointComparer
 

Static Public Member Functions

static JobHandle CalculateBoundingBox (NativeArray< float3 > points, NativeReference< Bounds > bounds, float addedMargin=0.0f, JobHandle dependsOn=default)
 Calculates the minimum enclosing box containing all the points provided, and stores it in "bounds".
 
static JobHandle CalculateBoundingRect (NativeArray< float2 > points, NativeReference< Rect > rectangle, float addedMargin=0.0f, JobHandle dependsOn=default)
 Calculates the minimum enclosing rectangle containing all the points provided, and stores it in "rectangle".
 
static unsafe JobHandle CreateConcaveHull (NativeArray< float2 > points, ref NativePolygon2D polygon, float concavity, float epsilon=10e-4f, Allocator jobAllocator=Allocator.TempJob, JobHandle dependsOn=default)
 Calculates a concave hull of a given set of points and returns them as a polygon.
 
static NativePolygon2D CreateConvexHull (Allocator allocator, List< float2 > points, bool prefilterPoints=false)
 Method used is "Andrew's Monotone Chain". Good Explanation here: Computational Geometry (ISBN 978-3-642-09681-5) p. 6 - 8 or just on Wiki.
 
static JobHandle CreateConvexHull (NativeArray< float2 > points, ref NativePolygon2D polygon, Allocator jobAllocator=Allocator.TempJob, JobHandle dependsOn=default)
 Calculates the convex hull of a given set of points and returns them as a polygon.
 
static unsafe JobHandle CreateConvexHull (NativeArray< float2 > points, ref NativePolygon2D polygon, bool filter, Allocator jobAllocator=Allocator.TempJob, JobHandle dependsOn=default)
 Calculates the convex hull of a given set of points and returns them as a polygon.
 
static JobHandle FindConvexHullIndices (NativeArray< float2 > points, ref NativeList< int > indices, Allocator allocator=Allocator.TempJob, JobHandle dependsOn=default)
 Returns the indices of the points that make up the convex hull of the given point set.
 
static JobHandle FindConvexHullIndices (NativeArray< float2 > points, ref NativeList< int > indices, bool filter, Allocator allocator=Allocator.TempJob, JobHandle dependsOn=default)
 Returns the indices of the points that make up the convex hull of the given point set.
 
static JobHandle FindMinimumEnclosingDisc (NativeArray< float2 > points, NativeReference< float2 > center, NativeReference< float > radius, JobHandle dependsOn=default)
 Calculates the minimum enclosing disc containing all the points provided within an array.
 
static JobHandle FindMinimumEnclosingSphere (NativeArray< float3 > points, NativeReference< float3 > center, NativeReference< float > radius, JobHandle dependsOn=default)
 Calculates the minimum enclosing sphere containing all the points provided within an array.
 

Member Function Documentation

◆ CalculateBoundingBox()

static JobHandle CalculateBoundingBox ( NativeArray< float3 > points,
NativeReference< Bounds > bounds,
float addedMargin = 0::0f,
JobHandle dependsOn = default )
static

Calculates the minimum enclosing box containing all the points provided, and stores it in "bounds".

Parameters
points
bounds
dependsOn
Returns

◆ CalculateBoundingRect()

static JobHandle CalculateBoundingRect ( NativeArray< float2 > points,
NativeReference< Rect > rectangle,
float addedMargin = 0::0f,
JobHandle dependsOn = default )
static

Calculates the minimum enclosing rectangle containing all the points provided, and stores it in "rectangle".

Parameters
points
rectangle
dependsOn
Returns

◆ CreateConcaveHull()

static unsafe JobHandle CreateConcaveHull ( NativeArray< float2 > points,
ref NativePolygon2D polygon,
float concavity,
float epsilon = 10e-4f,
Allocator jobAllocator = Allocator::TempJob,
JobHandle dependsOn = default )
static

Calculates a concave hull of a given set of points and returns them as a polygon.

Parameters
points
polygon
concavityThe higher the value, the more convex the resulting polygon. The typical range should be between 1-5
jobAllocator
dependsOn
Returns

◆ CreateConvexHull() [1/3]

static NativePolygon2D CreateConvexHull ( Allocator allocator,
List< float2 > points,
bool prefilterPoints = false )
static

Method used is "Andrew's Monotone Chain". Good Explanation here: Computational Geometry (ISBN 978-3-642-09681-5) p. 6 - 8 or just on Wiki.

Parameters
points
prefilterPointsIf set to true, the points are first filtered by the Akl-Toussaint Heuristic. This may increase performance for large collections of points (but may lower it otherwise)
Returns
A 2D polygon containing the convex hull of all the points

◆ CreateConvexHull() [2/3]

static JobHandle CreateConvexHull ( NativeArray< float2 > points,
ref NativePolygon2D polygon,
Allocator jobAllocator = Allocator::TempJob,
JobHandle dependsOn = default )
static

Calculates the convex hull of a given set of points and returns them as a polygon.

Parameters
points
polygon
jobAllocator
dependsOn
Returns

◆ CreateConvexHull() [3/3]

static unsafe JobHandle CreateConvexHull ( NativeArray< float2 > points,
ref NativePolygon2D polygon,
bool filter,
Allocator jobAllocator = Allocator::TempJob,
JobHandle dependsOn = default )
static

Calculates the convex hull of a given set of points and returns them as a polygon.

Parameters
points
polygon
filterIf true, Akl-Toussaint heuristic is used. This speeds up the calculation when having a lot of points
jobAllocator
dependsOn
Returns

◆ FindConvexHullIndices() [1/2]

static JobHandle FindConvexHullIndices ( NativeArray< float2 > points,
ref NativeList< int > indices,
Allocator allocator = Allocator::TempJob,
JobHandle dependsOn = default )
static

Returns the indices of the points that make up the convex hull of the given point set.

Parameters
points
indices
allocator
dependsOn
Returns

◆ FindConvexHullIndices() [2/2]

static JobHandle FindConvexHullIndices ( NativeArray< float2 > points,
ref NativeList< int > indices,
bool filter,
Allocator allocator = Allocator::TempJob,
JobHandle dependsOn = default )
static

Returns the indices of the points that make up the convex hull of the given point set.

Parameters
points
indices
filterIf true, Akl-Toussaint heuristic is used. This speeds up the calculation when having a lot of points
allocator
dependsOn
Returns

◆ FindMinimumEnclosingDisc()

static JobHandle FindMinimumEnclosingDisc ( NativeArray< float2 > points,
NativeReference< float2 > center,
NativeReference< float > radius,
JobHandle dependsOn = default )
static

Calculates the minimum enclosing disc containing all the points provided within an array.

Parameters
points
center
radius
filterIf true, Akl-Toussaint heuristic is used. This speeds up the calculation when having a lot of points
dependsOn
Returns

◆ FindMinimumEnclosingSphere()

static JobHandle FindMinimumEnclosingSphere ( NativeArray< float3 > points,
NativeReference< float3 > center,
NativeReference< float > radius,
JobHandle dependsOn = default )
static

Calculates the minimum enclosing sphere containing all the points provided within an array.

Parameters
points
center
radius
dependsOn
Returns