Interface: Vec
Small, dependency-free 2D geometry kernel.
Conventions:
- Coordinates are SVG-style (y grows downward), but all math is orientation-agnostic.
- Polygons are arrays of vertices without a repeated closing vertex.
- "Positive" orientation means a positive shoelace area. All internal polygons are normalized to positive orientation, so the interior is to the left of each edge in the shoelace sense and the inward normal of edge (dx, dy) is (-dy, dx).
clipConvexneeds a convex clip polygon (the subject can be any simple polygon);insetConvexneeds a convex polygon andcontainsPolygona convexouter. Non-convex tiles are inset withinsetPolygon(offset.ts).
Properties
x
ts
x: number;y
ts
y: number;