I though of the bitmap also, but it uses a lot of memory if resolution is very high and is slow.
There is a trick to creating the perfect offset with no overlaps. If you study corel draw8-10 (the best versions) they had a excellent fast clean, 'Contour' command it will give you some hints.
Gregor, how are you storing the vectors , using an array or linked list ?
Do you have a routine to tell if one chain is inside another ? Thats a hard one . I have one to tell if a contour is ccw or cw no matter how complex it is, but i havn't one to tell if its inside other chains yet.
at the end all chains that are not closed (looped) are thrown away (if closed chain intersects all "good" parts must be looped) |
If your origional chain is CW and you do an intesection check and then join all closed chains. The Ones to keep will all be CW and the gouging (bad) ones (to erase) will all be CCW.