From 4b1e30b820519026ba45855fc94592bb71358261 Mon Sep 17 00:00:00 2001 From: SimonDanisch Date: Sun, 28 Jun 2020 14:12:17 +0200 Subject: [PATCH 1/2] fix uv_normalmesh for 2d --- src/interfaces.jl | 4 ++-- test/runtests.jl | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/interfaces.jl b/src/interfaces.jl index 427c61f1..46997f84 100644 --- a/src/interfaces.jl +++ b/src/interfaces.jl @@ -18,7 +18,7 @@ function faces(f::AbstractVector{<:AbstractFace}) return f end -function normals(primitive, nvertices=nothing) +function normals(primitive, nvertices=nothing; kw...) # doesn't have any specific algorithm to generate normals # so will be generated from faces + positions # which we indicate by returning nothing! @@ -27,7 +27,7 @@ function normals(primitive, nvertices=nothing) return nothing end -function faces(primitive, nvertices=nothing) +function faces(primitive, nvertices=nothing; kw...) # doesn't have any specific algorithm to generate faces # so will try to triangulate the coordinates! return nothing diff --git a/test/runtests.jl b/test/runtests.jl index 6600d169..6ea81c9b 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -362,7 +362,11 @@ end @test coordinates(m) === points end - +@testset "convert mesh + meta" begin + m = uv_normal_mesh(Circle(Point2f0(0), 1f0)) + # for 2D primitives we dont actually calculate normals + @test !hasproperty(m, :normals) +end @testset "convert mesh + meta" begin m = uv_normal_mesh(FRect3D(Vec3f0(-1), Vec3f0(1, 2, 3))) From 053ada80f46e29b93c54d925694dc55eed464212 Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 28 Jun 2020 14:16:26 +0200 Subject: [PATCH 2/2] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 77d925ba..2bf3902a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GeometryBasics" uuid = "5c1252a2-5f33-56bf-86c9-59e7332b4326" authors = ["SimonDanisch "] -version = "0.2.13" +version = "0.2.14" [deps] IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"