Hello everyone,

I am trying to create tangent circles to curves but these circles are positioned across certain lines as the picture below:

I was wondering if someone could help to:

- optimize my definition, that I think runs too slow because of the use of inefficient operations (region unions and trims).
- Maybe improve it, as it has some errors… (sometimes circles are bigger or smaller than required).
- Modify it so that when the circles radius is decreased, they are still tangent.

2:

3:

Thanks in advance for any help

Def: Tangent Circles.gh (631.4 KB)

(it does take some minutes to compute)