Skip to content

Commit 07a9a74

Browse files
authored
Merge pull request #172 from JuliaGeometry/sd/fix-uv-eltype
fix uv eltype
2 parents 0cd7855 + e7bd1c5 commit 07a9a74

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/interfaces.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function decompose(UVT::Union{UV{T},UVW{T}},
154154
positions_nd = decompose(Point{N,eltype(T)}, positions)
155155
bb = Rect(positions_nd) # Make sure we get this as points
156156
return map(positions_nd) do p
157-
return (p .- minimum(bb)) ./ widths(bb)
157+
return T((p .- minimum(bb)) ./ widths(bb))
158158
end
159159
end
160160

test/geometrytypes.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ using Test, GeometryBasics
3030

3131
@testset "decompose" begin
3232

33+
m = GeometryBasics.normal_mesh(Sphere(Point3f(0), 1f0))
34+
@test decompose_uv(m) isa Vector{Vec2f}
35+
3336
o, extr, r = Point2f(1, 2), Point2f(3, 4), 5.0f0
3437
s = Cylinder(o, extr, r)
3538
positions = Point{3,Float32}[(-0.7677671, 3.767767, 0.0),

0 commit comments

Comments
 (0)