@rxflow/manhattan 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/geometry/Line.d.ts +21 -0
- package/cjs/geometry/Line.d.ts.map +1 -0
- package/cjs/geometry/Line.js +88 -0
- package/cjs/geometry/Point.d.ts +49 -0
- package/cjs/geometry/Point.d.ts.map +1 -0
- package/cjs/geometry/Point.js +94 -0
- package/cjs/geometry/Rectangle.d.ts +41 -0
- package/cjs/geometry/Rectangle.d.ts.map +1 -0
- package/cjs/geometry/Rectangle.js +65 -0
- package/cjs/geometry/collision.d.ts +15 -0
- package/cjs/geometry/collision.d.ts.map +1 -0
- package/cjs/geometry/collision.js +81 -0
- package/cjs/geometry/index.d.ts +5 -0
- package/cjs/geometry/index.d.ts.map +1 -0
- package/cjs/geometry/index.js +45 -0
- package/cjs/getManHattanPath.d.ts +53 -0
- package/cjs/getManHattanPath.d.ts.map +1 -0
- package/cjs/getManHattanPath.js +449 -0
- package/cjs/index.d.ts +16 -0
- package/cjs/index.d.ts.map +1 -0
- package/cjs/index.js +117 -0
- package/cjs/obstacle/ObstacleMap.d.ts +66 -0
- package/cjs/obstacle/ObstacleMap.d.ts.map +1 -0
- package/cjs/obstacle/ObstacleMap.js +328 -0
- package/cjs/obstacle/QuadTree.d.ts +119 -0
- package/cjs/obstacle/QuadTree.d.ts.map +1 -0
- package/cjs/obstacle/QuadTree.js +334 -0
- package/cjs/obstacle/index.d.ts +2 -0
- package/cjs/obstacle/index.d.ts.map +1 -0
- package/cjs/obstacle/index.js +12 -0
- package/cjs/options/defaults.d.ts +16 -0
- package/cjs/options/defaults.d.ts.map +1 -0
- package/cjs/options/defaults.js +39 -0
- package/cjs/options/index.d.ts +4 -0
- package/cjs/options/index.d.ts.map +1 -0
- package/cjs/options/index.js +38 -0
- package/cjs/options/resolver.d.ts +10 -0
- package/cjs/options/resolver.d.ts.map +1 -0
- package/cjs/options/resolver.js +248 -0
- package/cjs/options/types.d.ts +210 -0
- package/cjs/options/types.d.ts.map +1 -0
- package/cjs/options/types.js +5 -0
- package/cjs/pathfinder/PathCache.d.ts +92 -0
- package/cjs/pathfinder/PathCache.d.ts.map +1 -0
- package/cjs/pathfinder/PathCache.js +249 -0
- package/cjs/pathfinder/SortedSet.d.ts +35 -0
- package/cjs/pathfinder/SortedSet.d.ts.map +1 -0
- package/cjs/pathfinder/SortedSet.js +95 -0
- package/cjs/pathfinder/findRoute.d.ts +8 -0
- package/cjs/pathfinder/findRoute.d.ts.map +1 -0
- package/cjs/pathfinder/findRoute.js +395 -0
- package/cjs/pathfinder/index.d.ts +4 -0
- package/cjs/pathfinder/index.d.ts.map +1 -0
- package/cjs/pathfinder/index.js +44 -0
- package/cjs/svg/index.d.ts +3 -0
- package/cjs/svg/index.d.ts.map +1 -0
- package/cjs/svg/index.js +31 -0
- package/cjs/svg/pathConverter.d.ts +23 -0
- package/cjs/svg/pathConverter.d.ts.map +1 -0
- package/cjs/svg/pathConverter.js +285 -0
- package/cjs/svg/pathParser.d.ts +11 -0
- package/cjs/svg/pathParser.d.ts.map +1 -0
- package/cjs/svg/pathParser.js +76 -0
- package/cjs/utils/AdaptiveStepCalculator.d.ts +90 -0
- package/cjs/utils/AdaptiveStepCalculator.d.ts.map +1 -0
- package/cjs/utils/AdaptiveStepCalculator.js +224 -0
- package/cjs/utils/ErrorRecovery.d.ts +182 -0
- package/cjs/utils/ErrorRecovery.d.ts.map +1 -0
- package/cjs/utils/ErrorRecovery.js +413 -0
- package/cjs/utils/GlobalGrid.d.ts +99 -0
- package/cjs/utils/GlobalGrid.d.ts.map +1 -0
- package/cjs/utils/GlobalGrid.js +224 -0
- package/cjs/utils/PerformanceMonitor.d.ts +139 -0
- package/cjs/utils/PerformanceMonitor.d.ts.map +1 -0
- package/cjs/utils/PerformanceMonitor.js +305 -0
- package/cjs/utils/direction.d.ts +24 -0
- package/cjs/utils/direction.d.ts.map +1 -0
- package/cjs/utils/direction.js +54 -0
- package/cjs/utils/getAnchorPoints.d.ts +15 -0
- package/cjs/utils/getAnchorPoints.d.ts.map +1 -0
- package/cjs/utils/getAnchorPoints.js +71 -0
- package/cjs/utils/grid.d.ts +42 -0
- package/cjs/utils/grid.d.ts.map +1 -0
- package/cjs/utils/grid.js +73 -0
- package/cjs/utils/heuristics.d.ts +61 -0
- package/cjs/utils/heuristics.d.ts.map +1 -0
- package/cjs/utils/heuristics.js +141 -0
- package/cjs/utils/index.d.ts +14 -0
- package/cjs/utils/index.d.ts.map +1 -0
- package/cjs/utils/index.js +148 -0
- package/cjs/utils/node.d.ts +27 -0
- package/cjs/utils/node.d.ts.map +1 -0
- package/cjs/utils/node.js +36 -0
- package/cjs/utils/pathProcessing.d.ts +45 -0
- package/cjs/utils/pathProcessing.d.ts.map +1 -0
- package/cjs/utils/pathProcessing.js +270 -0
- package/cjs/utils/pathValidation.d.ts +11 -0
- package/cjs/utils/pathValidation.d.ts.map +1 -0
- package/cjs/utils/pathValidation.js +129 -0
- package/cjs/utils/rect.d.ts +9 -0
- package/cjs/utils/rect.d.ts.map +1 -0
- package/cjs/utils/rect.js +110 -0
- package/cjs/utils/route.d.ts +19 -0
- package/cjs/utils/route.d.ts.map +1 -0
- package/cjs/utils/route.js +92 -0
- package/esm/geometry/Line.d.ts +21 -0
- package/esm/geometry/Line.d.ts.map +1 -0
- package/esm/geometry/Point.d.ts +49 -0
- package/esm/geometry/Point.d.ts.map +1 -0
- package/esm/geometry/Rectangle.d.ts +41 -0
- package/esm/geometry/Rectangle.d.ts.map +1 -0
- package/esm/geometry/collision.d.ts +15 -0
- package/esm/geometry/collision.d.ts.map +1 -0
- package/esm/geometry/index.d.ts +5 -0
- package/esm/geometry/index.d.ts.map +1 -0
- package/esm/getManHattanPath.d.ts +53 -0
- package/esm/getManHattanPath.d.ts.map +1 -0
- package/esm/index.d.ts +16 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/obstacle/ObstacleMap.d.ts +66 -0
- package/esm/obstacle/ObstacleMap.d.ts.map +1 -0
- package/esm/obstacle/QuadTree.d.ts +119 -0
- package/esm/obstacle/QuadTree.d.ts.map +1 -0
- package/esm/obstacle/index.d.ts +2 -0
- package/esm/obstacle/index.d.ts.map +1 -0
- package/esm/options/defaults.d.ts +16 -0
- package/esm/options/defaults.d.ts.map +1 -0
- package/esm/options/index.d.ts +4 -0
- package/esm/options/index.d.ts.map +1 -0
- package/esm/options/resolver.d.ts +10 -0
- package/esm/options/resolver.d.ts.map +1 -0
- package/esm/options/types.d.ts +210 -0
- package/esm/options/types.d.ts.map +1 -0
- package/esm/pathfinder/PathCache.d.ts +92 -0
- package/esm/pathfinder/PathCache.d.ts.map +1 -0
- package/esm/pathfinder/SortedSet.d.ts +35 -0
- package/esm/pathfinder/SortedSet.d.ts.map +1 -0
- package/esm/pathfinder/findRoute.d.ts +8 -0
- package/esm/pathfinder/findRoute.d.ts.map +1 -0
- package/esm/pathfinder/index.d.ts +4 -0
- package/esm/pathfinder/index.d.ts.map +1 -0
- package/esm/svg/index.d.ts +3 -0
- package/esm/svg/index.d.ts.map +1 -0
- package/esm/svg/pathConverter.d.ts +23 -0
- package/esm/svg/pathConverter.d.ts.map +1 -0
- package/esm/svg/pathParser.d.ts +11 -0
- package/esm/svg/pathParser.d.ts.map +1 -0
- package/esm/utils/AdaptiveStepCalculator.d.ts +90 -0
- package/esm/utils/AdaptiveStepCalculator.d.ts.map +1 -0
- package/esm/utils/ErrorRecovery.d.ts +182 -0
- package/esm/utils/ErrorRecovery.d.ts.map +1 -0
- package/esm/utils/GlobalGrid.d.ts +99 -0
- package/esm/utils/GlobalGrid.d.ts.map +1 -0
- package/esm/utils/PerformanceMonitor.d.ts +139 -0
- package/esm/utils/PerformanceMonitor.d.ts.map +1 -0
- package/esm/utils/direction.d.ts +24 -0
- package/esm/utils/direction.d.ts.map +1 -0
- package/esm/utils/getAnchorPoints.d.ts +15 -0
- package/esm/utils/getAnchorPoints.d.ts.map +1 -0
- package/esm/utils/grid.d.ts +42 -0
- package/esm/utils/grid.d.ts.map +1 -0
- package/esm/utils/heuristics.d.ts +61 -0
- package/esm/utils/heuristics.d.ts.map +1 -0
- package/esm/utils/index.d.ts +14 -0
- package/esm/utils/index.d.ts.map +1 -0
- package/esm/utils/node.d.ts +27 -0
- package/esm/utils/node.d.ts.map +1 -0
- package/esm/utils/pathProcessing.d.ts +45 -0
- package/esm/utils/pathProcessing.d.ts.map +1 -0
- package/esm/utils/pathValidation.d.ts +11 -0
- package/esm/utils/pathValidation.d.ts.map +1 -0
- package/esm/utils/rect.d.ts +9 -0
- package/esm/utils/rect.d.ts.map +1 -0
- package/esm/utils/route.d.ts +19 -0
- package/esm/utils/route.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getCost = getCost;
|
|
7
|
+
exports.getKey = getKey;
|
|
8
|
+
exports.normalizePoint = normalizePoint;
|
|
9
|
+
exports.reconstructRoute = reconstructRoute;
|
|
10
|
+
var _geometry = require("../geometry");
|
|
11
|
+
/**
|
|
12
|
+
* Normalize a point to a unit direction vector
|
|
13
|
+
*/
|
|
14
|
+
function normalizePoint(point) {
|
|
15
|
+
return new _geometry.Point(point.x === 0 ? 0 : Math.abs(point.x) / point.x, point.y === 0 ? 0 : Math.abs(point.y) / point.y);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Get string key for a point
|
|
20
|
+
*/
|
|
21
|
+
function getKey(point) {
|
|
22
|
+
return point.toString();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Calculate minimum Manhattan distance from a point to multiple anchors
|
|
27
|
+
*/
|
|
28
|
+
function getCost(from, anchors) {
|
|
29
|
+
let min = Infinity;
|
|
30
|
+
for (const anchor of anchors) {
|
|
31
|
+
const dist = from.manhattanDistance(anchor);
|
|
32
|
+
if (dist < min) {
|
|
33
|
+
min = dist;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return min;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Reconstruct route by concatenating points with their parents
|
|
41
|
+
* Removes redundant points in the same direction
|
|
42
|
+
*/
|
|
43
|
+
function reconstructRoute(parents, points, tailPoint, startPoint, endPoint) {
|
|
44
|
+
const route = [];
|
|
45
|
+
let prevDiff = normalizePoint(endPoint.diff(tailPoint));
|
|
46
|
+
|
|
47
|
+
// tailPoint is assumed to be aligned already
|
|
48
|
+
let currentKey = getKey(tailPoint);
|
|
49
|
+
let parent = parents.get(currentKey);
|
|
50
|
+
let point;
|
|
51
|
+
let iterationCount = 0;
|
|
52
|
+
const maxIterations = 10000; // Safety limit
|
|
53
|
+
|
|
54
|
+
while (parent && iterationCount < maxIterations) {
|
|
55
|
+
iterationCount++;
|
|
56
|
+
if (iterationCount % 100 === 0) {}
|
|
57
|
+
|
|
58
|
+
// point is assumed to be aligned already
|
|
59
|
+
point = points.get(currentKey);
|
|
60
|
+
if (point) {
|
|
61
|
+
const diff = normalizePoint(point.diff(parent));
|
|
62
|
+
if (!diff.equals(prevDiff)) {
|
|
63
|
+
route.unshift(point);
|
|
64
|
+
prevDiff = diff;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// parent is assumed to be aligned already
|
|
69
|
+
const nextKey = getKey(parent);
|
|
70
|
+
|
|
71
|
+
// CRITICAL: Check for circular reference
|
|
72
|
+
if (nextKey === currentKey) {
|
|
73
|
+
console.error('[reconstructRoute] CIRCULAR REFERENCE DETECTED! currentKey === nextKey:', currentKey);
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
currentKey = nextKey;
|
|
77
|
+
parent = parents.get(currentKey);
|
|
78
|
+
}
|
|
79
|
+
if (iterationCount >= maxIterations) {
|
|
80
|
+
console.error('[reconstructRoute] MAX ITERATIONS REACHED! Possible infinite loop.');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// leadPoint is assumed to be aligned already
|
|
84
|
+
const leadPoint = points.get(currentKey);
|
|
85
|
+
if (leadPoint) {
|
|
86
|
+
const fromDiff = normalizePoint(leadPoint.diff(startPoint));
|
|
87
|
+
if (!fromDiff.equals(prevDiff)) {
|
|
88
|
+
route.unshift(leadPoint);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return route;
|
|
92
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Point } from './Point';
|
|
2
|
+
import { Rectangle } from './Rectangle';
|
|
3
|
+
/**
|
|
4
|
+
* Line class representing a line segment
|
|
5
|
+
*/
|
|
6
|
+
export declare class Line {
|
|
7
|
+
start: Point;
|
|
8
|
+
end: Point;
|
|
9
|
+
constructor(start: Point, end: Point);
|
|
10
|
+
/**
|
|
11
|
+
* Calculate intersection points with a rectangle
|
|
12
|
+
* Returns an array of intersection points
|
|
13
|
+
*/
|
|
14
|
+
intersect(rect: Rectangle): Point[];
|
|
15
|
+
/**
|
|
16
|
+
* Calculate intersection point between two line segments
|
|
17
|
+
* Returns null if lines don't intersect
|
|
18
|
+
*/
|
|
19
|
+
private lineIntersection;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=Line.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Line.d.ts","sourceRoot":"","sources":["../../src/geometry/Line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;GAEG;AACH,qBAAa,IAAI;IACf,KAAK,EAAE,KAAK,CAAA;IACZ,GAAG,EAAE,KAAK,CAAA;gBAEE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK;IAKpC;;;OAGG;IACH,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,KAAK,EAAE;IA+BnC;;;OAGG;IACH,OAAO,CAAC,gBAAgB;CA+BzB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Point class representing a 2D coordinate
|
|
3
|
+
*/
|
|
4
|
+
export declare class Point {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
constructor(x: number, y: number);
|
|
8
|
+
/**
|
|
9
|
+
* Create a copy of this point
|
|
10
|
+
*/
|
|
11
|
+
clone(): Point;
|
|
12
|
+
/**
|
|
13
|
+
* Check if this point equals another point
|
|
14
|
+
*/
|
|
15
|
+
equals(other: Point): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Translate this point by dx and dy
|
|
18
|
+
*/
|
|
19
|
+
translate(dx: number, dy: number): Point;
|
|
20
|
+
/**
|
|
21
|
+
* Round coordinates to specified precision
|
|
22
|
+
*/
|
|
23
|
+
round(precision: number): Point;
|
|
24
|
+
/**
|
|
25
|
+
* Calculate Manhattan distance to another point
|
|
26
|
+
*/
|
|
27
|
+
manhattanDistance(other: Point): number;
|
|
28
|
+
/**
|
|
29
|
+
* Calculate angle (in degrees) from this point to another point
|
|
30
|
+
*/
|
|
31
|
+
theta(other: Point): number;
|
|
32
|
+
/**
|
|
33
|
+
* Calculate the difference vector from this point to another
|
|
34
|
+
*/
|
|
35
|
+
diff(other: Point): Point;
|
|
36
|
+
/**
|
|
37
|
+
* Convert point to string representation
|
|
38
|
+
*/
|
|
39
|
+
toString(): string;
|
|
40
|
+
/**
|
|
41
|
+
* Snap point to grid
|
|
42
|
+
*/
|
|
43
|
+
snapToGrid(gridSize: number): Point;
|
|
44
|
+
/**
|
|
45
|
+
* Calculate squared distance to another point (for performance)
|
|
46
|
+
*/
|
|
47
|
+
squaredDistance(other: Point): number;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=Point.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Point.d.ts","sourceRoot":"","sources":["../../src/geometry/Point.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,KAAK;IAChB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;gBAEG,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAKhC;;OAEG;IACH,KAAK,IAAI,KAAK;IAId;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;IAI7B;;OAEG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,KAAK;IAIxC;;OAEG;IACH,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK;IAQ/B;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM;IAIvC;;OAEG;IACH,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM;IAO3B;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;IAIzB;;OAEG;IACH,QAAQ,IAAI,MAAM;IAIlB;;OAEG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK;IAOnC;;OAEG;IACH,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM;CAKtC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Point } from './Point';
|
|
2
|
+
/**
|
|
3
|
+
* Rectangle class representing a bounding box
|
|
4
|
+
*/
|
|
5
|
+
export declare class Rectangle {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
constructor(x: number, y: number, width: number, height: number);
|
|
11
|
+
/**
|
|
12
|
+
* Create a copy of this rectangle
|
|
13
|
+
*/
|
|
14
|
+
clone(): Rectangle;
|
|
15
|
+
/**
|
|
16
|
+
* Get the center point of the rectangle
|
|
17
|
+
*/
|
|
18
|
+
getCenter(): Point;
|
|
19
|
+
/**
|
|
20
|
+
* Get the origin (top-left) point of the rectangle
|
|
21
|
+
*/
|
|
22
|
+
getOrigin(): Point;
|
|
23
|
+
/**
|
|
24
|
+
* Get the corner (bottom-right) point of the rectangle
|
|
25
|
+
*/
|
|
26
|
+
getCorner(): Point;
|
|
27
|
+
/**
|
|
28
|
+
* Check if a point is contained within this rectangle (interior only, excluding edges)
|
|
29
|
+
*/
|
|
30
|
+
containsPoint(point: Point): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Move and expand the rectangle by a box offset
|
|
33
|
+
*/
|
|
34
|
+
moveAndExpand(box: {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
width: number;
|
|
38
|
+
height: number;
|
|
39
|
+
}): Rectangle;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=Rectangle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Rectangle.d.ts","sourceRoot":"","sources":["../../src/geometry/Rectangle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B;;GAEG;AACH,qBAAa,SAAS;IACpB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;gBAEF,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAO/D;;OAEG;IACH,KAAK,IAAI,SAAS;IAIlB;;OAEG;IACH,SAAS,IAAI,KAAK;IAOlB;;OAEG;IACH,SAAS,IAAI,KAAK;IAIlB;;OAEG;IACH,SAAS,IAAI,KAAK;IAIlB;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;IASpC;;OAEG;IACH,aAAa,CAAC,GAAG,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;CAQvF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Point } from './Point';
|
|
2
|
+
import { Rectangle } from './Rectangle';
|
|
3
|
+
/**
|
|
4
|
+
* Check if a line segment intersects with a rectangle
|
|
5
|
+
*/
|
|
6
|
+
export declare function lineSegmentIntersectsRect(p1: Point, p2: Point, rect: Rectangle): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Check if a line segment crosses through a rectangle (not just touching edges)
|
|
9
|
+
*/
|
|
10
|
+
export declare function lineSegmentCrossesRect(p1: Point, p2: Point, rect: Rectangle): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Check if two line segments intersect
|
|
13
|
+
*/
|
|
14
|
+
export declare function lineSegmentsIntersect(p1: Point, p2: Point, p3: Point, p4: Point): boolean;
|
|
15
|
+
//# sourceMappingURL=collision.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collision.d.ts","sourceRoot":"","sources":["../../src/geometry/collision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAwBxF;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAsBrF;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAgBzF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/geometry/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Position } from '@xyflow/react';
|
|
2
|
+
import type { ManhattanRouterOptions, NodeLookup } from './options';
|
|
3
|
+
/**
|
|
4
|
+
* Parameters for getManHattanPath function
|
|
5
|
+
*/
|
|
6
|
+
export interface GetManHattanPathParams {
|
|
7
|
+
/**
|
|
8
|
+
* Source node ID
|
|
9
|
+
*/
|
|
10
|
+
sourceNodeId: string;
|
|
11
|
+
/**
|
|
12
|
+
* Target node ID
|
|
13
|
+
*/
|
|
14
|
+
targetNodeId: string;
|
|
15
|
+
sourceX: number;
|
|
16
|
+
sourceY: number;
|
|
17
|
+
targetX: number;
|
|
18
|
+
targetY: number;
|
|
19
|
+
sourcePosition: Position;
|
|
20
|
+
targetPosition: Position;
|
|
21
|
+
/**
|
|
22
|
+
* ReactFlow node lookup map
|
|
23
|
+
*/
|
|
24
|
+
nodeLookup: NodeLookup;
|
|
25
|
+
/**
|
|
26
|
+
* Router options
|
|
27
|
+
*/
|
|
28
|
+
options?: ManhattanRouterOptions;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Generate Manhattan-routed path for ReactFlow edges
|
|
32
|
+
*
|
|
33
|
+
* @param params - Path generation parameters
|
|
34
|
+
* @returns SVG path string that can be used with ReactFlow's BaseEdge
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* const path = getManHattanPath({
|
|
39
|
+
* sourceNodeId: 'node1',
|
|
40
|
+
* targetNodeId: 'node2',
|
|
41
|
+
* sourcePosition: { x: 100, y: 100 },
|
|
42
|
+
* targetPosition: { x: 300, y: 300 },
|
|
43
|
+
* nodeLookup: nodes,
|
|
44
|
+
* options: {
|
|
45
|
+
* step: 10,
|
|
46
|
+
* startDirections: ['bottom'],
|
|
47
|
+
* endDirections: ['top']
|
|
48
|
+
* }
|
|
49
|
+
* })
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function getManHattanPath(params: GetManHattanPathParams): string;
|
|
53
|
+
//# sourceMappingURL=getManHattanPath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getManHattanPath.d.ts","sourceRoot":"","sources":["../src/getManHattanPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,QAAQ,EAAE,MAAM,eAAe,CAAA;AAG3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAMnE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAEhB,cAAc,EAAE,QAAQ,CAAC;IACzB,cAAc,EAAE,QAAQ,CAAC;IACzB;;OAEG;IACH,UAAU,EAAE,UAAU,CAAA;IAEtB;;OAEG;IACH,OAAO,CAAC,EAAE,sBAAsB,CAAA;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,CAydvE"}
|
package/esm/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ReactFlow Manhattan Router
|
|
3
|
+
*
|
|
4
|
+
* A Manhattan routing algorithm adapted for ReactFlow from AntV X6.
|
|
5
|
+
* Generates orthogonal (right-angle) paths that intelligently avoid obstacles.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
export { getManHattanPath } from './getManHattanPath';
|
|
10
|
+
export type { GetManHattanPathParams } from './getManHattanPath';
|
|
11
|
+
export type { Direction, InternalNode, NodeLookup, ManhattanRouterOptions, ResolvedOptions, } from './options';
|
|
12
|
+
export { Point, Rectangle, Line } from './geometry';
|
|
13
|
+
export { getGrid, align, snapToGrid, getDirectionAngle, getDirectionChange, getRectPoints, getCost, getKey, reconstructRoute, normalizePoint, getNodeDimensions, getNodePosition, } from './utils';
|
|
14
|
+
export type { NodeDimensions } from './utils';
|
|
15
|
+
export { pointsToPath, snapPathToGrid } from './svg';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAGhE,YAAY,EACV,SAAS,EACT,YAAY,EACZ,UAAU,EACV,sBAAsB,EACtB,eAAe,GAChB,MAAM,WAAW,CAAA;AAGlB,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAGnD,OAAO,EACL,OAAO,EACP,KAAK,EACL,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,OAAO,EACP,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,eAAe,GAChB,MAAM,SAAS,CAAA;AAGhB,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAG7C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Point } from '../geometry';
|
|
2
|
+
import type { ResolvedOptions, NodeLookup } from '../options';
|
|
3
|
+
/**
|
|
4
|
+
* ObstacleMap class for managing obstacles in pathfinding
|
|
5
|
+
* Feature: manhattan-optimization
|
|
6
|
+
*
|
|
7
|
+
* Uses QuadTree for efficient spatial queries (O(log n) instead of O(n))
|
|
8
|
+
* Includes query caching for repeated accessibility checks
|
|
9
|
+
*/
|
|
10
|
+
export declare class ObstacleMap {
|
|
11
|
+
private options;
|
|
12
|
+
private quadTree;
|
|
13
|
+
private obstacles;
|
|
14
|
+
private sourceAnchor?;
|
|
15
|
+
private targetAnchor?;
|
|
16
|
+
private accessibilityCache;
|
|
17
|
+
private cacheHits;
|
|
18
|
+
private cacheMisses;
|
|
19
|
+
constructor(options: ResolvedOptions);
|
|
20
|
+
/**
|
|
21
|
+
* Get cache statistics for performance monitoring
|
|
22
|
+
*/
|
|
23
|
+
getCacheStats(): {
|
|
24
|
+
hits: number;
|
|
25
|
+
misses: number;
|
|
26
|
+
hitRate: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Clear the accessibility cache
|
|
30
|
+
*/
|
|
31
|
+
clearCache(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Build obstacle map from node lookup using QuadTree
|
|
34
|
+
*/
|
|
35
|
+
build(nodeLookup: NodeLookup, sourceNodeId: string, targetNodeId: string, sourceAnchor?: Point, targetAnchor?: Point): ObstacleMap;
|
|
36
|
+
/**
|
|
37
|
+
* Check if a point is accessible (not inside any obstacle)
|
|
38
|
+
* Uses QuadTree for efficient spatial queries with caching
|
|
39
|
+
*/
|
|
40
|
+
isAccessible(point: Point, checkRadius?: number): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Check if an anchor point has sufficient clearance around it
|
|
43
|
+
* This ensures the path can start/end at the anchor without being blocked
|
|
44
|
+
*/
|
|
45
|
+
hasAnchorClearance(anchor: Point, direction: 'top' | 'right' | 'bottom' | 'left'): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Check accessibility without using cache (for internal use)
|
|
48
|
+
*/
|
|
49
|
+
private isAccessibleWithoutCache;
|
|
50
|
+
/**
|
|
51
|
+
* Find the nearest accessible point from an anchor in a given direction
|
|
52
|
+
* Uses binary search for efficiency
|
|
53
|
+
*/
|
|
54
|
+
findNearestAccessiblePoint(anchor: Point, direction: 'top' | 'right' | 'bottom' | 'left', maxDistance: number): Point | null;
|
|
55
|
+
/**
|
|
56
|
+
* Batch check accessibility for multiple points (optimized)
|
|
57
|
+
* Returns array of booleans in same order as input points
|
|
58
|
+
*/
|
|
59
|
+
areAccessible(points: Point[]): boolean[];
|
|
60
|
+
/**
|
|
61
|
+
* Check accessibility using binary search optimization
|
|
62
|
+
* Tries step -> step/2 -> step/4 -> ... -> 1px
|
|
63
|
+
*/
|
|
64
|
+
private isAccessibleWithBinarySearch;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=ObstacleMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObstacleMap.d.ts","sourceRoot":"","sources":["../../src/obstacle/ObstacleMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAa,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAI7D;;;;;;GAMG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,QAAQ,CAAgC;IAChD,OAAO,CAAC,SAAS,CAAmD;IACpE,OAAO,CAAC,YAAY,CAAC,CAAO;IAC5B,OAAO,CAAC,YAAY,CAAC,CAAO;IAG5B,OAAO,CAAC,kBAAkB,CAAkC;IAC5D,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,WAAW,CAAY;gBAEnB,OAAO,EAAE,eAAe;IAIpC;;OAEG;IACH,aAAa,IAAI;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;IASlE;;OAEG;IACH,UAAU,IAAI,IAAI;IAMlB;;OAEG;IACH,KAAK,CACH,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,YAAY,CAAC,EAAE,KAAK,EACpB,YAAY,CAAC,EAAE,KAAK,GACnB,WAAW;IA8Cd;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,GAAE,MAAU,GAAG,OAAO;IAoD5D;;;OAGG;IACH,kBAAkB,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO;IA0C1F;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAShC;;;OAGG;IACH,0BAA0B,CACxB,MAAM,EAAE,KAAK,EACb,SAAS,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,EAC9C,WAAW,EAAE,MAAM,GAClB,KAAK,GAAG,IAAI;IAyDf;;;OAGG;IACH,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE;IAIzC;;;OAGG;IACH,OAAO,CAAC,4BAA4B;CAqCrC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QuadTree implementation for efficient spatial queries
|
|
3
|
+
* Feature: manhattan-optimization
|
|
4
|
+
*
|
|
5
|
+
* A QuadTree is a tree data structure that recursively subdivides 2D space
|
|
6
|
+
* into four quadrants. This enables O(log n) spatial queries instead of O(n).
|
|
7
|
+
*/
|
|
8
|
+
import { Point, Rectangle } from '../geometry';
|
|
9
|
+
/**
|
|
10
|
+
* Item stored in the QuadTree
|
|
11
|
+
*/
|
|
12
|
+
export interface QuadTreeItem<T> {
|
|
13
|
+
bounds: Rectangle;
|
|
14
|
+
data: T;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* QuadTree configuration
|
|
18
|
+
*/
|
|
19
|
+
export interface QuadTreeConfig {
|
|
20
|
+
/** Maximum items per node before splitting */
|
|
21
|
+
maxItems: number;
|
|
22
|
+
/** Maximum depth of the tree */
|
|
23
|
+
maxDepth: number;
|
|
24
|
+
/** Minimum node size (prevents infinite subdivision) */
|
|
25
|
+
minSize: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* QuadTree node for spatial partitioning
|
|
29
|
+
*/
|
|
30
|
+
export declare class QuadTree<T> {
|
|
31
|
+
private bounds;
|
|
32
|
+
private items;
|
|
33
|
+
private children;
|
|
34
|
+
private depth;
|
|
35
|
+
private config;
|
|
36
|
+
constructor(bounds: Rectangle, config?: Partial<QuadTreeConfig>, depth?: number);
|
|
37
|
+
/**
|
|
38
|
+
* Insert an item into the QuadTree
|
|
39
|
+
*/
|
|
40
|
+
insert(item: QuadTreeItem<T>): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Insert an item with just bounds and data
|
|
43
|
+
*/
|
|
44
|
+
insertRect(bounds: Rectangle, data: T): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Query all items that intersect with the given bounds
|
|
47
|
+
*/
|
|
48
|
+
query(bounds: Rectangle): QuadTreeItem<T>[];
|
|
49
|
+
/**
|
|
50
|
+
* Query all items that contain the given point
|
|
51
|
+
*/
|
|
52
|
+
queryPoint(point: Point): QuadTreeItem<T>[];
|
|
53
|
+
/**
|
|
54
|
+
* Get all items in the tree
|
|
55
|
+
*/
|
|
56
|
+
getAllItems(): QuadTreeItem<T>[];
|
|
57
|
+
/**
|
|
58
|
+
* Clear all items from the tree
|
|
59
|
+
*/
|
|
60
|
+
clear(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Get the total number of items in the tree
|
|
63
|
+
*/
|
|
64
|
+
get size(): number;
|
|
65
|
+
/**
|
|
66
|
+
* Get the depth of the tree
|
|
67
|
+
*/
|
|
68
|
+
getMaxDepth(): number;
|
|
69
|
+
/**
|
|
70
|
+
* Internal query implementation
|
|
71
|
+
*/
|
|
72
|
+
private queryInternal;
|
|
73
|
+
/**
|
|
74
|
+
* Internal point query implementation
|
|
75
|
+
*/
|
|
76
|
+
private queryPointInternal;
|
|
77
|
+
/**
|
|
78
|
+
* Check if this node should split
|
|
79
|
+
*/
|
|
80
|
+
private shouldSplit;
|
|
81
|
+
/**
|
|
82
|
+
* Split this node into four children
|
|
83
|
+
*/
|
|
84
|
+
private split;
|
|
85
|
+
/**
|
|
86
|
+
* Insert item into appropriate children
|
|
87
|
+
*/
|
|
88
|
+
private insertIntoChildren;
|
|
89
|
+
/**
|
|
90
|
+
* Check if a rectangle intersects this node's bounds
|
|
91
|
+
*/
|
|
92
|
+
private intersects;
|
|
93
|
+
/**
|
|
94
|
+
* Check if two rectangles intersect
|
|
95
|
+
*/
|
|
96
|
+
private rectanglesIntersect;
|
|
97
|
+
/**
|
|
98
|
+
* Check if this node's bounds contain a point
|
|
99
|
+
*/
|
|
100
|
+
private containsPoint;
|
|
101
|
+
/**
|
|
102
|
+
* Get statistics about the tree
|
|
103
|
+
*/
|
|
104
|
+
getStats(): {
|
|
105
|
+
totalItems: number;
|
|
106
|
+
maxDepth: number;
|
|
107
|
+
nodeCount: number;
|
|
108
|
+
itemsPerNode: number;
|
|
109
|
+
};
|
|
110
|
+
private collectStats;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Create a QuadTree with bounds that cover all given rectangles
|
|
114
|
+
*/
|
|
115
|
+
export declare function createQuadTreeFromRects<T>(items: Array<{
|
|
116
|
+
bounds: Rectangle;
|
|
117
|
+
data: T;
|
|
118
|
+
}>, config?: Partial<QuadTreeConfig>): QuadTree<T>;
|
|
119
|
+
//# sourceMappingURL=QuadTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuadTree.d.ts","sourceRoot":"","sources":["../../src/obstacle/QuadTree.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE9C;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,MAAM,EAAE,SAAS,CAAA;IACjB,IAAI,EAAE,CAAC,CAAA;CACR;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAA;IAChB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAA;CAChB;AAWD;;GAEG;AACH,qBAAa,QAAQ,CAAC,CAAC;IACrB,OAAO,CAAC,MAAM,CAAW;IACzB,OAAO,CAAC,KAAK,CAAmB;IAChC,OAAO,CAAC,QAAQ,CAAsB;IACtC,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,MAAM,CAAgB;gBAG5B,MAAM,EAAE,SAAS,EACjB,MAAM,GAAE,OAAO,CAAC,cAAc,CAAM,EACpC,KAAK,GAAE,MAAU;IASnB;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,OAAO;IAsBtC;;OAEG;IACH,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,GAAG,OAAO;IAI/C;;OAEG;IACH,KAAK,CAAC,MAAM,EAAE,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,EAAE;IAM3C;;OAEG;IACH,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,EAAE;IAM3C;;OAEG;IACH,WAAW,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE;IAYhC;;OAEG;IACH,KAAK,IAAI,IAAI;IAKb;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAUjB;IAED;;OAEG;IACH,WAAW,IAAI,MAAM;IAarB;;OAEG;IACH,OAAO,CAAC,aAAa;IAqBrB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAqB1B;;OAEG;IACH,OAAO,CAAC,WAAW;IASnB;;OAEG;IACH,OAAO,CAAC,KAAK;IA2Cb;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAqB1B;;OAEG;IACH,OAAO,CAAC,UAAU;IAIlB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAS3B;;OAEG;IACH,OAAO,CAAC,aAAa;IASrB;;OAEG;IACH,QAAQ,IAAI;QACV,UAAU,EAAE,MAAM,CAAA;QAClB,QAAQ,EAAE,MAAM,CAAA;QAChB,SAAS,EAAE,MAAM,CAAA;QACjB,YAAY,EAAE,MAAM,CAAA;KACrB;IAcD,OAAO,CAAC,YAAY;CAerB;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EACvC,KAAK,EAAE,KAAK,CAAC;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,EAC5C,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAC/B,QAAQ,CAAC,CAAC,CAAC,CAkCb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/obstacle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Point } from '../geometry';
|
|
2
|
+
import type { ManhattanRouterOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Default configuration for Manhattan router
|
|
5
|
+
*/
|
|
6
|
+
export declare const defaults: Required<Omit<ManhattanRouterOptions, 'fallbackRoute' | 'sourcePosition' | 'targetPosition' | 'performance' | 'adaptiveStep' | 'debug'>>;
|
|
7
|
+
/**
|
|
8
|
+
* Direction map - maps direction names to unit vectors
|
|
9
|
+
*/
|
|
10
|
+
export declare const directionMap: {
|
|
11
|
+
top: Point;
|
|
12
|
+
right: Point;
|
|
13
|
+
bottom: Point;
|
|
14
|
+
left: Point;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/options/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,KAAK,EAAE,sBAAsB,EAAa,MAAM,SAAS,CAAA;AAEhE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,sBAAsB,EAAE,eAAe,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,aAAa,GAAG,cAAc,GAAG,OAAO,CAAC,CAkB7J,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;CAKxB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/options/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ManhattanRouterOptions, ResolvedOptions } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Normalize angle to 0-360 range
|
|
4
|
+
*/
|
|
5
|
+
export declare function normalizeAngle(angle: number): number;
|
|
6
|
+
/**
|
|
7
|
+
* Resolve options by merging user options with defaults
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveOptions(options?: ManhattanRouterOptions): ResolvedOptions;
|
|
10
|
+
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../src/options/resolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAkC,MAAM,SAAS,CAAA;AAmCtG;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQpD;AAgGD;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,sBAA2B,GAAG,eAAe,CA4EpF"}
|