Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Divide self intersecting polygon (C Code)

I want to divide a self-intersecting polygon into simple polygons. I have the edges and the intersection points saved in a data structure (a connected list).

So here is an example. I have a connected list with the x,y coordinates of the edges and the intersection points of the polygon. According to the polygon in this picture it would be :: (1) -> (2) -> (3) ... -> (7). What I'm trying to do is to get the edges of the simple polygons (triangles here). In this case :: 1,2,7 / 3,4,5 / 5,6,7.

like image 498
ItsMe Avatar asked Jun 17 '26 16:06

ItsMe


1 Answers

I would think that Bentley-Ottman would be your best bet. There's a nice interactive visualization here. Another nice description here.

like image 94
MPG Avatar answered Jun 20 '26 08:06

MPG