diff --git a/src/interfaces.jl b/src/interfaces.jl index a9952e13..c9905fcb 100644 --- a/src/interfaces.jl +++ b/src/interfaces.jl @@ -154,7 +154,7 @@ function decompose(UVT::Union{UV{T},UVW{T}}, positions_nd = decompose(Point{N,eltype(T)}, positions) bb = Rect(positions_nd) # Make sure we get this as points return map(positions_nd) do p - return (p .- minimum(bb)) ./ widths(bb) + return T((p .- minimum(bb)) ./ widths(bb)) end end diff --git a/test/geometrytypes.jl b/test/geometrytypes.jl index 8985b512..7390ec14 100644 --- a/test/geometrytypes.jl +++ b/test/geometrytypes.jl @@ -30,6 +30,9 @@ using Test, GeometryBasics @testset "decompose" begin + m = GeometryBasics.normal_mesh(Sphere(Point3f(0), 1f0)) + @test decompose_uv(m) isa Vector{Vec2f} + o, extr, r = Point2f(1, 2), Point2f(3, 4), 5.0f0 s = Cylinder(o, extr, r) positions = Point{3,Float32}[(-0.7677671, 3.767767, 0.0),