isNear for Bezier curves does not take into account corner case of (nearly) line segments
See title. For Bezier curves the isNear
function compares each of the control points. This is mostly fine but is particularly problematic when the curve is almost a line segment. For example currently it does not consider
M 0 0.5 L 0.5 1
M 0 0.5 C 0.5 1 0 0.5 0.5 1
to be near even though they are completely identical (same line segment). Subsequently PlanarGraph would be unable to merge the coinciding edges.
I was able to write an ad-hoc fix for my use-case by adding a isNearlyLineSegment
function, and only check for the endpoints if both curves are nearly line segment. I don't really think this is an ideal fix though.