Click here to Skip to main content
       

Algorithms

 
JokeRe: How to determine the next x,y coordinate for a tank in a 2-D game... PinmvpCPallini18-Jun-08 21:19 
QuestionPolyline offset algorithm Pinmemberbeko16-Jun-08 21:59 
AnswerRe: Polyline offset algorithm PinmemberAlan Balkany17-Jun-08 4:07 
GeneralRe: Polyline offset algorithm Pinmemberbeko17-Jun-08 4:43 
QuestionRe: Polyline offset algorithm Pinmvp CPallini17-Jun-08 7:03 
AnswerRe: Polyline offset algorithm Pinmemberbeko17-Jun-08 8:26 
GeneralRe: Polyline offset algorithm Pinmembercp987617-Jun-08 12:10 
AnswerRe: Polyline offset algorithm PinmemberArash Partow18-Jun-08 1:22 
There is no simple solution to this problem, the best known general solution, is to create capsules between consecutive point pairs of your polyline where the capsule width is the offset, then union the capsule outlines. The capsule may be centered around the edge or it may be biased towards one side of the edge it is really up to the end requirement. For the union operation use something like Alan Murta's Generic Polygon Clipper library.
 
If you know your polyline is enclosed and represents a convex polygon, then simply calculate the centroid, then offset each edge by the product of the desired offset amount and the vector composed of the mid-point of the edge at hand minus the centroid.
 
A simple example can be found here:
http://www.codeproject.com/KB/recipes/Wykobi.aspx
GeneralRe: Polyline offset algorithm Pinmemberbeko18-Jun-08 19:55 
QuestionWhat's the period of (cos ax)(sin bx)? Pinmembersherifffruitfly14-Jun-08 10:00 
AnswerRe: What's the period of (cos ax)(sin bx)? Pinmembercp987614-Jun-08 19:03 
AnswerRe: What's the period of (cos ax)(sin bx)? PinmemberMarkBrock15-Jun-08 2:00 
AnswerRe: What's the period of (cos ax)(sin bx)? Pinmvp CPallini15-Jun-08 22:02 
QuestionQuaternion to Euler Pinmember Xmen 11-Jun-08 3:08 
AnswerRe: Quaternion to Euler Pinmembercmk11-Jun-08 11:27 
GeneralRe: Quaternion to Euler Pinmember Xmen 11-Jun-08 12:48 
AnswerRe: Quaternion to Euler PinmemberMark Churchill12-Jun-08 18:38 
QuestionGraphical Object drawing algorithms PinmemberMonty29-Jun-08 2:59 
AnswerRe: Graphical Object drawing algorithms Pinmember 73Zeppelin9-Jun-08 3:11 
GeneralRe: Graphical Object drawing algorithms PinmemberMonty29-Jun-08 3:24 
GeneralRe: Graphical Object drawing algorithms Pinmember 73Zeppelin9-Jun-08 3:37 
GeneralRe: Graphical Object drawing algorithms PinmemberTim Craig9-Jun-08 17:37 
GeneralRe: Graphical Object drawing algorithms PinmemberMonty29-Jun-08 21:02 
GeneralRe: Graphical Object drawing algorithms PinmemberTim Craig9-Jun-08 21:15 
GeneralRe: Graphical Object drawing algorithms PinmemberMonty29-Jun-08 22:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.141015.1 | Last Updated 9 Oct 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid