As said before, I've spent some time learning an area called
Computational Geometry. This area is big (and some algorithms tend to be complicated) so I've still not learned everything. In this part I've studied algorithms that will cut polygons in different ways.
SutherlandHodgman. You can use the Sutherland–Hodgman algorithm if you have a polygon and you want to cut away the parts of that polygon that doesn't intersect with another convex polygon. The polygon you want to cut doesn't have to be convex. The result is the intersection between the polygons:
GreinerHormann. The SutherlandHodgman algorithm was kinda limited  it could only find the intersection of two polygons and one of the polygons had to be convex. It can be easily modified if you need the outside of the intersections, but the result is not optimal. If you have concave polygons (or convex or one of each) and you want do do other types of socalled
boolean operations on the polygons, then you need another algorithm. One such algorithm is the GreinerHormann algorithm.

Intersection 

Difference 

ExclusiveOr 

Union 
That's it for now. Next up on the studylist is boolean operations on meshes. You can use one of the above algorithms if you want to do boolean operations on meshes, but better algorithms exist.
Comments
Post a Comment