jasonwebb/morphogenesis-resources

Sutherland-Hodgman

Closed this issue · 3 comments

I'd like to suggest Sutherland-Hodgman algorithm to be included.

Thanks @aevinsounds! I've prepared a new section under "code techniques" for polygon clipping in general, listing the Sutherland-Hodgman algo among others. Before I pushed the update though, I was wondering if you could help explain in a sentence or two what polygon clipping is useful for in practice?

The references I've found so far talk about how to do polygon clipping, but I'm not very familiar with the topic so I'm not sure about the "why". Given how much literature there is on the topic, I feel like I'm missing what the generalized problem is. Is it maybe historically important for improving performance by clipping offscreen geometry before rendering?

Im far from an expert about the particular topic - i've only came to use it for some project. From what i concluded from my research on the matter there are a few applications

  • It is used in 2D vector graphics applications, as a creative mean for the designer (for example in illustrator, the Pathfinder tool)
  • As it can be extended in 3D graphics, besides the creative applications, generally speaking, vertex clipping is used for optimise rendering as you mentioned above
  • Also, i saw various examples of this algorithm used in applications related to geolocation / maps, etc - I don't know about this particular one, but it seems like people in the field need ways to define certain areas of interest on a map, saying cities, and further devide them into smaller subsections - which by the way reminds me that the particular algorithm is also used to polygon splitting

Sorry for the wordy and general explaination of all this :) hope it helps somehow !

Added! https://github.com/jasonwebb/morphogenesis-resources#polygon-clipping

Let me know if you think anything should be changed!