How can I get the length of the red line, if I got the diameters of all black circles? I'd prefer to get the lengths of the right example but I think it's much more difficult.
It is easier to calculate the length of the red-stripe on RHS.
Suppose c1, c2, c3 and r1, r2, r3 are the centers and radia of the big circle, the small-circle-at-the-top and the small-circle-at-the-bottom resply.
I am assuming the red-line is tightly surrounding the circles so that it is a straight line between the points of tangency of circle pairs and is overlapping the portions of perimeter the rest of the times.
Suppose the points of tangency of the red line to (c1,r1) is p1, and to (c2,r2) is p2. The segments between the points p1&c1 and p2&c2 are parallel to one another since the same line tangent to both is at a straight angle with both of these segments. And, since (if) the tree circles are tangent to one another, the segment between c1 and c2 is passing thru the point of tangency between the circles centered at c1 and c2 and the length of this segment is r1+r2.
On the trapezoid with corners (p1, p2, c2, c1), you know the angles at corners p1 and p2, the length of the parallel sides r1=length-of-segment-between p1-c1 and r2. This is more than to calculate the degrees of other 2 angles. When you work this on all three trapezoids over the circle pairs, you also have the degrees of those angles at each radius seeing that portion of the circle covered by the red stripe.