QCAD Bugtracker

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category QCAD (main)
  • Assigned To
    andrew
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version 3.30.1
  • Due in Version Undecided
  • Due Date Undecided
  • Votes 1
    • CVH (18.07.2024)
  • Private
Attached to Project: QCAD Bugtracker
Opened by CVH - 18.07.2024
Last edited by andrew - 29.08.2024

FS#2589 - Apollonius.getCommonTangents(...) may fail to return the correct tangents

Andrew,

Related to Draw > Circle > Circle2TP > Apollonius.getSolutionsPCC

In some occasions the returned tangents are misplaced.
After inversion resulting in not valid tangent circles and cleaned out by Apollonius.verify(...)

Documented such a result in the attached file:
- c1 and c2 are the inversion circles ordered by size.
- CommonTangents[0-3] are the returned tangents (red)
- added code references for tangents1
- the expected tangents are in green.

For some reason the order of things matters.
Most probably other resources rely on that.

In the case of Apollonius.getSolutionsPCC it doesn’t.
All returned tangents are inversed to possible solutions.
Verified and returned.
https://github.com/qcad/qcad/blob/master/scripts/Apollonius.js#L988-L996
None of documented tangents will produce valid solutions.

The fix here is to use ShapeAlgorithms.getTangents(...) instead.
Although that it also includes a flaw (FS#2588)

I also suspect that this is one of the reasons why Apollonius may fail to produce (all) solutions for common cases.
Why methods for creating tangent circles are incomplete.

Regards,
CVH

Closed by  andrew
29.08.2024 13:57
Reason for closing:  Implemented
CVH commented on 27.07.2024 07:10

Andrew,
Studied this in depth for solving Circle2TP exceptions or incomplete results.

Below is my code for finding all possible tangents between 2 shapes.
Primarily for 2 RCircle shapes.
Including support for RLine shapes and RPoint shapes as zero sized circles.

I included the adapted tangents code as a js file: Apollonius.getAllTangents.js
An overview of what is returned is included: Apollonius_getAllTangents.dxf

Regards,
CVH

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing