We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › how to offset curves
Page Index Toggle Pages: 1
how to offset curves? (Read 541 times)
how to offset curves?
Mar 5th, 2008, 3:01am
 
I draw a curve using curveVertex commnad. What I want to do with this curve is to make an offset curve. Offset is different from translation, as you know. Anybody know how to make an offset curve in processing?
Re: how to offset curves?
Reply #1 - Feb 4th, 2009, 4:36am
 
I'd like to know how to do this too...I need offset curves from curves I already have...

i feel like geomerative library might be a good starting point, but I dont know the first things about libraries...

http://www.ricardmarxer.com/processing/geomerative/documentation/index.htm
Re: how to offset curves?
Reply #2 - Feb 4th, 2009, 10:07am
 
OK, I bite. What is the difference between offset and translation, then?
Re: how to offset curves?
Reply #3 - Feb 4th, 2009, 8:33pm
 
I'm no expert in geometry, but typically offsetting is about producing a new line where each point is equally located a given distance away from the original curve or surface away from a base surface or curve and consequently each point within a curve is actually being translated in a different direction probably with respect to some center, or perpindicular to the original tangent at the point....just think of a circle being offset inwards or outwards and how the radius of the offset circle is different from the original one. that's probably self explanatory and maybe you are still going to argue that each of those points are still being translated... Smiley

but if it's so simple, how do you do it? I have some shapes and I want to offset them all ...?

a quick google image search came up with this page:
http://moi3d.com/1.0/docs/moi_command_reference7.htm
do a 'find' on the page for offset and it should explain...

thanks!
Re: how to offset curves?
Reply #4 - Feb 5th, 2009, 12:40am
 
Nice reference oompa_l, but now I want to know how to do all of those commands.
Re: how to offset curves?
Reply #5 - Feb 5th, 2009, 12:48am
 
did I create a need you didn't even know you had? interesting Smiley

maybe offset is just something I take for granted as something everybody knows about and uses...I'm in architecture so it's pretty commonplace....
Re: how to offset curves?
Reply #6 - Feb 5th, 2009, 1:12am
 
Haha, actually I use those commands all the time, just not with processing.  You see, I'm an architect also.  At least, now I know who to bug as I go through Terzidis and Aranda/Lasch and convert the MEL script into Processing. Smiley
Re: how to offset curves?
Reply #7 - Feb 5th, 2009, 12:42pm
 
Ah, I see. To take a simple example, a circle will become a larger circle, but a ring will be larger but with a smaller hole, right? For a letter, it will make a bolder character.

As you suppose, the problem isn't trivial, as there is no primitive transform on these.
Indeed, I would look at moving the control points in a direction perpendicular to the curve, toward the outside (or inside if shrinking). So you have to find the perpendiculars and the outside/inside of the shape.

I will take a look at the page you point to.
Re: how to offset curves?
Reply #8 - Feb 5th, 2009, 1:53pm
 
Interesting problem, and I said, not obvious. Wikipedia says: "The curve at a fixed offset from a given Bézier curve, often called an offset curve (lying "parallel" to the original curve, like the offset between rails in a railroad track), cannot be exactly formed by a Bézier curve (except in some trivial cases). However, there are heuristic methods that usually give an adequate approximation for practical purposes.".

I found a paper on the topic: Comparing Offset Curve Approximation Methods (PDF file). It shows several methods, and the culprits (overlapping final curve, for example).
Page Index Toggle Pages: 1