QCAD Bugtracker

  • Status Assigned
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category ECMAScript
  • Assigned To
    Andrew
  • Operating System All
  • Severity Very Low
  • Priority Very Low
  • Reported Version n/a
  • Due in Version Undecided
  • Due Date Undecided
  • Votes 1
    • CVH (31.03.2025)
  • Private
Attached to Project: QCAD Bugtracker
Opened by CVH - 31.03.2025
Last edited by CVH - 31.03.2025

FS#2658 - RCircle::getTangents(point) should reject point on circle

Andrew,

When in RCircle::getTangents(point) the Thales circle radius is less than the radius of the given circle then the point is inside the circle resulting in: No tangents.

But when the point is on or very near the given circle the resource defines a tangent that connects the point and the single intersection point with the touching Thales circle.
The result may be erratic depending the outcome of getIntersectionPointsCC.


A tangent from a point to a circle or any limited line segment that is equal or shorter than 1e-6 has no well defined orientation: RLine::getAngle() returns zero by default.

The correct single tangent orientation would be orthogonal with a line towards the center of the given circle. Not zero by default or inline with the normal at that point.

Also excluding touching circles is thus mathematically more correct.

    if (thalesRadius <= getRadius()/2.0) {
        return ret;
    }

Introducing a tolerance is tricky. RS.PointTolerance = 1e-9 for example.
Because for a large circle there can be 2 tangents longer than 1e-6 to a point that is not further than 1e-9 outside the circle.
And because that getIntersectionPointsCC exploits a dynamic tolerance related to circle radii for other reasons.


Workaround: A valid point outside a circle has 2 (limited) tangents with the circle.
None or just one RLine shape can then be excluded as a situation with valid tangents.

Counter indication found in Draw/Line/LineTangent1/LineTangent1.js and RSnapTangential::snapEntity(...) for a circle or an arc where a single solution is considered as valid.

Regards,
CVH

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing