Skip to content

Commit c77c2f6

Browse files
authored
Fix normal in TransformedGrid viz recipe (#1017)
1 parent 8296f50 commit c77c2f6

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

ext/MeshesMakieExt.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ using Colorfy
1414

1515
using Unitful: numtype
1616
using Meshes: lentype
17-
using CoordRefSystems: Projected
1817

1918
import TransformsBase as TB
2019
import Makie.GeometryBasics as GB

ext/grid/transformed.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ function vizgrid!(plot::Viz{<:Tuple{TransformedGrid}}, M::Type{<:𝔼}, pdim::Va
2020
viz!(plot, grid; color, alpha, colormap, showsegments, segmentcolor, segmentsize)
2121
makietransform!(plot, trans)
2222
elseif pdim == Val(2) # visualize quadrangle mesh with texture using uv coords
23+
# decide whether or not to reverse connectivity list
24+
rfunc = Makie.@lift _reverse(crs($tgrid))
25+
2326
verts = Makie.@lift map(asmakie, vertices($tgrid))
24-
quads = Makie.@lift [GB.QuadFace(indices(e)) for e in elements(topology($tgrid))]
27+
quads = Makie.@lift [GB.QuadFace($rfunc(indices(e))) for e in elements(topology($tgrid))]
2528

2629
colorant = Makie.@lift process($color, $colormap, $colorrange, $alpha)
2730

@@ -52,6 +55,9 @@ function vizgrid!(plot::Viz{<:Tuple{TransformedGrid}}, M::Type{<:𝔼}, pdim::Va
5255
end
5356
end
5457

58+
_reverse(::Type{<:CRS}) = identity
59+
_reverse(::Type{<:LatLon}) = reverse
60+
5561
# --------------
5662
# OPTIMIZATIONS
5763
# --------------

0 commit comments

Comments
 (0)