Thanks for the response wp.

Sutherland-Hodgman clipping requires that the clipping region be a simple (not self-intersecting or with holes) convex polygon. The Wikipedia page

https://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_algorithmhas a nice summary. The pseudocode on that page is similar to my code, but I moved the "lines intersect" code so it is only called if one point is inside. This avoids the calculation when both points are outside.

The "inside" function is not the same as an "inside polygon" function. It computes which side of a clip region edge the point is on. One other point is that some of the Rosetta code examples use slope-intercept forms instead of parametric forms. I prefer to avoid the slope-intercept form, which can introduce infinities.

I have also implemented Cyrus-Beck and Cohen–Sutherland line segment clipping.

I will have a look at the GraphUtils unit to see if any of these might be useful additions.

EDIT: I am unsure about the restrictions on the subject polygon. It does not need to be convex, but I am unsure about self-intersecting or with holes. Maybe a few tests are in order.