Hello,
Recently, I stumbled upon some behavior when intersecting an arc with any path-like element (lines, circles, etc.) that, to me, seemed unexpected . Since the GeometryElement Arc implements the circular arc variety, I would expect it to inherit from the Circle element or vice versa.
However, these instances meet only on the abstract GeometryElement level. Moreover, Arc has a dependency on the Curve instance, whereas Circle has not. This means that intersections with arcs depend on the "generic" curve intersection-finding algorithms, where the root number indicates the n-th intersection with a second path, as opposed to circle intersections having the root number defining the positive or negative root (as stated in the
API reference).
This makes an intersection "jump" when intersecting an arc as demonstrated in
https://jsfiddle.net/3fjd4vkm/28,
where moving point A below the intersecting line, makes the first intersection D move to the position of the second intersection, E.
Since the arc does copy the stdform implementation from circle, we could use the same intersection functions that are used for the latter, with an additional check if the intersection is within the display radius of the arc (analogous to lines and segments). the right figure in the jsfiddle shows this suggested behavior.
I am unsure whether this split in behavior is intentional or something that simply has "grown to be" during development, therefore I'm posting my question as a discussion here rather than a bug on GitHub.
Should arcs (and other non-circle conics for that matter) and circles inherit from a common abstract conic type?
Kind regards,