I'm referring to this Straight Skeleton. For example, after generate a straight skeleton structure for a strictly simple polygon such as below, my goal is to extract the red line. At first, I figure it would be simply not including the edges which contain vertex lie on the polygon contour, but I soon realised with cases such as the second figure, even with doing so, I would still have some "branches" left that is not filtered out.

Any suggestion? enter image description here enter image description here

| cite | improve this question | | | | |
  • 1
    $\begingroup$ I guess the first step would be to define exactly what "top of the roof" means. In other words, how do you do it manually: What is your rule? I think having a clear definition of this would suggest possible algorithms. I hope this helps. $\endgroup$ – ad2004 Dec 29 '19 at 4:01
  • $\begingroup$ I think you should measure the distance from each of the skeleton vertices to the closest point on the contour, and treat this as a height. You can identify top of roof segments by having higher endpoints than others. But the exact criterion is going to depend on your definition, as ad2004 says. $\endgroup$ – Paul Sinclair Dec 29 '19 at 22:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.