Skip to content

v3.0.0

Compare
Choose a tag to compare
@andywiecko andywiecko released this 30 Jun 14:20
· 103 commits to main since this release

πŸ–οΈ Summer Update πŸ–οΈ

Hello and happy summer! I have great news: BurstTriangulator has finally been released with version v3.

This release introduces massive changes and opens the road for new incoming features! You can learn more about new features at project documentation.

Generic coordinates

The most significant change is the introduction of Triangulator<T2>, which allows for generic coordinates.
Currently, float2 and double2 are implemented. In the future int2 will also be implemented.
To run triangulation with selected T2, just add generic parameter to your code

using var positions = new NativeArray<float2>(..., Allocator.Persistent);
using var triangulator = new Triangulator<float2>(Allocator.Persistent)
{
  Input = { Positions = positions },
};

triangulator.Run();

Note

Triangulator is still accessible and by default it is based on double2 coordinates.

Below, you can see the benchmark for generic coordinates for Delaunay triangulation. float2 seems to be slightly faster than double2, however, any significant difference is noticeable only for very large inputs.

Auto holes

This release also introduces automatic hole detection and restoring boundary. If one sets Settings.AutoHolesAndBoundary to true, then holes will be created automatically depending on the provided constraints.

using var positions = new NativeArray<double2>(..., Allocator.Persistent);
using var constraintEdges = new NativeArray<int>(..., Allocator.Persistent);
using var triangulator = new Triangulator(Allocator.Persistent)
{
  Input = { 
    Positions = positions,
    ConstraintEdges = constraintEdges,
  },
  Settings = { AutoHolesAndBoundary = true, },
};

triangulator.Run();

var triangles = triangulator.Output.Triangles;

Warning

The current implementation of AutoHolesAndBoundary detects only 1-level islands. It will not detect holes in solid meshes inside other holes.

Performance

All these changes impact performance, and as the results, triangulation modes have better performance than previous releases. See the benchmarks below:


Stay tuned for more updates. πŸ™‚
Happy triangulating! πŸ“

Best,
Andrzej


Change log

Added

  • New online documentation (including manual and scripting API): https://andywiecko.github.io/BurstTriangulator/
  • Verbose option in triangulation settings.
  • Halfedges for triangulation output.
  • AutoHolesAndBoundary option in triangulation settings. This option allows for automatic hole detection, eliminating the need for the user to provide hole positions. Holes are calculated using constraint edges.
  • Support for generic coordinates. Users can specify the type of coordinates used in the triangulation with Triangulator<T2>. The API for this class is the same as Triangulator, except the input/output is of type T2. Supported coordinate types: float2, double2 (int2 will be implemented in the future).

Changed

  • Increased performance for constrainedHalfedges generation.
  • Circle based calculations now use RadiusSq instead of Radius. This results in increased performance in the refinement step, however, the final results may be slightly different.
  • Breaking change: Moved most of the inner types (e.g., Status, TriangulatorSettings, etc.) to the global namespace. They can now be accessed directly using using andywiecko.BurstTriangulator;.
  • Breaking change: The default coordinate type for Triangulator is now double2 instead of float2.
  • (Internal) Greatly simplified job logic replaced with steps. Overall triangulation logic is now easier to follow and read. Some internal structs were removed or hidden inside steps.

Removed

  • Obsolete settings: BatchCount, MinimumAngle, MinimumArea, MaximumArea, and ConstrainEdges.

Fixed

  • Run triangulator on the main thread using the Run() method.

Full Changelog: v2.5.0...v3.0.0