Is there a relationship between the length of the inner and outer edges of a curve with a given width?

251 Views Asked by At

If you have an arbitrary line, say a bezier curve, that has a width, is there a relationship between the length of the curve at the inner and outer edges? Given the width of the curve at the centerline, can you determine the length at ±width/2 distance from the centerline?

2

There are 2 best solutions below

7
On BEST ANSWER

Let $\gamma : [0,L] \to \mathbb{R}^2$ be any $C^2$ curve (i.e. continuously differentiable up to $2^{nd}$ order) parameterized by arc-length $s$ with length $L$. Let

  • $t(s) = \frac{d\gamma(s)}{ds}$ and $n(s)$ be the tangent and normal vector of $\gamma$ at point $\gamma(s)$.
  • $\theta(s)$ be the angle${}^{\color{blue}{[1]}}$ between $t(s)$ and the $x$-axis.
  • $\kappa(s) = \frac{d\theta(s)}{ds}$ be corresponding curvature and choose the sign of $n(s)$ such that $$ \begin{cases} \frac{dt(s)}{ds} &= \kappa(s) n(s)\\ \frac{dn(s)}{ds} &= -\kappa(s) t(s) \end{cases}$$

One way to define a parallel curve (also known as offset curve) at a signed distance $\rho$ from $\gamma$ is the curve with following parameterization

$$\gamma_{\delta} : [0,L] \ni s \quad\mapsto\quad \gamma(s) + \rho n(s) \in \mathbb{R}^2 $$

When $\rho$ is sufficiently small (i.e. $|\rho \kappa(s)| < 1$ for $s \in [0,L]$), the curve will also be $C^2$ without any strange artefact like a cusp. The length of $\gamma_\delta$ will be given by an integral

$$\int_0^L \left| \frac{d\gamma_{\delta}(s)}{ds}\right| ds = \int_0^L \left| \frac{d\gamma(s)}{ds} + \rho \frac{dn(s)}{ds}\right| ds = \int_0^L \left| ( 1 - \rho\kappa(s)) t(s) \right| ds\\ = \int_0^L \left(1 - \rho\frac{d\theta(s)}{ds}\right)ds = L - \rho \Delta\theta$$ where $\Delta\theta = \theta(L) - \theta(0)$ is the change of $\theta$ between the two endpoints of $\gamma$.

Apply this to a Bézier curve with length $L$ and width $w$. As long as the Bézier curve doesn't self intersecting nor have any cusp, the curve of the outer/inner edges will be $L \pm \frac{w}{2}\Delta\theta$. Which sign to use depends on the orientation of curve and how you call an edge outer/inner.

The result can be extended to $B$-spline consists of $C^2$ Bézier curves ($C^2$ with respect to arc-length) as segments. As long as the segments are joined together with matching tangent vectors (i.e. $C^1$ over whole spline) and the $B$-spline doesn't self-intersect, above formula remains valid (for sufficiently small $w$).

Notes

  • $\color{blue}{[1]}$, the angle $\theta$ between $t(s)$ and $x$-axis is defined only up to multiples of $2\pi$. In above derivation, $\theta(s)$ is chosen so that it is continuous over $[0,L]$. Even when $t(0) = t(L)$, there is no need for $\theta(0)$ equal to $\theta(L)$.

    As an example, consider a circle with a short segment at the bottom removed. We have $t(0) \approx t(L)$ but $\theta(0) \approx 0$ while $\theta(L) \approx 2\pi$.

14
On

"say a bezier curve, that has a width" How do you define this object? If the edges of this object are just the same bezier curve itself, you have your answer. If the edges are something else, it depends on your definition.