From ab0afb3ad3444fccfdf9188d71a97857cf10a189 Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Mon, 11 Nov 2024 11:47:50 -0500 Subject: [PATCH] Dont restrict transformed point dim to input point dim in `poly_convert` --- src/basic_recipes/poly.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/basic_recipes/poly.jl b/src/basic_recipes/poly.jl index e1706d5c82a..6f8bf691cda 100644 --- a/src/basic_recipes/poly.jl +++ b/src/basic_recipes/poly.jl @@ -90,7 +90,9 @@ function poly_convert(polygon::Polygon, transform_func=identity) outer = metafree(coordinates(polygon.exterior)) # TODO consider applying f32 convert here too. We would need to identify this though... PT = float_type(outer) - points = Vector{PT}[apply_transform(transform_func, outer)] + # Note that this should not be coerced to be a `Vector{PT}`, + # since `apply_transform` can change points from e.g 2D to 3D. + points = [apply_transform(transform_func, outer)] points_flat = PT[outer;] for inner in polygon.interiors inner_points = metafree(coordinates(inner))