6
$\begingroup$

I'm trying to draw on the computer a curve that keeps always the same distance(given as parameter) from a given curve. I know the formula for the given curve. I tried moving perpendicular to the first derivative but in some cases when the curve is sharp there are a lot of points creating some problems. This problem happens when the moving the curve with a distance greater that the radius of the curve.

Is there a simple/standard way of drawing this kind of drawing?

To be more precise I'm using these ("Parallel Curves") formulas when obtaining the above result. It works fine as long as the curve has no "sharp turns". This is the case that bothers me.

Thank you,

Iulian

$\endgroup$
2

5 Answers 5

13
$\begingroup$

If you just want a good easy picture, the simplest thing to do, as sugggested by Charles Matthews' comment, is to draw lots of equal radius circles centered about points on the curve. Your eye and brain will see the envelope. You could also draw lots of disks, or just use a computer drawing program such as Adobe Illustrator, make two copies of the curve (for instance on different layers) and give the lower copy a large stroke-width and a light color. (You can start from a PDF file that contains the mathematical curve, open it in Illustrator or a similar program, and edit as above).

If you want a more mathematical description or construction, the equidistant curves for a smooth curve $\gamma$ depend on the cut locus for $\gamma$. The cut locus is the set of points where there is more than one closest point on $\gamma$, and it is closely related to the whole theory of Voronoi diagrams. You can compute a good approximation of it from a Voronoi diagram program or a convex hull program, if you lift the curve to the paraboloid $z = x^2 + y^2 \subset \mathbb R^3$. In the complement of the cut locus, there is a smooth map $(x, y) \to C(x, y)$ where $C(x,y)$ is the closest point on $\gamma$; it can be traced out implicitly, it's the inverse function to what you're already doing. For a generic smooth curve, the cut locus is a piecewise smooth tree, whose endpoints are centers of osculating circles where the curvature of $\gamma$ has a local maximum. (However, in general, the cut locus can be quite complicated and have infinitely many branches, even for a $C^\infty$ curve). The edges of the cut locus can be traced from these endpoints, using the implicit function theorem; the main difficulty is keeping track of enough information to get the correct combinatorics for the graph. It's equivalent to the problem of constructing the convex hull of a simple curve on the paraboloid above.

$\endgroup$
0
8
$\begingroup$

You might look at the CGAL Manual, Section 24.3 "Offsetting a Polygon," which describes how to compute the offset curve for a simple polygon via convolutions. The left image below shows the basic idea (and also serves to illustrate Bill Thurston's point about drawing equal-radii circles), and the right image illustrates a challenging example. [Both images from the CGAL manual.] Offset curves are used in many practical contexts (e.g., numerically controlled (CNC) milling machines), and so have been studied intensively. Despite that study, there is no simple way known to compute the offset.
Offset Polygons
To further supplement Bill's answer, Adobe Illustrator has an "offset-curve" option: Select the curve, select "Object | Path > Offset Path ...", enter the radius, and you get something like this:
           Offsets

$\endgroup$
1
  • $\begingroup$ I didn't know about the object > path > offset path function. Cool! I've been doing this kind of thing in more roundabout ways, using Object > Expand .... after making a thick path. I see that for a closed curve, it offsets in only one direction. $\endgroup$ Apr 8, 2011 at 2:51
2
$\begingroup$

Patrikalakis Maekawa and Cho have a relatively simple approach which may be useful. They essentially take the control point polygon for a spline, and try to offset it, then evaluate the deviation between the curves and if the deviation is insufficiently exact, they split the spline and try again.

http://web.mit.edu/hyperbook/Patrikalakis-Maekawa-Cho/node222.html

enter image description here

Alternatively, Gabriel Suchowolski's paper, Quadratic bezier offsetting with selective subdivision.

$\endgroup$
1
$\begingroup$

Surfaces

When one parameter curves are given a particular polar symmetric situation can be handled. On an arbitrary axisymmetric patches with polar symmetric geodesics with a common Clairaut's constant $ r_o$ minimum radius of fiber tangency obey differential equation:

$$ r_o= r \, \sin \psi= const $$

Orthogonal trajectories of these geodesic family are given by $ \psi\rightarrow \pi-\psi $

$$ r_b= r \, \cos \psi= const $$

which can be called 3D involutes as orthogonal trajectories. On the following surface, 2D geodesics can be seen on the outside and equidistant tubes drawn for 3D clarity on the inside.

Just as in the plane case, the width of cyclic involutes is constant, a concept inherent with radial geodesic polar coordinate parameter.. right from Leibnitz's time.Const Width Strip

Planar case

Involutes of circle ( we know how it is constructed using a string ) have constant width marked $w$ along common normal brought on from originating base circle circumference arc.

The base circle radius is an invariant of transformation. Width $w$ is seen as a fraction of $r_b$.

$$ r_b = r \cos \psi \tag1 $$

Differentiating w.r.t arc

$$ \psi ^{'}= \frac {\cos^2\psi}{r\, \sin \psi} \tag2 $$

Curvature of involute

$$ = \phi^{'}= (\psi^{'}+ \theta^{'}) =(\psi^{'}+ \frac{\sin \psi}{r}) = \frac {\cos^2\psi}{r\, \sin \psi}+\frac{\sin \psi}{r}=\frac {1}{r\, \sin \psi}= \frac{1}{TP} \tag3$$

$$ r^2 = {(r\, \sin \psi)}^2+{(r\, \cos \psi})^2= TP^2 + OT^2\tag4$$

$$ Width = w = T_1T_2 = r_b\, \beta = 2 \pi r_b\, \frac{\beta}{2 \pi} \tag5 $$ is constant because for the taut unwinding part of string it is shown circumferentially carried outward along involute arc.

$\endgroup$
0
$\begingroup$

If the equation of the original curve is y=f(x), than the curve with an offset of d will have the equation y=f(x)+/-d*(1+f'(x)^2)^0.5, where f'(x) is the derivative of f(x).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.