finishes rotation
This commit is contained in:
parent
e2aac4b267
commit
1ece606db0
18 changed files with 353 additions and 198 deletions
|
@ -342,3 +342,21 @@ export function intersectPolylineBounds(points: number[][], bounds: Bounds) {
|
|||
|
||||
return intersections
|
||||
}
|
||||
|
||||
export function intersectPolygonBounds(points: number[][], bounds: Bounds) {
|
||||
const { minX, minY, width, height } = bounds
|
||||
const intersections: Intersection[] = []
|
||||
|
||||
for (let i = 1; i < points.length + 1; i++) {
|
||||
intersections.push(
|
||||
...intersectRectangleLineSegment(
|
||||
[minX, minY],
|
||||
[width, height],
|
||||
points[i - 1],
|
||||
points[i % points.length]
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
return intersections
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue