LibreCAD icon indicating copy to clipboard operation
LibreCAD copied to clipboard

Circle tangent to 3 Cirles fails

Open hhassey opened this issue 10 months ago • 3 comments

While trying to create a fourth (red) circle tangent to other 3 circles, LibreCAD fails to draw the circle in this particular arrangement.

Image

It will not let you select the third circle no matter what order you choose them .

Intended behavior: have LibreCAD draw the red circle upon choosing the other 3 circles.

hhassey avatar May 26 '25 22:05 hhassey

circle.dxf.zip

@hhassey

Could you upload a sample dxf with this issue? I cannot reproduce this issue with the latest (2.2.2_alpha)

Image

dxli avatar May 27 '25 10:05 dxli

@dxli Github would no let me upload dxf file. but here it is a link to it I am using: Version: v2.2.1.1 Compiler: GNU GCC 14.2.1 Compiled on: Feb 19 2025 Qt Version: 5.15.17 Boost Version: 1.87.0 System: Arch Linux

hhassey avatar May 27 '25 19:05 hhassey

The root cause: failure of the Algebraic algorithm as described here https://en.wikipedia.org/wiki/Problem_of_Apollonius, when the x-coordinates or y-coordinates of input circle centers are identical.

The fix in 3c4196e: when the algebraic algorithm fails, falls back to a generic center finding algorithm by the paths of shared tangential circles of two given circles.

dxli avatar May 30 '25 11:05 dxli