2
$\begingroup$

Suppose we for any interval of the unit circle, we can approximate by some cubic Bezier curves($B_3(t)$).

Q: Can we use above method(or curve $B_3(t)$) to approximate the offset of any cubic Bezier curve?

The (exact) offset curve, to the known curve $C(t)$, is of the form

$$C(t)+d\cdot N(t),$$ where $d$ is the distance to the curve $C(t)$ and $N(t)$ denotes the normal direction at each point $C(t)$.

  • 0
    Though I know rather well this issue, it is very hard to understand your question ; what do you mean by the "offset..." ? What is given ? What is looked for ?2017-01-15

2 Answers 2

2

Theoretically, you can approximate a cubic Bezier curve by circular arcs (This is called biarc fitting). You can then offset these circular arcs (which is a much easier task) and use the resulting circular arcs as the approximation of the offset of the original cubic Bezier curve.

However, this approach does not necessary give you a good result as the offset direction obtained from the approximating circular arcs are not the actual offset direction from the cubic Bezier curve and this discrepancy will lead to offset error proportional to the offset distance, which is undesired.

2

I'm not sure exactly what you're asking. It sounds like you want to approximate an offset of a Bezier curve. To do this, you propose to approximate the given Bezer curve by circular arcs, and use offsets of these arcs (which are easily computed) as an approximation of the offset of the original Bezier curve.

I think this would work. I'd recommend an iterative subdivide-and-test type of algorithm. The steps are as follows:

  1. Approximate the given Bezier curve $C$ by a single biarc curve (look up biarc approximation)
  2. Offset the biarc curve, which will give you another biarc curve, $B$.
  3. Check the deviation between $B$ and the offset of $C$. If the deviation is too large, split the original curve into two and go back to step #1.

The deviation checking in step #3 is easy enough. Calculate a sequence of points on the offset of $C$, and measure their distance to $B$. Compare the maximum distance to some error tolerance that you choose. Around 10 test points is probably enough.