LineClipping¶
Under Construction
This documentation is auto-generated, and is a work in progress. Please see the source code at https://github.com/phetsims/alpenglow/blob/main/js/clip/LineClipping.ts for the most up-to-date information.
Overview¶
General purpose line-clipping algorithms
@author Jonathan Olson <jonathan.olson@colorado.edu>
Class LineClipping¶
Static Methods¶
matthesDrakopoulosClip( p0 : Vector2, p1 : Vector2, minX : number, minY : number, maxX : number, maxY : number ) : boolean¶
From "Another Simple but Faster Method for 2D Line Clipping" (2019) by Dimitrios Matthes and Vasileios Drakopoulos
This will: - mutate the given points, so that they are clipped to the given axis-aligned bounding box, and - return whether the line segment intersects the bounds
Source Code¶
See the source for LineClipping.ts in the alpenglow repository.