Sutherland–Hodgman Algorithm Variation for Non Degenerate Polygon Output

Viewed 313

I need a fast polygon clipping implementation against an axis aligned rectangle and I've implemented Sutherland–Hodgman algorithm based on my particular data set and it's 40 to 100 times faster than ClipperLib and other generic polygon clipping algorithms, but the output is a degenerate polygon in some cases:

enter image description here

results in:

enter image description here

Is there a variation of Sutherland–Hodgman algorithm to generate multiple polygons instead of a degenerate one or any fast and simple way to transform the degenerate polygon into multiple polygons?

0 Answers
Related