Concave to Convex

Post questions on how to use or achieve an effect in Inkscape.
Mc-Po
Posts: 3
Joined: Thu Apr 22, 2010 5:55 am

Concave to Convex

Postby Mc-Po » Thu Apr 22, 2010 6:03 am

Is There a way to tessellate a concave polygon (path) to a convex one

Ive been searching and im amazed it hasnt turned up any results, considering the amount of people using inkscape for a game editor
I would be willing to write my own script, but no point reinventing the wheel

also btw, would it be possible to change the Flatten Bezier Curves extension, to be dynamic. So it could be changed as the project progresses, (id be the one editing the script)

Thanks alot, truly amazing piece of kit, got my tech department in school using it

llogg
Posts: 443
Joined: Tue Mar 11, 2008 7:30 am

Re: Concave to Convex

Postby llogg » Thu Apr 22, 2010 6:41 am

For your first question simply draw your "concave polygon" then draw your "convex" polygon. Select both and do Extensions>Generate from Path>Interpolate.

Mc-Po
Posts: 3
Joined: Thu Apr 22, 2010 5:55 am

Re: Concave to Convex

Postby Mc-Po » Thu Apr 22, 2010 8:12 am

Thanks, however it doesnt give the result im looking for

this is want im looking for
Image

and interpolating gives something similar to
Image

Regarding the triangulating pic above, id prefer if it was larger polygons with the least number of accumulative sides, but id take either
btw its for processing with SAT collision later on

llogg
Posts: 443
Joined: Tue Mar 11, 2008 7:30 am

Re: Concave to Convex

Postby llogg » Thu Apr 22, 2010 1:10 pm

The image of what your looking for does not show up. In the second image you do not appear to actually have polygons. I'm not clear exactly what you want because I don't think I understand the terms your using in the same way as you do. For instance, in your "triangulating pic" I don't see anything that would be described as concave.
http://en.wikipedia.org/wiki/Convex_and ... e_polygons
What I had envisioned was going from something like a pentagon to a five pointed star shape. If this is not what you want please post an example or describe more fully what you're after.
g2867.png
g2867.png (10.66 KiB) Viewed 2474 times

User avatar
RobA
Posts: 335
Joined: Fri Aug 10, 2007 1:22 am

Re: Concave to Convex

Postby RobA » Fri Apr 23, 2010 2:15 am

He wants to "tessellate" a concave (or holed) n-gon into some number of convex polygons (or triangles, in the simplest case).

aka Polygon triangulation: http://en.wikipedia.org/wiki/Polygon_triangulation

Don't think it has been done for Inkscape yet.


-Rob A>

Mc-Po
Posts: 3
Joined: Thu Apr 22, 2010 5:55 am

Re: Concave to Convex

Postby Mc-Po » Fri Apr 23, 2010 6:10 am

Yep
thats what i want with less triangles (optimised version would be the ones with least sides/lines, as SAT is too be used)

i now have too options
write my own triangulation script for inkscape
or use GLU for triangulation

Basically if i was too create my own script, would it be used by others


Return to “Help with using Inkscape”