Open gwater opened 5 years ago
It seems like the round-tripping from SimpleMesh to HomogenousMesh is adding ambiguity. The following fixes the type instability, but breaks a call to HomogenousMesh:
function (::Type{M})(
vertices::AbstractVector{Point{3, VT}}, faces::AbstractVector{FT}
) where {M <: HMesh, VT, FT <: Face}
NV = vertextype(M)
NF = facetype(M)
M(convert(Vector{NV}, vertices), convert(Vector{NF}, faces))
end
Compared to: https://github.com/JuliaGeometry/GeometryTypes.jl/blob/9294dcba10e7fbb4b6f504b6c56d3fcbc3bc5ca7/src/meshes.jl#L79-L87
I'll polish this up and make a PR.
GLNormalMesh(vertices, faces) is not type stable.
How to reproduce:
(tested in GeometryTypes v0.7.5)