Class Triangulator
A base class for triangulation, which provides the core functionality for performing triangulation on 2D geometric data. It acts as a wrapper for Triangulator<T2> where T2 is double2.
Implements
Inherited Members
Namespace: andywiecko.BurstTriangulator
Assembly: .dll
Syntax
public class Triangulator : IDisposable
Remarks
The triangulation process can be configured using the parameters available in Settings. Provide the input data via Input, and then execute the triangulation using Run() or Schedule(JobHandle). The triangulation results will be available in Output. Ensure you call Dispose() on the object after use to release resources. Example usage:
using var positions = new NativeArray<double2>(new[]
{
new (0, 0), new (1, 0), new (1, 1), new (0, 1)
}, Allocator.Persistent);
using var triangulator = new Triangulator(Allocator.Persistent)
{
Input = { Positions = positions },
Settings = { ValidateInput = false },
};
triangulator.Run();
var triangles = triangulator.Output.Triangles;
For advanced customization of the triangulation process, refer to UnsafeTriangulator<T2>.
Constructors
Name | Description |
---|---|
Triangulator(int, Allocator) | Initializes a new instance of the Triangulator class with the specified |
Triangulator(Allocator) | Initializes a new instance of the Triangulator class with the default capacity (16×1024) and specified memory |
Properties
Name | Description |
---|---|
Input | Input data used for triangulation. |
Output | Output data resulting from the triangulation process. |
Settings | Settings used for triangulation. |
Methods
Name | Description |
---|---|
Dispose() | Releases all resources (memory and safety handles). |
Run() | Perform the job's Execute method immediately on the same thread. |
Schedule(JobHandle) | Schedule the job for execution on a worker thread. |