Skip to content

Commit 4b1e30b

Browse files
committed
fix uv_normalmesh for 2d
1 parent a6b6d42 commit 4b1e30b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/interfaces.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function faces(f::AbstractVector{<:AbstractFace})
1818
return f
1919
end
2020

21-
function normals(primitive, nvertices=nothing)
21+
function normals(primitive, nvertices=nothing; kw...)
2222
# doesn't have any specific algorithm to generate normals
2323
# so will be generated from faces + positions
2424
# which we indicate by returning nothing!
@@ -27,7 +27,7 @@ function normals(primitive, nvertices=nothing)
2727
return nothing
2828
end
2929

30-
function faces(primitive, nvertices=nothing)
30+
function faces(primitive, nvertices=nothing; kw...)
3131
# doesn't have any specific algorithm to generate faces
3232
# so will try to triangulate the coordinates!
3333
return nothing

test/runtests.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,11 @@ end
362362
@test coordinates(m) === points
363363
end
364364

365-
365+
@testset "convert mesh + meta" begin
366+
m = uv_normal_mesh(Circle(Point2f0(0), 1f0))
367+
# for 2D primitives we dont actually calculate normals
368+
@test !hasproperty(m, :normals)
369+
end
366370

367371
@testset "convert mesh + meta" begin
368372
m = uv_normal_mesh(FRect3D(Vec3f0(-1), Vec3f0(1, 2, 3)))

0 commit comments

Comments
 (0)