Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java library for creating straight skeleton?

I have as an input a 2D polygon with holes, and I need to find it's straight skeleton, like in the picture:


(source: cgal.org)

Maybe there is a good Java library for it?

And if not, can you point me to the good explanation of the algorithm, so I could implement it myself? (I haven't found good resources on Google)

like image 638
Rogach Avatar asked Apr 12 '11 18:04

Rogach


3 Answers

I wrote this a little while back. Not sure if it's robust enough. https://github.com/twak/campskeleton

(edited for 2018...)

like image 113
twak Avatar answered Oct 19 '22 14:10

twak


See http://www.sable.mcgill.ca/~dbelan2/roofs/roofs.html which contains an applet.

like image 3
lhf Avatar answered Oct 19 '22 15:10

lhf


You may be able to use the JTS Topology Suite. It is a very capable library that I've used on a number of projects - never for straight skeleton, but it may be possible.

like image 2
Chris Avatar answered Oct 19 '22 14:10

Chris