Open justvanrossum opened 11 months ago
It's not, unless those lines are degenerate Bezier curves. That said, that opinion's not set in stone, so if there's a use-case that justifies it being there, that could be made to happen.
I don't have a strong opinion, I just noticed many things just work for lines, such as project, derivative, get/compute, so I was intuitively hoping it would do line intersection, too.
My use case is finding all the intersections with a line in a complex path (multiple contours, each with line + curve segments). I represent each segment (line, quad or cubic) with a Bezier instance, calling lineIntersects()
on each segment — except lines: I special-case the points.length === 2
case and use my own line-line intersect function.
It currently doesn't for me, failing like this:
I'm not immediately sure what's going on, but if the intention is for this to work, I'd be happy to try to contribute a fix.