Odd circle ... Full circular arc
Posted: Sun Sep 03, 2023 7:37 am
All, Andrew,
Working on polylines, spitting trough arc-segment support and related arc resources I found an arc curiosity that I can visualize in the file below.
- On open (auto zoom) it does not show the whole circle.
- In some zoom states the circle may not show.
- One can hardly select it, TA or a box-select will work.
(this can be troublesome when the isolated circle is part of a drawing with many entities)
- When selected it might not show ... Reference points are visualized but are hard to use as snapping points.
- On copy/paste or move the preview is a dot.
- Set CCW it behaves better.
In fact it is not a circle, it is a full circular arc starting at about 173 degrees (arbitrary chosen) and ending there.
The only thing I did was copying the start angle value into the end angle field of the Property Editor (8 decimal digits).
There is a resource that does this to handle circles as arcs: https://github.com/qcad/qcad/blob/maste ... le.cpp#L87
Sweep angle is reported as zero degrees but the length and area are correct.
Here one can see that it meets the condition of a full circular arc:
https://github.com/qcad/qcad/blob/maste ... c.cpp#L337
Sweep = zero => Bulge factor = zero and zero is less than 1e-6.
Remind that a polyline segment with a bulge below 1e-6 is considered as a straight line segment.
And that a full circular polyline arc segment can not exists (tan(360/4) = err).
Duplicate the circle and move it (preview = dot) somewhat apart.
Set start angle = zero, end angle = zero and the sweep will be 360 degrees.
This full circular arc behaves better as both CW or CCW.
It are these inconsistencies and fixes that makes coding for polylines with bulges fairly difficult.
Merely investigating why the file below is not rendered like this:
Or why the polyline arc-segment is rendered detached here:
Besides several other polylines projects where I got stuck or need to circumvent standard resources.
For example: The chord of an arc is considered in 3D while an arc (arc-segment) or circle can only exist in a flat plane.
Regards,
CVH
Working on polylines, spitting trough arc-segment support and related arc resources I found an arc curiosity that I can visualize in the file below.
- On open (auto zoom) it does not show the whole circle.
- In some zoom states the circle may not show.
- One can hardly select it, TA or a box-select will work.
(this can be troublesome when the isolated circle is part of a drawing with many entities)
- When selected it might not show ... Reference points are visualized but are hard to use as snapping points.
- On copy/paste or move the preview is a dot.
- Set CCW it behaves better.
In fact it is not a circle, it is a full circular arc starting at about 173 degrees (arbitrary chosen) and ending there.
The only thing I did was copying the start angle value into the end angle field of the Property Editor (8 decimal digits).
There is a resource that does this to handle circles as arcs: https://github.com/qcad/qcad/blob/maste ... le.cpp#L87
Sweep angle is reported as zero degrees but the length and area are correct.
Here one can see that it meets the condition of a full circular arc:
https://github.com/qcad/qcad/blob/maste ... c.cpp#L337
Sweep = zero => Bulge factor = zero and zero is less than 1e-6.
Remind that a polyline segment with a bulge below 1e-6 is considered as a straight line segment.
And that a full circular polyline arc segment can not exists (tan(360/4) = err).
Duplicate the circle and move it (preview = dot) somewhat apart.
Set start angle = zero, end angle = zero and the sweep will be 360 degrees.
This full circular arc behaves better as both CW or CCW.
It are these inconsistencies and fixes that makes coding for polylines with bulges fairly difficult.
Merely investigating why the file below is not rendered like this:
Or why the polyline arc-segment is rendered detached here:
Besides several other polylines projects where I got stuck or need to circumvent standard resources.
For example: The chord of an arc is considered in 3D while an arc (arc-segment) or circle can only exist in a flat plane.
Regards,
CVH