6

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?

zipzit
  • 163
  • Do you insist on a parametric form? Otherwise a piece wise defined function will do the job. – Michael Hoppe Oct 08 '16 at 06:15
  • Basically, you want to corner fillet a rectangle? – J. M. ain't a mathematician Oct 08 '16 at 06:15
  • @Michael, you certainly could have piecewise functions as the components of a parametric equation. I imagine B-splines and ilk would be particularly useful. – J. M. ain't a mathematician Oct 08 '16 at 06:16
  • It can be a piece wise function (I'm just using JavaScript...) but I'm really relying on the angle theta, θ as the input. I can iterate θ, perform a test, chose formula A or formula B to obtain X, Y results, iterate and repeat no problem. But the whole thing depends on that angle as the input parameter. – zipzit Oct 08 '16 at 06:34
  • @J.M. Funny, I do have some experience with Splines, didn't even think about that approach, ref: my website theory of CAD example. As I look at those samples, not sure that really makes this any easier. You know the more I think about it, why Knot. That might be a decent approach with the correct setup... – zipzit Oct 08 '16 at 06:36
  • 1
    @zipzit : "why Knot" excellent pun. – Jean Marie Oct 08 '16 at 07:15
  • @JeanMarie. Thx. But... as I get into it, my descriptive geometry model really depends on varying θ as the control parameter. The BSpline/Nurb model uses a totally different type of parameter. No good way to transfer the angle parameter to the Nurb method input parameter, sigh. Knot good. – zipzit Oct 08 '16 at 07:31
  • @zipzit A continuous function approximation $ x=a \cos^n t,, y=b \sin ^n t $ where $n$ is a sufficiently large even integer. – Narasimham Feb 26 '19 at 08:13

1 Answers1

10

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

Ian Miller
  • 11,844
  • Ian, At first glance, pretty awesome work. I'm going to need a day to digest this, before accepting if that's okay? Is that a Matlab --> gif image? That -2rt characteristic blows me away with its simplicity. – zipzit Oct 08 '16 at 08:51
  • The graphic is done in Mathematica. I can add extra images (with different parameters if you like them). – Ian Miller Oct 08 '16 at 09:28
  • Your mention of the $2rt$ term highlighted a mistake in my method due to use $r=a/2=b/2$ in my test image. I've updated my answer. – Ian Miller Oct 08 '16 at 09:47
  • I think for 4 < t < 5 the line should read { −, (−)(2−9) } – aferriss Feb 21 '19 at 18:36
  • @aferriss Thanks. fixed. – Ian Miller Feb 26 '19 at 07:51