Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
add tests + remove depwarns
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch committed Dec 30, 2019
1 parent 4ad89da commit 7d22050
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.jl.mem
docs/build/
docs/site/
Manifest.toml
4 changes: 2 additions & 2 deletions src/meshes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function merge(m1::M, meshes::M...) where M <: AbstractMesh
f = copy(m1.faces)
attribs = deepcopy(attributes_noVF(m1))
for mesh in meshes
append!(f, mesh.faces .+ length(v))
append!(f, map(f-> f .+ length(v), mesh.faces))
append!(v, mesh.vertices)
for (v1, v2) in zip(values(attribs), values(attributes_noVF(mesh)))
append!(v1, v2)
Expand All @@ -193,7 +193,7 @@ function merge(
color_attrib = RGBA{U8}[RGBA{U8}(m1.color)]
index = Float32[length(color_attrib)-1 for i=1:length(m1.vertices)]
for mesh in meshes
append!(faces, mesh.faces .+ length(vertices))
append!(faces, map(f-> f .+ length(vertices), mesh.faces))
append!(vertices, mesh.vertices)
attribsb = attributes_noVF(mesh)
for (k,v) in attribsb
Expand Down
7 changes: 7 additions & 0 deletions test/polygons.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,11 @@ end
@test area(reverse(points)) 0.5f0
end

@testset "points touching" begin
points = decompose(Point2f0, Circle(Point2f0(0), 1f0))
triangles = polygon2faces(points)
@test !isempty(triangles)
@test points[1] points[end]
end

end

0 comments on commit 7d22050

Please sign in to comment.