From 684c4175db83910b3a38b845c8a9a51edf4afdf6 Mon Sep 17 00:00:00 2001 From: Thomas Christensen Date: Wed, 11 Nov 2026 21:56:43 +0100 Subject: [PATCH] Update EarCut_jll to v3 EarCut_jll v2 was built with an old BinaryBuilder and lists `Pkg` as a dependency; v3.2.3 does not. The C wrapper and its symbols are unchanged (the major bump tracks earcut.hpp catching up with earcut.js v3), but the triangulations differ: earcut 3.2.3 adds a Delaunay refine pass, and triangle and vertex order changed. The expected faces in the tests are updated accordingly; all are still valid triangulations with the same winding. Bump version to 0.5.14. Assisted-by: Claude Opus 5.5 --- Project.toml | 4 ++-- test/polygons.jl | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Project.toml b/Project.toml index e5d7ff49..4b9b4b64 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GeometryBasics" uuid = "5c1252a2-5f33-56bf-86c9-59e7332b4326" authors = ["SimonDanisch "] -version = "0.5.13" +version = "0.5.14" [deps] EarCut_jll = "5ae413db-bbd1-5e63-b57d-d24a61df00f5" @@ -22,7 +22,7 @@ IntervalSetsExt = "IntervalSets" [compat] Aqua = "0.8" -EarCut_jll = "2" +EarCut_jll = "3" Extents = "0.1" GeoInterface = "1.0.1" GeoJSON = "0.7, 0.8" diff --git a/test/polygons.jl b/test/polygons.jl index 2bf53288..f30550a2 100644 --- a/test/polygons.jl +++ b/test/polygons.jl @@ -43,14 +43,14 @@ @test coordinates(poly1) == ps fs = GeometryBasics.earcut_triangulate([poly1.exterior[[1, 2, 3, 4, 1]]]) - @test fs == GLTriangleFace[(4,1,2), (2,3,4)] + @test fs == GLTriangleFace[(4,1,2), (4,2,3)] poly1 = [ [Point2f(100, 0), Point2f(100, 100), Point2f(0, 100), Point2f(0, 0)], # Following polylines define holes. [Point2f(75, 25), Point2f(75, 75), Point2f(25, 75), Point2f(25, 25)] ] - fs = GLTriangleFace[(4, 8, 7), (5, 8, 4), (3, 4, 7), (5, 4, 1), (2, 3, 7), (6, 5, 1), (2, 7, 6), (6, 1, 2)] + fs = GLTriangleFace[(4, 8, 7), (5, 8, 4), (5, 4, 1), (5, 1, 2), (3, 4, 7), (3, 7, 6), (6, 5, 2), (6, 2, 3)] @test fs == GeometryBasics.earcut_triangulate(poly1) # issue #236 @@ -88,17 +88,17 @@ end @testset "earcut" begin ps = Point2i[(-1,-1), (1,-1), (1,1), (-1,1)] - @test GeometryBasics.earcut_triangulate([Point{2, Int32}.(ps)]) == GLTriangleFace[(3,4,1), (1,2,3)] - @test GeometryBasics.earcut_triangulate([Point{2, Int64}.(ps)]) == GLTriangleFace[(3,4,1), (1,2,3)] - @test GeometryBasics.earcut_triangulate([Point{2, Float32}.(ps)]) == GLTriangleFace[(3,4,1), (1,2,3)] - @test GeometryBasics.earcut_triangulate([Point{2, Float64}.(ps)]) == GLTriangleFace[(3,4,1), (1,2,3)] + @test GeometryBasics.earcut_triangulate([Point{2, Int32}.(ps)]) == GLTriangleFace[(3,4,1), (3,1,2)] + @test GeometryBasics.earcut_triangulate([Point{2, Int64}.(ps)]) == GLTriangleFace[(3,4,1), (3,1,2)] + @test GeometryBasics.earcut_triangulate([Point{2, Float32}.(ps)]) == GLTriangleFace[(3,4,1), (3,1,2)] + @test GeometryBasics.earcut_triangulate([Point{2, Float64}.(ps)]) == GLTriangleFace[(3,4,1), (3,1,2)] ps2 = Point2i[(0,-1), (1,0), (0,1), (-1,0)] - @test faces(Polygon(Point2{Int32}.(ps), [Point2{Int32}.(ps2)])) == GLTriangleFace[(4,8,7), (5,8,1), (6,5,2), (3,7,6)] - @test faces(Polygon(Point2{Int64}.(ps), [Point2{Int64}.(ps2)])) == GLTriangleFace[(4,8,7), (5,8,1), (6,5,2), (3,7,6)] - @test faces(Polygon(Point2{Int8}.(ps), [Point2{Int8}.(ps2)])) == GLTriangleFace[(4,8,7), (5,8,1), (6,5,2), (3,7,6)] - @test faces(Polygon(Point2{Float32}.(ps), [Point2{Float32}.(ps2)])) == GLTriangleFace[(4,8,7), (5,8,1), (6,5,2), (3,7,6)] - @test faces(Polygon(Point2{Float64}.(ps), [Point2{Float64}.(ps2)])) == GLTriangleFace[(4,8,7), (5,8,1), (6,5,2), (3,7,6)] - @test faces(Polygon(Point2{Float16}.(ps), [Point2{Float16}.(ps2)])) == GLTriangleFace[(4,8,7), (5,8,1), (6,5,2), (3,7,6)] + @test faces(Polygon(Point2{Int32}.(ps), [Point2{Int32}.(ps2)])) == GLTriangleFace[(4,8,7), (5,8,1), (3,7,6), (6,5,2)] + @test faces(Polygon(Point2{Int64}.(ps), [Point2{Int64}.(ps2)])) == GLTriangleFace[(4,8,7), (5,8,1), (3,7,6), (6,5,2)] + @test faces(Polygon(Point2{Int8}.(ps), [Point2{Int8}.(ps2)])) == GLTriangleFace[(4,8,7), (5,8,1), (3,7,6), (6,5,2)] + @test faces(Polygon(Point2{Float32}.(ps), [Point2{Float32}.(ps2)])) == GLTriangleFace[(4,8,7), (5,8,1), (3,7,6), (6,5,2)] + @test faces(Polygon(Point2{Float64}.(ps), [Point2{Float64}.(ps2)])) == GLTriangleFace[(4,8,7), (5,8,1), (3,7,6), (6,5,2)] + @test faces(Polygon(Point2{Float16}.(ps), [Point2{Float16}.(ps2)])) == GLTriangleFace[(4,8,7), (5,8,1), (3,7,6), (6,5,2)] end end \ No newline at end of file