Skip to content

Commit

Permalink
add some new cases for coincident-points including some failing cases
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed May 30, 2024
1 parent 1e02811 commit 681ea0b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test/shimmers/math/geometry/collisions_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,19 @@
"point intersects with other shapes edge")
(is (empty? (sut/coincident-points (gp/polygon2 [0 0] [5 -5] [10 0])
(gp/polygon2 [0 1] [5 -6] [10 1])))
"coincident point must be at the intersection point not inside or through"))
"coincident point must be at the intersection point not inside or through")

(is (= (sut/coincident-points (gp/polygon2 [0 0] [10 0] [10 10] [0 10])
(gp/polygon2 [10 0] [20 0] [20 10] [10 10]))
[[10 0] [10 10]])
"polygons share an edge")

#_(is (= (sut/coincident-points (gp/polygon2 [0 0] [10 0] [10 10] [0 10])
(gp/polygon2 [10 -1] [20 0] [20 10] [10 11]))
[[10 0] [10 10]])
"polygons cover a shared edge")

#_(is (= (sut/coincident-points (gp/polygon2 [0 0] [10 0] [10 10] [0 10])
(gp/polygon2 [10 0] [20 0] [20 20] [10 20]))
[[10 0] [10 10]])
"polygons overlap a shared edge"))

0 comments on commit 681ea0b

Please sign in to comment.