Odd circle ... Full circular arc

If you are having problems with QCAD, post here. Please report bugs through our Bug Tracker instead.

Always attach your original DXF or DWG file and mentions your QCAD version and the platform you are on.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
CVH
Premier Member
Posts: 3480
Joined: Wed Sep 27, 2017 4:17 pm

Odd circle ... Full circular arc

Post by CVH » 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.

OddCircle-FullCircularArc.dxf
(96 KiB) Downloaded 399 times


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:
How W=2R should look like.png
How W=2R should look like.png (1.04 KiB) Viewed 37466 times
W=2R example.dxf
(97.59 KiB) Downloaded 381 times

Or why the polyline arc-segment is rendered detached here:
PolyWidhts vs Z.dxf
(95.33 KiB) Downloaded 384 times

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

Post Reply

Return to “QCAD Troubleshooting and Problems”