Open bacchanalia opened 5 years ago
One problem is that filter (liftA2 (&&) (>=0) (<=1))
in trailCrossings from Diagrams.TwoD.Path should be filter (liftA2 (&&) (>=(-eps)) (<=(1+eps))
, but there is still another problem because given
[p] = pathTrails $ B.union Winding (square 2)
crossingYIsMinus1 = trailCrossings (p2 (-2, -1)) p
crossingYIsPlus1 = trailCrossings (p2 (-2, 1)) p
crossingYIsMinus1 now produces the expected result, but crossingYIsPlus1 still does not.
edit: The param is also compared to 0 or 1 in signFromDerivAt. Loosening those comparisons fixes the example, but might possibly break other things. It requires further consideration.
l1/r1 are equivalent to l0/r0 except the straight segments get converted to cubic segments by B.union. They draw and fill correctly, so I think it's a problem with (sample :: -> -> Crossings) rather than a problem with B.union.