S.O.S. Mathematics CyberBoard

Your Resource for mathematics help on the web!
It is currently Tue, 21 May 2013 17:14:33 UTC

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: define the leeway of a line
PostPosted: Wed, 25 May 2011 07:55:52 UTC 
Offline
S.O.S. Newbie

Joined: Sun, 27 Mar 2011 05:00:52 UTC
Posts: 4
I'm trying to create or locate an algorithm to render the "+/- leeway" around a two-dimensional vector line. The horizontal and vertical leeway values are arbitrary, as is the line's path (although it will not overlap or loop back on itself).

--

Here are some diagrams to help the above make sense:

Image

The first diagram shows the original line, with the control points marked with dots.

The second diagram shows "leeways" around each control point; in this case the allowed variation in the vertical direction is about twice the allowed variation in the horizontal direction, creating a rectangle around each point.

As a last resort I could just render each of those rectangles, and join them up to make the leeway "volume" continuous. The third diagram connects corner lines to each rectangle, which shows that the volume I'm aiming for is contained within all the quads and various surfaces that could be created by connecting the quads together.

I call that a last resort because I need this to be as fast as possible, meaning that I need the simplest geometry possible. This example has less than 20 control points, but I could be dealing with lines that contain thousands.

The fourth diagram shows that the simplest geometry is found by tracing the very outermost corners above and below the line. Although the two corners that are < 90 degrees have locations that are not at the corner of a rectangle (they're at the intersection of two lines).

Finally, the last diagram shows what I'm aiming for, with the lines of the previous diagram easily turned into a strip of triangles suitable for rendering with OpenGL or whatever.

--

I've been trying to figure out some rules to define the two lines of diagram 4, without success so far.

Any thoughts appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Fri, 27 May 2011 13:39:28 UTC 
Offline
S.O.S. Newbie

Joined: Sun, 27 Mar 2011 05:00:52 UTC
Posts: 4
Update: I got this working. Problem solved.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Contact Us | S.O.S. Mathematics Homepage
Privacy Statement | Search the "old" CyberBoard

users online during the last hour
Powered by phpBB © 2001, 2005-2011 phpBB Group.
Copyright © 1999-2013 MathMedics, LLC. All rights reserved.
Math Medics, LLC. - P.O. Box 12395 - El Paso TX 79913 - USA