I noticed that when I use the Path->Difference operation on a simple rectangle overlapping a circle the resulting intersection points are slightly off and don't lie on the outline of the original circle. I added screenshots showing the construction and coordinates. I want to subtract the red rectangle from the blue circle. However, when zooming in one can see that the corner nodes of the new shape are inaccurate (The red circle in the background is a duplicate of the original circle showing where the points should be). The shown point should mathematically be at X=-23.979158... but is actually at X=-23.927734 I am aware, that there are always rounding errors, but this seems too far off. In my case I later have to draw a circular arc path through these intersection points that greatly amplifies this error.
I suspect this behavior is caused by the approximation of the circle by cubic bezier curves. After the difference operation the two half circles are converted to bezier curves instead of arcs. I found this frustrating to figure out and deal with. I did not expect this error and am not sure if this can be considered a bug. I wish clipping a circle would simply return the precise arc segment along the circle instead of the bezier approximation. Is there a better way to do this? At the moment I calculate the intersection points in wolfram alpha and then copy paste them.
I suspect this behavior is caused by the approximation of the circle by cubic bezier curves. After the difference operation the two half circles are converted to bezier curves instead of arcs. I found this frustrating to figure out and deal with. I did not expect this error and am not sure if this can be considered a bug.
Your suspicions are correct. AIUI, Bezier curves cannot precisely replicate arcs.
I recall some users making polygons with numerous points (eg 20), converting to path and smoothing the nodes into a circular path. Seems to work better.
I noticed that when I use the Path->Difference operation on a simple rectangle overlapping a circle the resulting intersection points are slightly off and don't lie on the outline of the original circle. I added screenshots showing the construction and coordinates. I want to subtract the red rectangle from the blue circle. However, when zooming in one can see that the corner nodes of the new shape are inaccurate (The red circle in the background is a duplicate of the original circle showing where the points should be). The shown point should mathematically be at X=-23.979158... but is actually at X=-23.927734 I am aware, that there are always rounding errors, but this seems too far off. In my case I later have to draw a circular arc path through these intersection points that greatly amplifies this error.
I suspect this behavior is caused by the approximation of the circle by cubic bezier curves. After the difference operation the two half circles are converted to bezier curves instead of arcs. I found this frustrating to figure out and deal with. I did not expect this error and am not sure if this can be considered a bug. I wish clipping a circle would simply return the precise arc segment along the circle instead of the bezier approximation. Is there a better way to do this? At the moment I calculate the intersection points in wolfram alpha and then copy paste them.
Your suspicions are correct. AIUI, Bezier curves cannot precisely replicate arcs.
I recall some users making polygons with numerous points (eg 20), converting to path and smoothing the nodes into a circular path. Seems to work better.
Sample SVG attached.
Thank you for the hint, I will try that out. Your example seems promising.