[Math] Parametric Equation for Rectangular Tubing with Corner Radius

geometryparametrization

I'm working on a problem where I need the parametric equation for a complex shape.

different shapes: circle, eclipse, rectangle, tube

Parametric equation of a circle:

 x = a * cos θ
 y = a * sin θ

Parametric equation of an ellipse:

 x = a * cos θ
 y = b * sin θ

Parametric equation of a rectangle, reference:

 x = a * (|cos θ| * cos θ + |sin θ| * sin θ)
 y = b * (|cos θ| * cos θ - |sin θ| * sin θ)

Parametric equation of a tubing with radius at the corners:

??  inputs = a, b and material thickness (i.e. corner radius = 2 * thickness)

The shape I'm trying to model is hollow rectangular steel tubing. As manufactured, hollow steel tubing has a 'corner' radius = two times material thickness, per standard ASTM A500-10.

Ultimately I'm working on a free tube notching calculator and pattern generator. I'd like to add a feature for rectangular tubing to rectangular tubing. I'm really relying on the parametric angular input to complete the model. I'm pulling out my hair trying to develop a functional parametric equation for the hollow steel outer shape (with radius at each corner) to use in my Descriptive Geometry analysis.

Any recommendations on how to proceed here to obtain a parametrized form of a rectangle with sized corner radius?

Best Answer

Piecewise vs Parametric

As discussed in the comments this can be done piecewise or parametrically. The difference is minor. Any pieces of a piecewise function can be joined into a single function by the following:

$$f(t)=\begin{cases} f_1(t) & a_0<t\le a_1 \\ f_2(t) & a_1 < t \le a_2 \\ f_3(t) & a_2<t\le a_3 \\ & etc\end{cases}$$

$$f(t)=p[a_0,a_1,t]f_1(t)+p[a_1,a_2,t]f_2(t)+p[a_2,a_3,t]f_3(t)+\cdots$$

where $p[n,m,x]=\frac{1}{2}\left(1-\frac{|x-n|}{x-n}\cdot\frac{|x-m|}{x-m}\right)$. The function $p$ returns $1$ when $n<x<m$ and $0$ otherwise.

Piecewise Solution

$a$ is the horizontal "radius" of the pipe. I.e. the horizontal distance between the two sides is $2a$.

$b$ is the vertical "radius" of the pipe. I.e. the vertical distance between the two sides is $2b$.

$r$ is the radius of the corner pieces.

$$f(t)=\begin{cases} \{a,-(b-r)(2t-1)\} & 0\le t\le 1 \\ \left\{a-r+r \cos \left(\frac{1}{2} \pi (t-1)\right),-b+r-r \sin \left(\frac{1}{2} \pi (t-1)\right)\right\} & 1<t\le 2 \\ \{-(a-r) (2t-5),-b\} & 2<t\le 3 \\ \left\{-a+r-r \sin \left(\frac{1}{2} \pi (t-3)\right),-b+r-r \cos \left(\frac{1}{2} \pi (t-3)\right)\right\} & 3<t\le 4 \\ \{-a,(b-r) (2t-9)\} & 4<t\le 5 \\ \left\{-a+r-r \cos \left(\frac{1}{2} \pi (t-5)\right),b-r+r \sin \left(\frac{1}{2} \pi (t-5)\right)\right\} & 5<t\le 6 \\ \{(a-r) (2t-13),b\} & 6<t\le 7 \\ \left\{a-r+r \sin \left(\frac{1}{2} \pi (t-7)\right),b-r+r \cos \left(\frac{1}{2} \pi (t-7)\right)\right\} & 7<t\le 8 \end{cases}$$

This varies the parameter $t$ over the range $[0,8]$. If a range of $[0,2\pi]$ is required then just apply a scaling factor: $g(t)=f\left(\frac{4t}{\pi}\right)$

Image $(a=1,b=1,r=0.5)$

enter image description here

Image $(a=8,b=5,r=2)$

enter image description here

Related Question