import type { Point } from '../Vector2' import { Path } from './Path' export class NestCache { static count1 = 0 static count2 = 0// noset static PositionCache: { [key: string]: Point } = {} static NoPutCache: { [key: string]: Set } = {} private static CacheRect = new Map() /** * 用于创建原点在0点的矩形路径 */ static CreatePath(x: number, y: number, knifRadius = 3.5): Path { let minX = -knifRadius let maxX = x + knifRadius let minY = -knifRadius let maxY = y + knifRadius return new Path([ { x: minX, y: minY }, { x: maxX, y: minY }, { x: maxX, y: maxY }, { x: minX, y: maxY }, ]) } static Clear() { this.count1 = 0 this.count2 = 0 this.CacheRect.clear() this.PositionCache = {} } }