5 ms·
If you're like me and first got hung up on the difference between a parallel curve and a translation of the curve, the wikipedia article (literally the first li
by version_five 4y ago
If you're like me and first got hung up on the difference between a parallel curve and a translation of the curve, the wikipedia article (literally the first link) explains it.
My understanding is that a parallel curve is what you get if you dilate the curve with a circle, ie the curve along the furthest extent of the dilation (see the picture in the wikipedia article) which evidently is not the same as just translating the curve down.
https://en.m.wikipedia.org/wiki/Parallel_curve https://en.m.wikipedia.org/wiki/Parallel_curve
- pcwalton 4y agoThe easiest way to understand an offset curve is that it's one side of the shape you get by "stroking" along the source curve, in the SVG sense. Join two offset curves together (one for each side), cap off the ends somehow, and you have the entire shape of a stroked path. It's easy to see how this isn't the same as just translating the path. More precisely, it's the curve you get by taking each point (of which there are infinitely many) on the source curve, tracing out a line of some constant length l along the line perpendicular to that point on the source curve, and joining each such new point together.
- jabbany 4y agoThe "perpendicular to that point" is rather better defined as "perpendicular to all tangents at that point on the source curve".
- rikroots 4y agoSo I tried to create a demo of this (the second paragraph) on CodePen[1]. While it works fine for shallow angles, it leads to some unsightly loops when tracing tightly acute (deep? sharp?) curves. I assume there's a way to mathematically identify the points that form these unwanted loops, so they can be discarded when drawing the parallel curve - but my maths skills aren't up to the job this morning. [1] - https://codepen.io/kaliedarik/pen/jOxqJjm https://codepen.io/kaliedarik/pen/jOxqJjm
- Jasper_ 4y agoA simple counterexample to imagine is a curve that represents a circle (or a circular arc). The parallel curve to this is a scaling of the circle, with a bigger/smaller radii, not a translation.
- jabbany 4y agoThough the circle case is a little bit misleading, since it's only the same as scaling in that one case. In general, finding the parallel curve can't be approximated by affine transforms like scaling or translation, which is why it's so annoying. Also this is surprisingly relevant in a lot of weird places. First I encountered this was trying to create a closed polygon "outline" based on a vector graphics font -- the idea was to approximate the concept of "stroke width" on a platform that could not understand strokes and instead only worked with filled polygons.
- upwardbound 4y agoYep. A way that helps me visualize it is that a parallel curve is what you need to make a set of railroad tracks. The tracks have to always be a constant distance apart when measured along the direction locally perpendicular to the tracks - i.e. the direction of the train's axle.
- aaronblohowiak 4y agoif you have a curve you need to make a parallel to, like for making a two part form for bent lamination, a common trick is to use a washer. you run the washer along the reference curve and your pencil in the hole in the washer. this gives you the parallel curve offset by the width of the solid part of the washer.
- pciexpgpu 4y agoThis sounds even better. I was imagining a similar idea where for every point in the Bezier you have a normal that can extend both directions by a specified amount. The smoothness still requires some interpolation which shouldn’t be too further from normal Bezier interpolation.
- surfskatr 4y agoGreat way to put this thanks. Was also confused between parallel and translated curve, as when sketching a design I’d usually do the former.
- db48x 4y agoThat’s exactly what dilating a curve with a circle means :D
- orlp 4y agoGiven this definition I think you almost never really want the parallel curve though (at least in computer graphics). Its behavior on the inside of corners is degenerate and not what one is looking for in almost any scenario involving curves. So while the authors work is certainly impressive, I would keep looking for a more useful definition and implementation of 'curve alongside another curve' than that of the 'parallel curve' (as mathematically defined in the linked Wikipedia article) before using this.
- upwardbound 4y ago(Speaking as someone who likes model trains.) You need parallel curves to design railroad tracks. Its behavior inside corners is degenerate because in the degenerate case there's no possible way you could make a train turn a corner that tight! You need to take a larger radius for your turns if you don't want your train to end up all crashed in a mess. :-P Here's a nice example of a model railroad track plan: https://www.scarm.info/layouts/track_plans.php?gallery=10;0 https://www.scarm.info/layouts/track_plans.php?gallery=10;0 There's software to help with designing these plans, which I guess must use parallel curves under the hood.
- orlp 4y agoThat makes sense, I have already edited my comment to say specifically computer graphics since posting since I realized it could have very useful applications in physical modeling, or other scenarios where you specifically care about the constant distance metric, like you mention.
- upwardbound 4y agoNice, makes sense. I don't know much about computer graphics. What are some examples where you'd use translated curves? Are you referring to stuff like modeling strands of hair, and you'd make them using translations of a template strand's curve? Or what kind of problems do you typically face? Is there some kind of "compromise" option that uses parallel curves where possible but falls back to translated curve segments when there's a degeneracy? (If that would be useful at all - I have no idea)
- bawolff 4y agoThanks for this. I was also really confused.
- weinzierl 4y agoIn addition to that a parallel curve is not necessarily in the same class as the original curve. For example the parallel curve of a cubic Bézier is itself not expressible as a cubic Bézier. So, while the translation of a curve is pretty simple the parallel curve can get tricky to deal with analytically. A good source for this kind of stuff is also Knuth' work on Metafont, even if Metafont iself completely side-steps these issues by just painting many circles along the original curves to produce the parallel.