@@ -50,7 +50,7 @@ polygon_points = [
50
50
# Plot it!
51
51
# First, we'll plot the polygon using Makie's rendering:
52
52
f, a1, p1 = poly(
53
- Point2.(polygon_points);
53
+ Point2.(GO.forcexy( polygon_points) );
54
54
color = last.(polygon_points),
55
55
colormap = cgrad(:jet, 18; categorical = true),
56
56
axis = (;
@@ -75,7 +75,7 @@ p2box = poly!( # Now, we plot a cropping rectangle around the axis so we only sh
75
75
GI.Polygon( # This is a rectangle with an internal hole shaped like the polygon.
76
76
[
77
77
Point2f[(ext.X[1], ext.Y[1]), (ext.X[2], ext.Y[1]), (ext.X[2], ext.Y[2]), (ext.X[1], ext.Y[2]), (ext.X[1], ext.Y[1])], # exterior
78
- reverse(Point2f.(polygon_points)) # hole
78
+ reverse(Point2f.(GO.forcexy( polygon_points) )) # hole
79
79
]
80
80
); color = :white, xautolimits = false, yautolimits = false
81
81
)
@@ -85,7 +85,7 @@ xrange = LinRange(ext.X..., 400)
85
85
yrange = LinRange(ext.Y..., 400)
86
86
@time mean_values = GO.barycentric_interpolate.(
87
87
(GO.MeanValue(),), # The barycentric coordinate algorithm (MeanValue is the only one for now)
88
- (( polygon_points) ,), # The polygon points as `Point2f`
88
+ (GI.Polygon(GI.LinearRing.([ polygon_points])) ,), # The polygon
89
89
(last.(polygon_points,),), # The values per polygon point - can be anything which supports addition and division
90
90
tuple.(xrange, yrange') # The points at which to interpolate
91
91
)
0 commit comments