Removing segments from an ellipse with D2 (2)

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: 4943
Joined: Wed Sep 27, 2017 4:17 pm

Removing segments from an ellipse with D2 (2)

Post by CVH » Thu Oct 09, 2025 10:09 am

Same reason as for the other topic (topic 11899)

HowToTrimEllipse2.dxf
(105.6 KiB) Downloaded 13 times

In the attached example drawing using the latest stable QCAD release 3.32.4:
- Try removing segment A with D2 ... Undo (OO)
- Try removing segment B with D2 ... Undo (OO)
- Try removing segment C with D2 ... Undo (OO)
- Try removing segment D with D2 ... Undo (OO)

:arrow: This doesn't remove only the segments A, B, C or D, the action removes A+B or C+D.

The workaround would be using B2 but there is no intersection between the ellipse and the magenta lines.
In this case one could exploit an intersection with the green line (SI) and one of the ellipse reference points (SR), a major point.

This can be replicated at any point on the ellipse and then SI or SR are of no use.

- - - - - - - - -

D2, B2 and AX all fail because of no intersections with the magenta lines.
On purpose these lines are almost tangent but not crossing the ellipse :!:

Since fixing FS#2685 a line almost tangent with an ellipse is defined as:
- Not tangent or not a single root for a quadratic equation within mathematical limits.
- 2 real roots and intersecting twice at two points really close together.


:arrow: There is no analog for a line passing near a circle at R + epsilon (A very small extra distance).
While a circle is nothing more than a special ellipse case with ratio 1.00.

Let's handle this in a different way...

Revert to the drawing as given:
- Unlock layer 'Notes'.
- Select the system of drawing entities centered at the origin.
- Scale (SZ) the whole system disproportional to convert the ellipse into a circle: Focus point = origin = center ; X factor = 0.50 ; Y factor = 1.00
- Remove circle segment A with D2.
  • D2 is functional for all indicated circle segments.
    Tangent or almost is defined as at a distance to the center between R - epsilon and R + epsilon.
    The point on the circle the closest to the line is regarded as intersection.
- Scale the result back with: Focus point = origin = center ; X factor = 2.00 ; Y factor = 1.00

One should end up with a CCW ellipse arc going from parameter angle 180 to parameter angle 130.
The length is reported as NaN ... See topic 11899


The deeper problem here is:
A certain minute offset to a circle is still a circle, quadratic, but the offset to an ellipse is a problematic octic algebraic curve.
There is no easy solution for 'almost' tangent but not crossing the ellipse.

Regards,
CVH

Post Reply

Return to “QCAD Troubleshooting and Problems”