Hole-in-the-Wall (Cyrus-Beck demo)

Published 2021-10-23
This is just a demo of Cyrus-Beck line-clipping, with a bit of 3D thrown in to the mix.
@kriblo recently highlighted Cohen-Sutherland line-clipping, which clips lines to within a rectangle. Cyrus-Beck works differently and allows clipping to within any convex polygon. You can adapt these methods to draw the bit(s) of the line outside rather than inside the shape in question.