Skip to content

GridClipping

Overview

Clipping arbitrary (degenerate, non-convex, self-intersecting, etc.) polygons to within a grid.

@author Jonathan Olson <jonathan.olson@colorado.edu>

Class GridClipping

import { GridClipping } from 'scenerystack/alpenglow';

Static Methods

gridClipInterceptIterate( startPoint : Vector2, endPoint : Vector2, minX : number, minY : number, maxX : number, maxY : number, stepX : number, stepY : number, stepWidth : number, stepHeight : number, callback : GridClipCallback )

TODO: See if we can get the intercepts to work, since it WOULD be higher performance. Can we perturb the TODO: intercepts to values that will be acceptable? @deprecated

gridClipIterate( startPoint : Vector2, endPoint : Vector2, minX : number, minY : number, maxX : number, maxY : number, stepX : number, stepY : number, stepWidth : number, stepHeight : number, callback : GridClipCallback )

Type GridClipCallback

import type { GridClipCallback } from 'scenerystack/alpenglow';

( cellX: number, cellY: number, startX: number, startY: number, endX: number, endY: number, startPoint: Vector2 | null, endPoint: Vector2 | null ) => void

Source Code

See the source for GridClipping.ts in the alpenglow repository.