-
-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Types not detected correctly from emtpy typed vectors of polygons #4267
Comments
This is breaking MakieDraw.jl pretty badly now I've tried to switch things to |
Looks like a bad type constraint somewhere in |
Seems to me there is a |
haha... Makie.jl/src/basic_recipes/poly.jl Lines 65 to 66 in 017b696
|
Lol, yes it is a problem |
So we just need a method to get N and T from the Polygon type, and use 2 and Float32 if there really is no information available. Seems like 2 lines of code if I'm not missing something... |
Can you just pull those from |
Yes, just pass |
I tried the basic fix but it looks like there are still issues elsewhere. Will be a bit longer, I think. |
I'm trying this on Makie master, but run into this: julia> polygons = Observable(Polygon{2,Float64}[])
Observable(Polygon{2, Float64, P, L, V} where {P<:AbstractPoint{2, Float64}, L<:(AbstractVector{<:GeometryBasics.Ngon{2, Float64, 2, P}}), V<:AbstractVector{L}}[])
julia> f, a, p = poly(polygons)
julia> p.args
1-element Vector{Any}:
Observable(Polygon{2, Float64, P, L, V} where {P<:AbstractPoint{2, Float64}, L<:(AbstractVector{<:GeometryBasics.Ngon{2, Float64, 2, P}}), V<:AbstractVector{L}}[])
julia> p[1]
Observable(Polygon{2, Float64, P, L, V} where {P<:AbstractPoint{2, Float64}, L<:(AbstractVector{<:GeometryBasics.Ngon{2, Float64, 2, P}}), V<:AbstractVector{L}}[])
0 => map(Makie.poly_convert)
0 => map(to_lines(polygon) @ Makie ~/.julia/dev/Makie/src/basic_recipes/poly.jl:123)
julia> p.converted
1-element Vector{Observable}:
Observable(Polygon{2, Float64, P, L, V} where {P<:AbstractPoint{2, Float64}, L<:(AbstractVector{<:GeometryBasics.Ngon{2, Float64, 2, P}}), V<:AbstractVector{L}}[])
julia> p.plots[1]
MakieCore.Mesh{Tuple{Vector{GeometryBasics.Mesh{2, Float64, GeometryBasics.Ngon{2, Float64, 3, Point{2, Float64}}, SimpleFaceView{2, Float64, 3, OffsetInteger{-1, UInt32}, Point{2, Float64}, NgonFace{3, OffsetInteger{-1, UInt32}}}}}}}
julia> p.plots[1].plots
1-element Vector{Plot}:
MakieCore.Mesh{Tuple{GeometryBasics.Mesh{2, Float32, GeometryBasics.Ngon{2, Float32, 3, Point{2, Float32}}, SimpleFaceView{2, Float32, 3, OffsetInteger{-1, UInt32}, Point{2, Float32}, NgonFace{3, OffsetInteger{-1, UInt32}}}}}}
note that the last plot has float32 meshes as input. am tracking this down now - suspect it is in the convert_arguments that this happens. |
g*ddamnit bigmesh = lift(plot, meshes, transform_func) do meshes, tf
if isempty(meshes)
# TODO: Float64
return GeometryBasics.Mesh(Point2f[], GLTriangleFace[])
else
triangle_meshes = map(mesh -> poly_convert(mesh, tf), meshes)
return merge(triangle_meshes)
end
end |
Ah yeah I've seen that sorry should have linked It's just hard coded |
]st -m Makie
) v0.21.7]activate --temp; add Makie
)This errors because the mesh is using Float32:
Seems there is no way to set the type without passing in objects. So building up the geometries manually is not possible except in
Float32
.See: MakieOrg/MakieDraw.jl#14
The text was updated successfully, but these errors were encountered: