Closed knuesel closed 3 years ago
When faces returns nothing, mesh(::Meshable) falls back on decompose(facetype, positions). The fallback is missing from mesh(::AbstractPolygon) so the following fails:
faces
nothing
mesh(::Meshable)
decompose(facetype, positions)
mesh(::AbstractPolygon)
julia> t = Triangle(Point2f0(0), Point2f0(1), Point2f0(1,0)) Triangle(Float32[0.0, 0.0], Float32[1.0, 1.0], Float32[1.0, 0.0]) julia> GeometryBasics.mesh(t) ERROR: MethodError: no method matching Mesh(::Array{Point{2,Float32},1}, ::Nothing)
This PR adds the fallback to the AbstractPolygon case.
AbstractPolygon
Thanks
When
faces
returnsnothing
,mesh(::Meshable)
falls back ondecompose(facetype, positions)
. The fallback is missing frommesh(::AbstractPolygon)
so the following fails:This PR adds the fallback to the
AbstractPolygon
case.