v3.0.0
ποΈ 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.
![](https://private-user-images.githubusercontent.com/15237586/344471042-e5ded8e2-e476-4fd6-b506-2ed0065aa5f9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyOTM4ODQsIm5iZiI6MTczOTI5MzU4NCwicGF0aCI6Ii8xNTIzNzU4Ni8zNDQ0NzEwNDItZTVkZWQ4ZTItZTQ3Ni00ZmQ2LWI1MDYtMmVkMDA2NWFhNWY5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE3MDYyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVjNTMyZjcyNWYxNDQ0Njc4MGM2MThiM2U4OGEwZTYxN2E1ZjQ4NWY2ZDgyZTFlMGJkYjZmNDFkMDRkNzYyYWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.HQQ4eHnsPsB8aAdXJ99N8nUYxaio8YG08kNAugXreOg)
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:
![](https://private-user-images.githubusercontent.com/15237586/344471231-a3383707-97f9-4a91-a944-26537aa93472.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyOTM4ODQsIm5iZiI6MTczOTI5MzU4NCwicGF0aCI6Ii8xNTIzNzU4Ni8zNDQ0NzEyMzEtYTMzODM3MDctOTdmOS00YTkxLWE5NDQtMjY1MzdhYTkzNDcyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE3MDYyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE1YzZhYzBmOWJlY2VhNDI4NjkxOGFmYTUyNWM3OGZjNTIzNTg3N2I3N2QxMzhlM2Y5MGRjNDk4MjZiZTAxOWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.E7xd8TNTkXAzRIqj0nB5doGUGhhOpfsQueN3Etaf6OY)
![](https://private-user-images.githubusercontent.com/15237586/344471260-acd11f18-351a-4088-8043-d9402382ec59.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyOTM4ODQsIm5iZiI6MTczOTI5MzU4NCwicGF0aCI6Ii8xNTIzNzU4Ni8zNDQ0NzEyNjAtYWNkMTFmMTgtMzUxYS00MDg4LTgwNDMtZDk0MDIzODJlYzU5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE3MDYyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM5NzFhY2U5MGUwOGNlNTc0OWMyZTA5YjU5OGU1M2QzNGE0MmUzZWRmMzM2OTYwYzlkMDExNjZjODczNDJmNzMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.tPHvhd5uEbvR9qBUxOud7sxNUDblyFRDZ2-G9_oX4zA)
![](https://private-user-images.githubusercontent.com/15237586/344471268-c832e2c7-f9dd-4835-9fc1-7ebd716b9e5a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyOTM4ODQsIm5iZiI6MTczOTI5MzU4NCwicGF0aCI6Ii8xNTIzNzU4Ni8zNDQ0NzEyNjgtYzgzMmUyYzctZjlkZC00ODM1LTlmYzEtN2ViZDcxNmI5ZTVhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE3MDYyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY4NGY0ODkxODYwYjVhYTY5N2UyNzlkNmRiYzQ4N2ZkMDM0OWI2N2Q1Y2M3ODllYTM5NWFmOTVjYzU0NjVmOGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.m-2SZZv91Tf3im996F-XlgEzsJzEVQMg1xJCW2Xj9zE)
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 asTriangulator
, except the input/output is of typeT2
. Supported coordinate types:float2
,double2
(int2
will be implemented in the future).
Changed
- Increased performance for
constrainedHalfedges
generation. Circle
based calculations now useRadiusSq
instead ofRadius
. 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 usingusing andywiecko.BurstTriangulator;
. - Breaking change: The default coordinate type for
Triangulator
is nowdouble2
instead offloat2
. - (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
, andConstrainEdges
.
Fixed
- Run triangulator on the main thread using the
Run()
method.
Full Changelog: v2.5.0...v3.0.0