Skip to content

Commit

Permalink
add tests for pr39
Browse files Browse the repository at this point in the history
  • Loading branch information
krcools committed Nov 10, 2023
1 parent 0da8059 commit 1096da0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ include("test_sh_intersection.jl")
include("test_isinside.jl")
include("test_jctweld.jl")
include("test_isinclosure.jl")
include("test_permute_vertices.jl")

include("test_trgauss.jl")
include("test_chartquad.jl")
Expand Down
34 changes: 34 additions & 0 deletions test/test_permute_vertices.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using CompScienceMeshes
using Test

splx = simplex(
point(0,0,0),
point(1,0,0),
point(0,1,0)
);

@test normal(splx) point(0,0,1)

splx1 = CompScienceMeshes.permute_vertices(splx, [2,1,3])
@test normal(splx1) point(0,0,1)

splx2 = CompScienceMeshes.flip_normal(splx)
@test normal(splx2) point(0,0,-1)

for i in 1:2
@test CompScienceMeshes.tangents(splx2,i) CompScienceMeshes.tangents(splx,i)
end

splx3 = simplex(
point(1,0.5,0),
point(-1,0.5,0),
point(-1,2.5,0)
)

isct = CompScienceMeshes.intersection2(splx, splx3)
@test length(isct) == 1

splx4, splx5 = isct[1]
@test volume(splx4) volume(splx5)
@test normal(splx4) -normal(splx5)

0 comments on commit 1096da0

Please sign in to comment.