Frage

I'm doing plane sweep polygon triangulation. And for example, when I encounter split vertex, I should make it helper of edge of polygon that is lying immediately above this (split) vertex. Also, I should have data structure (sweep line status) that has sorted edges from top to bottom. How do I sort them and how do I determine what edge of polygon is lying immediately above processed vertex? I'm doing program in C#.

War es hilfreich?

Lösung

I found one way to do it.

I can find intersection between sweep line and edges of polygon and then sort them by X coordinates of their intersection points. That way I can also easily find out which edge lies immediately above current vertex.

I'm just wondering if there is some more efficient way?

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top