Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/interfaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions test/geometrytypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down