Extend 2d polygon by vector
<p>I have convex polygons, and I want to extend them by projecting along a vector like so:</p>

<p><a href="https://i.stack.imgur.com/rDRT9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rDRT9.png" alt="enter image description here"></a></p>

<p>(Original polygon and vector on left, desired result on right.)</p>

<p>My polygons are stored as a series of points with counter-clockwise winding. What I want to find are the "starting" and "stopping" point that I need to project from, as in the circled vertices below.
<a href="https://i.stack.imgur.com/l2Vwc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l2Vwc.png" alt="enter image description here"></a></p>

<p>(The green arrows are to indicate the polygon's winding, giving the "direction" of each edge.)</p>

<p>My original plan was to determine which points to use by projecting a ray with the vector's direction from each point, and finding the first and last points whose ray doesn't intersect an edge. However, that seems expensive.</p>

<p>Is there a way I can use the edge directions vs the vector direction, or a similar trick, to determine which points to extend from?</p>