Open
Description
Maybe I'm holding it wrong, but I've run into a funny case where PathSeg::intersect_line
is returning suspicious results. I'll include an SVG below showing the issue, which is reproducible with the following test case:
#[test]
fn test_intersect_wat() {
let c: PathSeg = CubicBez::new(
(452.0, 240.0),
(462.667, 78.667),
(480.667, -146.333),
(506.0, -435.0),
)
.into();
let line = Line::new((385.0, 146.0), (438.0, 243.0));
let hits = PathSeg::from(c).intersect_line(line);
assert!(hits.is_empty());
}
(this reports a hit, which it should not.)
If I nudge the segments so that all the points are positive, the issue goes away, Which leads me to the guess that this is some subtle mishandling of sign, somewhere?
for illustration the segments look like this (with the reported hit shown as a dot at the relevant t
of each segment)
Metadata
Metadata
Assignees
Labels
No labels