Calculate fillet radius

5.8k Views Asked by At

I want to create a fillet from a predefined point p of an arc A1 to a second arc A2. I need to calculate the radius f.

I have 3 cases where it needs to be calculated

Outside fillet

Inside fillet

Combined

How do I calculate fillet radius ?

2

There are 2 best solutions below

1
On

I will reformulate your problem in a more mathematical way. Given two cirlces $c_1$, $c_2$ and a point $P$ on one them, find the circle $c_3$ that is tangent to both circles and passes through $P$. I will consider the case of both external tangents but I hope you would be able to easily change the solution for other cases.

  1. We know that the center $O_3$ of new circle should lie on a line $O_1P$.
  2. Since $O_1O_3=r_1+r_3$ and $O_2O_3=r_2+r_3$, if we decrease radii of $c_1$ and $c_2$ by some length $d$ and simultaneously increase $r_3$ by the same number, the tangent relation will remain. Having said that, we choose $d=r_2$, so $c_2$ will shrink to point, and circle $c_1$ will transit to circle $c'_1$ with the same center and radius $r'_1=r_1-r_2$. The point $P$ will transit to point $P'$. (If $r_2>r_1$, then $r'_1=r_2-r_1$ and point $P'$ will end on the opposite side from the center)
  3. Now we know that point $O_3$ should be equidistant from points $P'$ and $O_2$, so we construct perpendicular bisector on $P'O_2$. Its intersection with line $O_1P$ gives us the position of $O_3$.
  4. The radius $r_3$ is the distance $O_3P$.

enter image description here

0
On

Only the outside fillet can be calculated given the variables shown in the question: Outside fillet

Note that $b = c$ for the fillet to be a circular arc. From law of sines, we know that $$\bbox{\frac{c + R2}{\sin(70\text{°})} = \frac{R1 + R2}{\sin(f)}} \quad \iff \quad \bbox{\sin(f) = \frac{R1 + R2}{c + R2} \sin(70\text{°})}$$ which means that $$\bbox[#ffffef, 1em]{f = \arcsin\left(\frac{R1 + R2}{c + R2} \sin(70\text{°})\right)}$$


In the general case, you have two circles, one centered at $(x_1 , y_1)$ with radius $r_1$, and the other centered at $(x_2 , y_2)$ with radius $r_2$, and you want a fillet of radius $r$.

The idea of the fillet is that it connects the two circles with a circular arc, meeting the other circles tangentially. From this we can solve for the center of the fillet $(x , y)$, using Pythagoream theorem: $$\begin{cases} (x - x_1)^2 + (y - y_1)^2 = (r + r_1)^2 \\ (x - x_2)^2 + (y - y_2)^2 = (r + r_2)^2 \end{cases}$$ That is directly solvable, but the two possible solutions are nasty-long. Instead, we can simplify the situation by using two temporary vectors, and a temporary variable.

Let $\hat{e}_u$ be the unit vector from the center of the first circle towards the center of the second circle, $\hat{e}_v$ perpendicular to it, and $d$ the distance between the two centers: $$\bbox{\hat{e}_u = \left[\begin{matrix} x_u \\ y_u \end{matrix}\right]} , \quad \bbox{\hat{e}_v = \left[\begin{matrix} x_v \\ y_v \end{matrix}\right]} , \quad \bbox{d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}}$$ $$\bbox{\begin{cases} \displaystyle x_u = \frac{x_2 - x_1}{d} \\ \displaystyle y_u = \frac{y_2 - y_1}{d} \\ \end{cases}} , \quad \bbox{\begin{cases} \displaystyle x_v = y_u = \frac{y_2 - y_1}{d} \\ \displaystyle y_v = -x_v = \frac{x_1 - x_2}{d} \\ \end{cases}}$$ Now, we have a coordinate system $(u, v)$ where the center of the first circle is at $(0, 0)$, the center of the second circle at $(d, 0)$, and the solution is $$\bbox{u = \frac{d^2 + r_1^2 - r_2^2 + 2 r ( r_1 - r_2 )}{2 d}} , \quad \bbox{v = \pm \sqrt{(r + r_2)^2 - (u - d)^2}}$$ and we can easily convert that to our original coordinates using $$\bbox[#ffffef, 1em]{\begin{cases} x = x_1 + u x_u + v x_v \\ y = y_1 + u y_u + v y_v \\ \end{cases}}$$ noting that we now have two solutions, $(x_{+}, y_{+})$ (calculated using positive $v$) and $(x_{-} , y_{-})$ (calculated using negative $v$).

The fillet angle $\varphi_{+}$ and $\varphi_{-}$ is easiest to calculate using the two-argument arctangent, atan2. The angles from the center of the fillet circular arc towards the centers of the two circles are $$\begin{aligned} \theta_{1+} &= \operatorname{atan2}( y_1 - y_{+} ,\; x_1 - x_{+} ) \\ \theta_{1-} &= \operatorname{atan2}( y_1 - y_{-} ,\; x_1 - x_{-} ) \\ \theta_{2+} &= \operatorname{atan2}( y_2 - y_{+} ,\; x_2 - x_{+} ) \\ \theta_{2-} &= \operatorname{atan2}( y_2 - y_{-} ,\; x_2 - x_{-} ) \end{aligned}$$ and $$\bbox[#ffffef, 1em]{\begin{aligned} \varphi_{+} &= A(\theta_{2+} - \theta_{1+}) \\ \varphi_{-} &= A(\theta_{2-} - \theta_{1-}) \\ \end{aligned}}$$ where $A(\theta)$ is a function that takes care of the angles wrapping around, $$A(\theta) = \begin{cases} \theta, & 0\text{°} \le \theta \lt 180\text{°} \\ -\theta, & -180\text{°} \lt \theta \lt 0\text{°} \\ 360\text{°} - \theta, & 180\text{°} \le \theta \lt 360\text{°} \\ 360\text{°} + \theta, & -360\text{°} \lt \theta \le -180\text{°} \\ 0\text{°}, & \theta = -360\text{°} \text{ or } \theta = 360\text{°} \\ \end{cases}$$

To choose which one ($+$ or $-$) is the "correct" fillet, you'd need to know the starting and ending angles of the two circular arcs to be filleted. In practice, you just calculate both, and test which one is the correct one.