Skip to content

Commit 067abe0

Browse files
committed
Finally fix barycentric
1 parent 0d471a4 commit 067abe0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/methods/barycentric.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ polygon_points = [
5050
# Plot it!
5151
# First, we'll plot the polygon using Makie's rendering:
5252
f, a1, p1 = poly(
53-
Point2.(polygon_points);
53+
Point2.(GO.forcexy(polygon_points));
5454
color = last.(polygon_points),
5555
colormap = cgrad(:jet, 18; categorical = true),
5656
axis = (;
@@ -75,7 +75,7 @@ p2box = poly!( # Now, we plot a cropping rectangle around the axis so we only sh
7575
GI.Polygon( # This is a rectangle with an internal hole shaped like the polygon.
7676
[
7777
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
7979
]
8080
); color = :white, xautolimits = false, yautolimits = false
8181
)
@@ -85,7 +85,7 @@ xrange = LinRange(ext.X..., 400)
8585
yrange = LinRange(ext.Y..., 400)
8686
@time mean_values = GO.barycentric_interpolate.(
8787
(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
8989
(last.(polygon_points,),), # The values per polygon point - can be anything which supports addition and division
9090
tuple.(xrange, yrange') # The points at which to interpolate
9191
)

0 commit comments

Comments
 (0)