Open gvlasov opened 10 years ago
Hello Don't hesitate to ask question creating issues ;)
Answering, in current implementation I don't support custom depth. But it could be easily done as part of face post processing. I need that too and I'm planing to add such functionality in few weeks.
I don't see a way to construct inset polygon(s) from faces. Could you describe in general how should that be done or provide a link, so I can implement it for myself? I thought that to construct inset polygon(s) from straight skeleton, one would need a list of trees of nodes coming from original polygon's vertices, that is, a mutlimap from original nodes to paths that derivative nodes trace while shrinking.
Not all nodes are shrinking, sometimes split event come first. So you need track all edges of the face.
The idea is to for all faces, generate parallel line to the edge, move it for requested depth and cutoff the part of face which is after line. And repeat process for each face. My skeleton algorithm implementation store information about edge (red line) and connected face (yellow area), so you need to generate parallel line (red dot) and find intersection with face (green dot) this what you looking for is line segment between points A and B. Naturally for edges opposite to split event you will find two line segments for one edge ;)
I want to apologize since creating an issue is not the best way to ask a question, but I couldn't find any other way to contact you.
I'm trying to use straight skeleton to construct an inset polygon of the original polygon with depth as a parameter, just like in the first illustration of Aicholzer paper (the left one: http://www.jucs.org/ujs/jucs/Journal/Volume%201/Issue_1_12/a_novel_type_of/images/30e53752.gif).
Is it possible with your straight skeleton implementation? I only see how one can obtain faces after the skeleton is created.
By the way, neat API, much better than twak implementation's.