microboard-temp 0.5.81 → 0.5.83
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/dist/cjs/browser.js +82 -81
- package/dist/cjs/index.js +82 -81
- package/dist/cjs/node.js +82 -81
- package/dist/esm/browser.js +82 -81
- package/dist/esm/index.js +82 -81
- package/dist/esm/node.js +82 -81
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -36731,50 +36731,45 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
36731
36731
|
const startDir = getPointerDirection(start);
|
|
36732
36732
|
const endDir = getPointerDirection(end);
|
|
36733
36733
|
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
36734
|
+
const offset = conf.CONNECTOR_ITEM_OFFSET;
|
|
36734
36735
|
const offsetMap = {
|
|
36735
|
-
top: { x: 0, y: -
|
|
36736
|
-
bottom: { x: 0, y:
|
|
36737
|
-
right: { x:
|
|
36738
|
-
left: { x: -
|
|
36736
|
+
top: { x: 0, y: -offset },
|
|
36737
|
+
bottom: { x: 0, y: offset },
|
|
36738
|
+
right: { x: offset, y: 0 },
|
|
36739
|
+
left: { x: -offset, y: 0 }
|
|
36739
36740
|
};
|
|
36740
36741
|
const horizontalLines = [];
|
|
36741
36742
|
const verticalLines = [];
|
|
36742
|
-
let newStart;
|
|
36743
|
-
let newEnd;
|
|
36744
36743
|
const processPoint = (point5, dir2) => {
|
|
36744
|
+
if (point5.pointType === "Board")
|
|
36745
|
+
return;
|
|
36745
36746
|
const itemMbr = point5.item.getMbr();
|
|
36746
|
-
const
|
|
36747
|
-
const
|
|
36748
|
-
|
|
36749
|
-
|
|
36750
|
-
newPoint.y = pointOnMbr.y + offsetMap[dir2].y;
|
|
36751
|
-
verticalLines.push(mbrFloored.left - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.left, pointOnMbr.x, mbrFloored.right, mbrFloored.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
36752
|
-
horizontalLines.push(mbrFloored.top - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.top, pointOnMbr.y, mbrFloored.bottom, mbrFloored.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
36753
|
-
return newPoint;
|
|
36747
|
+
const pointOnMbrX = point5.x - offsetMap[dir2].x;
|
|
36748
|
+
const pointOnMbrY = point5.y - offsetMap[dir2].y;
|
|
36749
|
+
verticalLines.push(itemMbr.left - offset, itemMbr.left, pointOnMbrX, itemMbr.right, itemMbr.right + offset);
|
|
36750
|
+
horizontalLines.push(itemMbr.top - offset, itemMbr.top, pointOnMbrY, itemMbr.bottom, itemMbr.bottom + offset);
|
|
36754
36751
|
};
|
|
36755
36752
|
if (start.pointType !== "Board" && startDir) {
|
|
36756
|
-
|
|
36753
|
+
processPoint(start, startDir);
|
|
36757
36754
|
}
|
|
36758
36755
|
if (end.pointType !== "Board" && endDir) {
|
|
36759
|
-
|
|
36760
|
-
}
|
|
36761
|
-
const
|
|
36762
|
-
|
|
36763
|
-
const middle = new Point((finalStart.x + finalEnd.x) / 2, (finalStart.y + finalEnd.y) / 2);
|
|
36764
|
-
horizontalLines.push(middle.y, finalStart.y, finalEnd.y);
|
|
36765
|
-
verticalLines.push(middle.x, finalStart.x, finalEnd.x);
|
|
36766
|
-
toVisitPoints.forEach((p3) => {
|
|
36756
|
+
processPoint(end, endDir);
|
|
36757
|
+
}
|
|
36758
|
+
const allPoints = [start, end, ...toVisitPoints];
|
|
36759
|
+
allPoints.forEach((p3) => {
|
|
36767
36760
|
horizontalLines.push(p3.y);
|
|
36768
36761
|
verticalLines.push(p3.x);
|
|
36769
36762
|
});
|
|
36763
|
+
const middle = new Point((start.x + end.x) / 2, (start.y + end.y) / 2);
|
|
36764
|
+
horizontalLines.push(middle.y);
|
|
36765
|
+
verticalLines.push(middle.x);
|
|
36770
36766
|
const uniqueHorizontalLines = Array.from(new Set(horizontalLines)).sort((a2, b) => a2 - b);
|
|
36771
36767
|
const uniqueVerticalLines = Array.from(new Set(verticalLines)).sort((a2, b) => a2 - b);
|
|
36772
36768
|
const grid = uniqueVerticalLines.map((x) => uniqueHorizontalLines.map((y) => new Point(x, y)));
|
|
36773
36769
|
return {
|
|
36774
36770
|
grid,
|
|
36775
|
-
newStart,
|
|
36776
|
-
newEnd
|
|
36777
|
-
middlePoint: middle
|
|
36771
|
+
newStart: start,
|
|
36772
|
+
newEnd: end
|
|
36778
36773
|
};
|
|
36779
36774
|
}
|
|
36780
36775
|
function findPath(start, end, grid, obstacles, existingPath, newStart, newEnd) {
|
|
@@ -36934,71 +36929,77 @@ function reconstructPath(node2) {
|
|
|
36934
36929
|
}
|
|
36935
36930
|
return path2.reverse();
|
|
36936
36931
|
}
|
|
36937
|
-
function
|
|
36938
|
-
const
|
|
36932
|
+
function findOrthogonalPath(start, end, obstacles, toVisitPoints = []) {
|
|
36933
|
+
const startDir = getPointerDirection(start);
|
|
36934
|
+
const endDir = getPointerDirection(end);
|
|
36939
36935
|
const offset = conf.CONNECTOR_ITEM_OFFSET;
|
|
36940
|
-
|
|
36941
|
-
|
|
36936
|
+
let startPoint = start;
|
|
36937
|
+
let endPoint = end;
|
|
36938
|
+
const processPoint = (point5, dir2) => {
|
|
36939
|
+
if (point5.pointType === "Board")
|
|
36940
|
+
return point5;
|
|
36941
|
+
const offsetMap = {
|
|
36942
|
+
top: { x: 0, y: -offset },
|
|
36943
|
+
bottom: { x: 0, y: offset },
|
|
36944
|
+
right: { x: offset, y: 0 },
|
|
36945
|
+
left: { x: -offset, y: 0 }
|
|
36946
|
+
};
|
|
36947
|
+
const itemMbr = point5.item.getMbr();
|
|
36948
|
+
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
36949
|
+
const pointOnMbr = itemMbr.getLines()[revertMapDir[dir2]].getNearestPointOnLineSegment(point5);
|
|
36950
|
+
const newPoint = Object.create(Object.getPrototypeOf(point5), Object.getOwnPropertyDescriptors(point5));
|
|
36951
|
+
newPoint.x = pointOnMbr.x + offsetMap[dir2].x;
|
|
36952
|
+
newPoint.y = pointOnMbr.y + offsetMap[dir2].y;
|
|
36953
|
+
return newPoint;
|
|
36954
|
+
};
|
|
36955
|
+
if (start.pointType !== "Board" && startDir) {
|
|
36956
|
+
startPoint = processPoint(start, startDir);
|
|
36957
|
+
}
|
|
36958
|
+
if (end.pointType !== "Board" && endDir) {
|
|
36959
|
+
endPoint = processPoint(end, endDir);
|
|
36942
36960
|
}
|
|
36961
|
+
const stemWaypoints = [];
|
|
36943
36962
|
if (startDir) {
|
|
36944
|
-
let
|
|
36945
|
-
|
|
36946
|
-
|
|
36947
|
-
|
|
36948
|
-
|
|
36949
|
-
|
|
36950
|
-
|
|
36951
|
-
|
|
36952
|
-
|
|
36953
|
-
|
|
36954
|
-
break;
|
|
36955
|
-
case "top":
|
|
36956
|
-
waypoint = new Point(startPoint.x, startPoint.y - offset);
|
|
36957
|
-
break;
|
|
36958
|
-
}
|
|
36959
|
-
waypoints.push(waypoint);
|
|
36963
|
+
let stem;
|
|
36964
|
+
if (startDir === "right")
|
|
36965
|
+
stem = new Point(startPoint.x + offset, startPoint.y);
|
|
36966
|
+
else if (startDir === "left")
|
|
36967
|
+
stem = new Point(startPoint.x - offset, startPoint.y);
|
|
36968
|
+
else if (startDir === "bottom")
|
|
36969
|
+
stem = new Point(startPoint.x, startPoint.y + offset);
|
|
36970
|
+
else
|
|
36971
|
+
stem = new Point(startPoint.x, startPoint.y - offset);
|
|
36972
|
+
stemWaypoints.push(stem);
|
|
36960
36973
|
}
|
|
36961
36974
|
if (endDir) {
|
|
36962
|
-
let
|
|
36963
|
-
|
|
36964
|
-
|
|
36965
|
-
|
|
36966
|
-
|
|
36967
|
-
|
|
36968
|
-
|
|
36969
|
-
|
|
36970
|
-
|
|
36971
|
-
|
|
36972
|
-
break;
|
|
36973
|
-
case "top":
|
|
36974
|
-
waypoint = new Point(endPoint.x, endPoint.y - offset);
|
|
36975
|
-
break;
|
|
36976
|
-
}
|
|
36977
|
-
waypoints.push(waypoint);
|
|
36975
|
+
let stem;
|
|
36976
|
+
if (endDir === "right")
|
|
36977
|
+
stem = new Point(endPoint.x + offset, endPoint.y);
|
|
36978
|
+
else if (endDir === "left")
|
|
36979
|
+
stem = new Point(endPoint.x - offset, endPoint.y);
|
|
36980
|
+
else if (endDir === "bottom")
|
|
36981
|
+
stem = new Point(endPoint.x, endPoint.y + offset);
|
|
36982
|
+
else
|
|
36983
|
+
stem = new Point(endPoint.x, endPoint.y - offset);
|
|
36984
|
+
stemWaypoints.push(stem);
|
|
36978
36985
|
}
|
|
36979
|
-
|
|
36980
|
-
}
|
|
36981
|
-
|
|
36982
|
-
const { grid, newStart, newEnd } = createGrid(start, end, toVisitPoints);
|
|
36983
|
-
const startPoint = newStart || start;
|
|
36984
|
-
const endPoint = newEnd || end;
|
|
36985
|
-
const startDir = getPointerDirection(start);
|
|
36986
|
-
const endDir = getPointerDirection(end);
|
|
36987
|
-
const stemWaypoints = createStemWaypoints(startPoint, endPoint, startDir, endDir);
|
|
36988
|
-
let finalWaypoints = [];
|
|
36986
|
+
const allGridPoints = [startPoint, endPoint, ...stemWaypoints, ...toVisitPoints];
|
|
36987
|
+
const { grid } = createGrid(startPoint, endPoint, allGridPoints);
|
|
36988
|
+
let finalWaypoints = [startPoint];
|
|
36989
36989
|
if (stemWaypoints.length > 0) {
|
|
36990
|
-
|
|
36991
|
-
|
|
36992
|
-
|
|
36993
|
-
|
|
36994
|
-
finalWaypoints
|
|
36990
|
+
finalWaypoints.push(stemWaypoints[0]);
|
|
36991
|
+
}
|
|
36992
|
+
finalWaypoints.push(...toVisitPoints);
|
|
36993
|
+
if (stemWaypoints.length > 1) {
|
|
36994
|
+
finalWaypoints.push(stemWaypoints[1]);
|
|
36995
36995
|
}
|
|
36996
|
-
|
|
36997
|
-
const
|
|
36996
|
+
finalWaypoints.push(endPoint);
|
|
36997
|
+
const uniqueWaypoints = finalWaypoints.filter((point5, index2, self2) => index2 === 0 || !point5.barelyEqual(self2[index2 - 1]));
|
|
36998
|
+
const pathPoints = findPathPoints(uniqueWaypoints, grid, obstacles, startPoint, endPoint);
|
|
36998
36999
|
return {
|
|
36999
37000
|
lines: getLines(pathPoints),
|
|
37000
|
-
newStart,
|
|
37001
|
-
newEnd
|
|
37001
|
+
newStart: startPoint,
|
|
37002
|
+
newEnd: endPoint
|
|
37002
37003
|
};
|
|
37003
37004
|
}
|
|
37004
37005
|
|
package/dist/cjs/index.js
CHANGED
|
@@ -36731,50 +36731,45 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
36731
36731
|
const startDir = getPointerDirection(start);
|
|
36732
36732
|
const endDir = getPointerDirection(end);
|
|
36733
36733
|
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
36734
|
+
const offset = conf.CONNECTOR_ITEM_OFFSET;
|
|
36734
36735
|
const offsetMap = {
|
|
36735
|
-
top: { x: 0, y: -
|
|
36736
|
-
bottom: { x: 0, y:
|
|
36737
|
-
right: { x:
|
|
36738
|
-
left: { x: -
|
|
36736
|
+
top: { x: 0, y: -offset },
|
|
36737
|
+
bottom: { x: 0, y: offset },
|
|
36738
|
+
right: { x: offset, y: 0 },
|
|
36739
|
+
left: { x: -offset, y: 0 }
|
|
36739
36740
|
};
|
|
36740
36741
|
const horizontalLines = [];
|
|
36741
36742
|
const verticalLines = [];
|
|
36742
|
-
let newStart;
|
|
36743
|
-
let newEnd;
|
|
36744
36743
|
const processPoint = (point5, dir2) => {
|
|
36744
|
+
if (point5.pointType === "Board")
|
|
36745
|
+
return;
|
|
36745
36746
|
const itemMbr = point5.item.getMbr();
|
|
36746
|
-
const
|
|
36747
|
-
const
|
|
36748
|
-
|
|
36749
|
-
|
|
36750
|
-
newPoint.y = pointOnMbr.y + offsetMap[dir2].y;
|
|
36751
|
-
verticalLines.push(mbrFloored.left - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.left, pointOnMbr.x, mbrFloored.right, mbrFloored.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
36752
|
-
horizontalLines.push(mbrFloored.top - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.top, pointOnMbr.y, mbrFloored.bottom, mbrFloored.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
36753
|
-
return newPoint;
|
|
36747
|
+
const pointOnMbrX = point5.x - offsetMap[dir2].x;
|
|
36748
|
+
const pointOnMbrY = point5.y - offsetMap[dir2].y;
|
|
36749
|
+
verticalLines.push(itemMbr.left - offset, itemMbr.left, pointOnMbrX, itemMbr.right, itemMbr.right + offset);
|
|
36750
|
+
horizontalLines.push(itemMbr.top - offset, itemMbr.top, pointOnMbrY, itemMbr.bottom, itemMbr.bottom + offset);
|
|
36754
36751
|
};
|
|
36755
36752
|
if (start.pointType !== "Board" && startDir) {
|
|
36756
|
-
|
|
36753
|
+
processPoint(start, startDir);
|
|
36757
36754
|
}
|
|
36758
36755
|
if (end.pointType !== "Board" && endDir) {
|
|
36759
|
-
|
|
36760
|
-
}
|
|
36761
|
-
const
|
|
36762
|
-
|
|
36763
|
-
const middle = new Point((finalStart.x + finalEnd.x) / 2, (finalStart.y + finalEnd.y) / 2);
|
|
36764
|
-
horizontalLines.push(middle.y, finalStart.y, finalEnd.y);
|
|
36765
|
-
verticalLines.push(middle.x, finalStart.x, finalEnd.x);
|
|
36766
|
-
toVisitPoints.forEach((p3) => {
|
|
36756
|
+
processPoint(end, endDir);
|
|
36757
|
+
}
|
|
36758
|
+
const allPoints = [start, end, ...toVisitPoints];
|
|
36759
|
+
allPoints.forEach((p3) => {
|
|
36767
36760
|
horizontalLines.push(p3.y);
|
|
36768
36761
|
verticalLines.push(p3.x);
|
|
36769
36762
|
});
|
|
36763
|
+
const middle = new Point((start.x + end.x) / 2, (start.y + end.y) / 2);
|
|
36764
|
+
horizontalLines.push(middle.y);
|
|
36765
|
+
verticalLines.push(middle.x);
|
|
36770
36766
|
const uniqueHorizontalLines = Array.from(new Set(horizontalLines)).sort((a2, b) => a2 - b);
|
|
36771
36767
|
const uniqueVerticalLines = Array.from(new Set(verticalLines)).sort((a2, b) => a2 - b);
|
|
36772
36768
|
const grid = uniqueVerticalLines.map((x) => uniqueHorizontalLines.map((y) => new Point(x, y)));
|
|
36773
36769
|
return {
|
|
36774
36770
|
grid,
|
|
36775
|
-
newStart,
|
|
36776
|
-
newEnd
|
|
36777
|
-
middlePoint: middle
|
|
36771
|
+
newStart: start,
|
|
36772
|
+
newEnd: end
|
|
36778
36773
|
};
|
|
36779
36774
|
}
|
|
36780
36775
|
function findPath(start, end, grid, obstacles, existingPath, newStart, newEnd) {
|
|
@@ -36934,71 +36929,77 @@ function reconstructPath(node2) {
|
|
|
36934
36929
|
}
|
|
36935
36930
|
return path2.reverse();
|
|
36936
36931
|
}
|
|
36937
|
-
function
|
|
36938
|
-
const
|
|
36932
|
+
function findOrthogonalPath(start, end, obstacles, toVisitPoints = []) {
|
|
36933
|
+
const startDir = getPointerDirection(start);
|
|
36934
|
+
const endDir = getPointerDirection(end);
|
|
36939
36935
|
const offset = conf.CONNECTOR_ITEM_OFFSET;
|
|
36940
|
-
|
|
36941
|
-
|
|
36936
|
+
let startPoint = start;
|
|
36937
|
+
let endPoint = end;
|
|
36938
|
+
const processPoint = (point5, dir2) => {
|
|
36939
|
+
if (point5.pointType === "Board")
|
|
36940
|
+
return point5;
|
|
36941
|
+
const offsetMap = {
|
|
36942
|
+
top: { x: 0, y: -offset },
|
|
36943
|
+
bottom: { x: 0, y: offset },
|
|
36944
|
+
right: { x: offset, y: 0 },
|
|
36945
|
+
left: { x: -offset, y: 0 }
|
|
36946
|
+
};
|
|
36947
|
+
const itemMbr = point5.item.getMbr();
|
|
36948
|
+
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
36949
|
+
const pointOnMbr = itemMbr.getLines()[revertMapDir[dir2]].getNearestPointOnLineSegment(point5);
|
|
36950
|
+
const newPoint = Object.create(Object.getPrototypeOf(point5), Object.getOwnPropertyDescriptors(point5));
|
|
36951
|
+
newPoint.x = pointOnMbr.x + offsetMap[dir2].x;
|
|
36952
|
+
newPoint.y = pointOnMbr.y + offsetMap[dir2].y;
|
|
36953
|
+
return newPoint;
|
|
36954
|
+
};
|
|
36955
|
+
if (start.pointType !== "Board" && startDir) {
|
|
36956
|
+
startPoint = processPoint(start, startDir);
|
|
36957
|
+
}
|
|
36958
|
+
if (end.pointType !== "Board" && endDir) {
|
|
36959
|
+
endPoint = processPoint(end, endDir);
|
|
36942
36960
|
}
|
|
36961
|
+
const stemWaypoints = [];
|
|
36943
36962
|
if (startDir) {
|
|
36944
|
-
let
|
|
36945
|
-
|
|
36946
|
-
|
|
36947
|
-
|
|
36948
|
-
|
|
36949
|
-
|
|
36950
|
-
|
|
36951
|
-
|
|
36952
|
-
|
|
36953
|
-
|
|
36954
|
-
break;
|
|
36955
|
-
case "top":
|
|
36956
|
-
waypoint = new Point(startPoint.x, startPoint.y - offset);
|
|
36957
|
-
break;
|
|
36958
|
-
}
|
|
36959
|
-
waypoints.push(waypoint);
|
|
36963
|
+
let stem;
|
|
36964
|
+
if (startDir === "right")
|
|
36965
|
+
stem = new Point(startPoint.x + offset, startPoint.y);
|
|
36966
|
+
else if (startDir === "left")
|
|
36967
|
+
stem = new Point(startPoint.x - offset, startPoint.y);
|
|
36968
|
+
else if (startDir === "bottom")
|
|
36969
|
+
stem = new Point(startPoint.x, startPoint.y + offset);
|
|
36970
|
+
else
|
|
36971
|
+
stem = new Point(startPoint.x, startPoint.y - offset);
|
|
36972
|
+
stemWaypoints.push(stem);
|
|
36960
36973
|
}
|
|
36961
36974
|
if (endDir) {
|
|
36962
|
-
let
|
|
36963
|
-
|
|
36964
|
-
|
|
36965
|
-
|
|
36966
|
-
|
|
36967
|
-
|
|
36968
|
-
|
|
36969
|
-
|
|
36970
|
-
|
|
36971
|
-
|
|
36972
|
-
break;
|
|
36973
|
-
case "top":
|
|
36974
|
-
waypoint = new Point(endPoint.x, endPoint.y - offset);
|
|
36975
|
-
break;
|
|
36976
|
-
}
|
|
36977
|
-
waypoints.push(waypoint);
|
|
36975
|
+
let stem;
|
|
36976
|
+
if (endDir === "right")
|
|
36977
|
+
stem = new Point(endPoint.x + offset, endPoint.y);
|
|
36978
|
+
else if (endDir === "left")
|
|
36979
|
+
stem = new Point(endPoint.x - offset, endPoint.y);
|
|
36980
|
+
else if (endDir === "bottom")
|
|
36981
|
+
stem = new Point(endPoint.x, endPoint.y + offset);
|
|
36982
|
+
else
|
|
36983
|
+
stem = new Point(endPoint.x, endPoint.y - offset);
|
|
36984
|
+
stemWaypoints.push(stem);
|
|
36978
36985
|
}
|
|
36979
|
-
|
|
36980
|
-
}
|
|
36981
|
-
|
|
36982
|
-
const { grid, newStart, newEnd } = createGrid(start, end, toVisitPoints);
|
|
36983
|
-
const startPoint = newStart || start;
|
|
36984
|
-
const endPoint = newEnd || end;
|
|
36985
|
-
const startDir = getPointerDirection(start);
|
|
36986
|
-
const endDir = getPointerDirection(end);
|
|
36987
|
-
const stemWaypoints = createStemWaypoints(startPoint, endPoint, startDir, endDir);
|
|
36988
|
-
let finalWaypoints = [];
|
|
36986
|
+
const allGridPoints = [startPoint, endPoint, ...stemWaypoints, ...toVisitPoints];
|
|
36987
|
+
const { grid } = createGrid(startPoint, endPoint, allGridPoints);
|
|
36988
|
+
let finalWaypoints = [startPoint];
|
|
36989
36989
|
if (stemWaypoints.length > 0) {
|
|
36990
|
-
|
|
36991
|
-
|
|
36992
|
-
|
|
36993
|
-
|
|
36994
|
-
finalWaypoints
|
|
36990
|
+
finalWaypoints.push(stemWaypoints[0]);
|
|
36991
|
+
}
|
|
36992
|
+
finalWaypoints.push(...toVisitPoints);
|
|
36993
|
+
if (stemWaypoints.length > 1) {
|
|
36994
|
+
finalWaypoints.push(stemWaypoints[1]);
|
|
36995
36995
|
}
|
|
36996
|
-
|
|
36997
|
-
const
|
|
36996
|
+
finalWaypoints.push(endPoint);
|
|
36997
|
+
const uniqueWaypoints = finalWaypoints.filter((point5, index2, self2) => index2 === 0 || !point5.barelyEqual(self2[index2 - 1]));
|
|
36998
|
+
const pathPoints = findPathPoints(uniqueWaypoints, grid, obstacles, startPoint, endPoint);
|
|
36998
36999
|
return {
|
|
36999
37000
|
lines: getLines(pathPoints),
|
|
37000
|
-
newStart,
|
|
37001
|
-
newEnd
|
|
37001
|
+
newStart: startPoint,
|
|
37002
|
+
newEnd: endPoint
|
|
37002
37003
|
};
|
|
37003
37004
|
}
|
|
37004
37005
|
|
package/dist/cjs/node.js
CHANGED
|
@@ -39204,50 +39204,45 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
39204
39204
|
const startDir = getPointerDirection(start);
|
|
39205
39205
|
const endDir = getPointerDirection(end);
|
|
39206
39206
|
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
39207
|
+
const offset = conf.CONNECTOR_ITEM_OFFSET;
|
|
39207
39208
|
const offsetMap = {
|
|
39208
|
-
top: { x: 0, y: -
|
|
39209
|
-
bottom: { x: 0, y:
|
|
39210
|
-
right: { x:
|
|
39211
|
-
left: { x: -
|
|
39209
|
+
top: { x: 0, y: -offset },
|
|
39210
|
+
bottom: { x: 0, y: offset },
|
|
39211
|
+
right: { x: offset, y: 0 },
|
|
39212
|
+
left: { x: -offset, y: 0 }
|
|
39212
39213
|
};
|
|
39213
39214
|
const horizontalLines = [];
|
|
39214
39215
|
const verticalLines = [];
|
|
39215
|
-
let newStart;
|
|
39216
|
-
let newEnd;
|
|
39217
39216
|
const processPoint = (point5, dir2) => {
|
|
39217
|
+
if (point5.pointType === "Board")
|
|
39218
|
+
return;
|
|
39218
39219
|
const itemMbr = point5.item.getMbr();
|
|
39219
|
-
const
|
|
39220
|
-
const
|
|
39221
|
-
|
|
39222
|
-
|
|
39223
|
-
newPoint.y = pointOnMbr.y + offsetMap[dir2].y;
|
|
39224
|
-
verticalLines.push(mbrFloored.left - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.left, pointOnMbr.x, mbrFloored.right, mbrFloored.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
39225
|
-
horizontalLines.push(mbrFloored.top - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.top, pointOnMbr.y, mbrFloored.bottom, mbrFloored.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
39226
|
-
return newPoint;
|
|
39220
|
+
const pointOnMbrX = point5.x - offsetMap[dir2].x;
|
|
39221
|
+
const pointOnMbrY = point5.y - offsetMap[dir2].y;
|
|
39222
|
+
verticalLines.push(itemMbr.left - offset, itemMbr.left, pointOnMbrX, itemMbr.right, itemMbr.right + offset);
|
|
39223
|
+
horizontalLines.push(itemMbr.top - offset, itemMbr.top, pointOnMbrY, itemMbr.bottom, itemMbr.bottom + offset);
|
|
39227
39224
|
};
|
|
39228
39225
|
if (start.pointType !== "Board" && startDir) {
|
|
39229
|
-
|
|
39226
|
+
processPoint(start, startDir);
|
|
39230
39227
|
}
|
|
39231
39228
|
if (end.pointType !== "Board" && endDir) {
|
|
39232
|
-
|
|
39233
|
-
}
|
|
39234
|
-
const
|
|
39235
|
-
|
|
39236
|
-
const middle = new Point((finalStart.x + finalEnd.x) / 2, (finalStart.y + finalEnd.y) / 2);
|
|
39237
|
-
horizontalLines.push(middle.y, finalStart.y, finalEnd.y);
|
|
39238
|
-
verticalLines.push(middle.x, finalStart.x, finalEnd.x);
|
|
39239
|
-
toVisitPoints.forEach((p3) => {
|
|
39229
|
+
processPoint(end, endDir);
|
|
39230
|
+
}
|
|
39231
|
+
const allPoints = [start, end, ...toVisitPoints];
|
|
39232
|
+
allPoints.forEach((p3) => {
|
|
39240
39233
|
horizontalLines.push(p3.y);
|
|
39241
39234
|
verticalLines.push(p3.x);
|
|
39242
39235
|
});
|
|
39236
|
+
const middle = new Point((start.x + end.x) / 2, (start.y + end.y) / 2);
|
|
39237
|
+
horizontalLines.push(middle.y);
|
|
39238
|
+
verticalLines.push(middle.x);
|
|
39243
39239
|
const uniqueHorizontalLines = Array.from(new Set(horizontalLines)).sort((a2, b) => a2 - b);
|
|
39244
39240
|
const uniqueVerticalLines = Array.from(new Set(verticalLines)).sort((a2, b) => a2 - b);
|
|
39245
39241
|
const grid = uniqueVerticalLines.map((x) => uniqueHorizontalLines.map((y) => new Point(x, y)));
|
|
39246
39242
|
return {
|
|
39247
39243
|
grid,
|
|
39248
|
-
newStart,
|
|
39249
|
-
newEnd
|
|
39250
|
-
middlePoint: middle
|
|
39244
|
+
newStart: start,
|
|
39245
|
+
newEnd: end
|
|
39251
39246
|
};
|
|
39252
39247
|
}
|
|
39253
39248
|
function findPath(start, end, grid, obstacles, existingPath, newStart, newEnd) {
|
|
@@ -39407,71 +39402,77 @@ function reconstructPath(node2) {
|
|
|
39407
39402
|
}
|
|
39408
39403
|
return path2.reverse();
|
|
39409
39404
|
}
|
|
39410
|
-
function
|
|
39411
|
-
const
|
|
39405
|
+
function findOrthogonalPath(start, end, obstacles, toVisitPoints = []) {
|
|
39406
|
+
const startDir = getPointerDirection(start);
|
|
39407
|
+
const endDir = getPointerDirection(end);
|
|
39412
39408
|
const offset = conf.CONNECTOR_ITEM_OFFSET;
|
|
39413
|
-
|
|
39414
|
-
|
|
39409
|
+
let startPoint = start;
|
|
39410
|
+
let endPoint = end;
|
|
39411
|
+
const processPoint = (point5, dir2) => {
|
|
39412
|
+
if (point5.pointType === "Board")
|
|
39413
|
+
return point5;
|
|
39414
|
+
const offsetMap = {
|
|
39415
|
+
top: { x: 0, y: -offset },
|
|
39416
|
+
bottom: { x: 0, y: offset },
|
|
39417
|
+
right: { x: offset, y: 0 },
|
|
39418
|
+
left: { x: -offset, y: 0 }
|
|
39419
|
+
};
|
|
39420
|
+
const itemMbr = point5.item.getMbr();
|
|
39421
|
+
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
39422
|
+
const pointOnMbr = itemMbr.getLines()[revertMapDir[dir2]].getNearestPointOnLineSegment(point5);
|
|
39423
|
+
const newPoint = Object.create(Object.getPrototypeOf(point5), Object.getOwnPropertyDescriptors(point5));
|
|
39424
|
+
newPoint.x = pointOnMbr.x + offsetMap[dir2].x;
|
|
39425
|
+
newPoint.y = pointOnMbr.y + offsetMap[dir2].y;
|
|
39426
|
+
return newPoint;
|
|
39427
|
+
};
|
|
39428
|
+
if (start.pointType !== "Board" && startDir) {
|
|
39429
|
+
startPoint = processPoint(start, startDir);
|
|
39430
|
+
}
|
|
39431
|
+
if (end.pointType !== "Board" && endDir) {
|
|
39432
|
+
endPoint = processPoint(end, endDir);
|
|
39415
39433
|
}
|
|
39434
|
+
const stemWaypoints = [];
|
|
39416
39435
|
if (startDir) {
|
|
39417
|
-
let
|
|
39418
|
-
|
|
39419
|
-
|
|
39420
|
-
|
|
39421
|
-
|
|
39422
|
-
|
|
39423
|
-
|
|
39424
|
-
|
|
39425
|
-
|
|
39426
|
-
|
|
39427
|
-
break;
|
|
39428
|
-
case "top":
|
|
39429
|
-
waypoint = new Point(startPoint.x, startPoint.y - offset);
|
|
39430
|
-
break;
|
|
39431
|
-
}
|
|
39432
|
-
waypoints.push(waypoint);
|
|
39436
|
+
let stem;
|
|
39437
|
+
if (startDir === "right")
|
|
39438
|
+
stem = new Point(startPoint.x + offset, startPoint.y);
|
|
39439
|
+
else if (startDir === "left")
|
|
39440
|
+
stem = new Point(startPoint.x - offset, startPoint.y);
|
|
39441
|
+
else if (startDir === "bottom")
|
|
39442
|
+
stem = new Point(startPoint.x, startPoint.y + offset);
|
|
39443
|
+
else
|
|
39444
|
+
stem = new Point(startPoint.x, startPoint.y - offset);
|
|
39445
|
+
stemWaypoints.push(stem);
|
|
39433
39446
|
}
|
|
39434
39447
|
if (endDir) {
|
|
39435
|
-
let
|
|
39436
|
-
|
|
39437
|
-
|
|
39438
|
-
|
|
39439
|
-
|
|
39440
|
-
|
|
39441
|
-
|
|
39442
|
-
|
|
39443
|
-
|
|
39444
|
-
|
|
39445
|
-
break;
|
|
39446
|
-
case "top":
|
|
39447
|
-
waypoint = new Point(endPoint.x, endPoint.y - offset);
|
|
39448
|
-
break;
|
|
39449
|
-
}
|
|
39450
|
-
waypoints.push(waypoint);
|
|
39448
|
+
let stem;
|
|
39449
|
+
if (endDir === "right")
|
|
39450
|
+
stem = new Point(endPoint.x + offset, endPoint.y);
|
|
39451
|
+
else if (endDir === "left")
|
|
39452
|
+
stem = new Point(endPoint.x - offset, endPoint.y);
|
|
39453
|
+
else if (endDir === "bottom")
|
|
39454
|
+
stem = new Point(endPoint.x, endPoint.y + offset);
|
|
39455
|
+
else
|
|
39456
|
+
stem = new Point(endPoint.x, endPoint.y - offset);
|
|
39457
|
+
stemWaypoints.push(stem);
|
|
39451
39458
|
}
|
|
39452
|
-
|
|
39453
|
-
}
|
|
39454
|
-
|
|
39455
|
-
const { grid, newStart, newEnd } = createGrid(start, end, toVisitPoints);
|
|
39456
|
-
const startPoint = newStart || start;
|
|
39457
|
-
const endPoint = newEnd || end;
|
|
39458
|
-
const startDir = getPointerDirection(start);
|
|
39459
|
-
const endDir = getPointerDirection(end);
|
|
39460
|
-
const stemWaypoints = createStemWaypoints(startPoint, endPoint, startDir, endDir);
|
|
39461
|
-
let finalWaypoints = [];
|
|
39459
|
+
const allGridPoints = [startPoint, endPoint, ...stemWaypoints, ...toVisitPoints];
|
|
39460
|
+
const { grid } = createGrid(startPoint, endPoint, allGridPoints);
|
|
39461
|
+
let finalWaypoints = [startPoint];
|
|
39462
39462
|
if (stemWaypoints.length > 0) {
|
|
39463
|
-
|
|
39464
|
-
|
|
39465
|
-
|
|
39466
|
-
|
|
39467
|
-
finalWaypoints
|
|
39463
|
+
finalWaypoints.push(stemWaypoints[0]);
|
|
39464
|
+
}
|
|
39465
|
+
finalWaypoints.push(...toVisitPoints);
|
|
39466
|
+
if (stemWaypoints.length > 1) {
|
|
39467
|
+
finalWaypoints.push(stemWaypoints[1]);
|
|
39468
39468
|
}
|
|
39469
|
-
|
|
39470
|
-
const
|
|
39469
|
+
finalWaypoints.push(endPoint);
|
|
39470
|
+
const uniqueWaypoints = finalWaypoints.filter((point5, index2, self2) => index2 === 0 || !point5.barelyEqual(self2[index2 - 1]));
|
|
39471
|
+
const pathPoints = findPathPoints(uniqueWaypoints, grid, obstacles, startPoint, endPoint);
|
|
39471
39472
|
return {
|
|
39472
39473
|
lines: getLines(pathPoints),
|
|
39473
|
-
newStart,
|
|
39474
|
-
newEnd
|
|
39474
|
+
newStart: startPoint,
|
|
39475
|
+
newEnd: endPoint
|
|
39475
39476
|
};
|
|
39476
39477
|
}
|
|
39477
39478
|
|
package/dist/esm/browser.js
CHANGED
|
@@ -36576,50 +36576,45 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
36576
36576
|
const startDir = getPointerDirection(start);
|
|
36577
36577
|
const endDir = getPointerDirection(end);
|
|
36578
36578
|
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
36579
|
+
const offset = conf.CONNECTOR_ITEM_OFFSET;
|
|
36579
36580
|
const offsetMap = {
|
|
36580
|
-
top: { x: 0, y: -
|
|
36581
|
-
bottom: { x: 0, y:
|
|
36582
|
-
right: { x:
|
|
36583
|
-
left: { x: -
|
|
36581
|
+
top: { x: 0, y: -offset },
|
|
36582
|
+
bottom: { x: 0, y: offset },
|
|
36583
|
+
right: { x: offset, y: 0 },
|
|
36584
|
+
left: { x: -offset, y: 0 }
|
|
36584
36585
|
};
|
|
36585
36586
|
const horizontalLines = [];
|
|
36586
36587
|
const verticalLines = [];
|
|
36587
|
-
let newStart;
|
|
36588
|
-
let newEnd;
|
|
36589
36588
|
const processPoint = (point5, dir2) => {
|
|
36589
|
+
if (point5.pointType === "Board")
|
|
36590
|
+
return;
|
|
36590
36591
|
const itemMbr = point5.item.getMbr();
|
|
36591
|
-
const
|
|
36592
|
-
const
|
|
36593
|
-
|
|
36594
|
-
|
|
36595
|
-
newPoint.y = pointOnMbr.y + offsetMap[dir2].y;
|
|
36596
|
-
verticalLines.push(mbrFloored.left - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.left, pointOnMbr.x, mbrFloored.right, mbrFloored.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
36597
|
-
horizontalLines.push(mbrFloored.top - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.top, pointOnMbr.y, mbrFloored.bottom, mbrFloored.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
36598
|
-
return newPoint;
|
|
36592
|
+
const pointOnMbrX = point5.x - offsetMap[dir2].x;
|
|
36593
|
+
const pointOnMbrY = point5.y - offsetMap[dir2].y;
|
|
36594
|
+
verticalLines.push(itemMbr.left - offset, itemMbr.left, pointOnMbrX, itemMbr.right, itemMbr.right + offset);
|
|
36595
|
+
horizontalLines.push(itemMbr.top - offset, itemMbr.top, pointOnMbrY, itemMbr.bottom, itemMbr.bottom + offset);
|
|
36599
36596
|
};
|
|
36600
36597
|
if (start.pointType !== "Board" && startDir) {
|
|
36601
|
-
|
|
36598
|
+
processPoint(start, startDir);
|
|
36602
36599
|
}
|
|
36603
36600
|
if (end.pointType !== "Board" && endDir) {
|
|
36604
|
-
|
|
36605
|
-
}
|
|
36606
|
-
const
|
|
36607
|
-
|
|
36608
|
-
const middle = new Point((finalStart.x + finalEnd.x) / 2, (finalStart.y + finalEnd.y) / 2);
|
|
36609
|
-
horizontalLines.push(middle.y, finalStart.y, finalEnd.y);
|
|
36610
|
-
verticalLines.push(middle.x, finalStart.x, finalEnd.x);
|
|
36611
|
-
toVisitPoints.forEach((p3) => {
|
|
36601
|
+
processPoint(end, endDir);
|
|
36602
|
+
}
|
|
36603
|
+
const allPoints = [start, end, ...toVisitPoints];
|
|
36604
|
+
allPoints.forEach((p3) => {
|
|
36612
36605
|
horizontalLines.push(p3.y);
|
|
36613
36606
|
verticalLines.push(p3.x);
|
|
36614
36607
|
});
|
|
36608
|
+
const middle = new Point((start.x + end.x) / 2, (start.y + end.y) / 2);
|
|
36609
|
+
horizontalLines.push(middle.y);
|
|
36610
|
+
verticalLines.push(middle.x);
|
|
36615
36611
|
const uniqueHorizontalLines = Array.from(new Set(horizontalLines)).sort((a2, b) => a2 - b);
|
|
36616
36612
|
const uniqueVerticalLines = Array.from(new Set(verticalLines)).sort((a2, b) => a2 - b);
|
|
36617
36613
|
const grid = uniqueVerticalLines.map((x) => uniqueHorizontalLines.map((y) => new Point(x, y)));
|
|
36618
36614
|
return {
|
|
36619
36615
|
grid,
|
|
36620
|
-
newStart,
|
|
36621
|
-
newEnd
|
|
36622
|
-
middlePoint: middle
|
|
36616
|
+
newStart: start,
|
|
36617
|
+
newEnd: end
|
|
36623
36618
|
};
|
|
36624
36619
|
}
|
|
36625
36620
|
function findPath(start, end, grid, obstacles, existingPath, newStart, newEnd) {
|
|
@@ -36779,71 +36774,77 @@ function reconstructPath(node2) {
|
|
|
36779
36774
|
}
|
|
36780
36775
|
return path2.reverse();
|
|
36781
36776
|
}
|
|
36782
|
-
function
|
|
36783
|
-
const
|
|
36777
|
+
function findOrthogonalPath(start, end, obstacles, toVisitPoints = []) {
|
|
36778
|
+
const startDir = getPointerDirection(start);
|
|
36779
|
+
const endDir = getPointerDirection(end);
|
|
36784
36780
|
const offset = conf.CONNECTOR_ITEM_OFFSET;
|
|
36785
|
-
|
|
36786
|
-
|
|
36781
|
+
let startPoint = start;
|
|
36782
|
+
let endPoint = end;
|
|
36783
|
+
const processPoint = (point5, dir2) => {
|
|
36784
|
+
if (point5.pointType === "Board")
|
|
36785
|
+
return point5;
|
|
36786
|
+
const offsetMap = {
|
|
36787
|
+
top: { x: 0, y: -offset },
|
|
36788
|
+
bottom: { x: 0, y: offset },
|
|
36789
|
+
right: { x: offset, y: 0 },
|
|
36790
|
+
left: { x: -offset, y: 0 }
|
|
36791
|
+
};
|
|
36792
|
+
const itemMbr = point5.item.getMbr();
|
|
36793
|
+
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
36794
|
+
const pointOnMbr = itemMbr.getLines()[revertMapDir[dir2]].getNearestPointOnLineSegment(point5);
|
|
36795
|
+
const newPoint = Object.create(Object.getPrototypeOf(point5), Object.getOwnPropertyDescriptors(point5));
|
|
36796
|
+
newPoint.x = pointOnMbr.x + offsetMap[dir2].x;
|
|
36797
|
+
newPoint.y = pointOnMbr.y + offsetMap[dir2].y;
|
|
36798
|
+
return newPoint;
|
|
36799
|
+
};
|
|
36800
|
+
if (start.pointType !== "Board" && startDir) {
|
|
36801
|
+
startPoint = processPoint(start, startDir);
|
|
36802
|
+
}
|
|
36803
|
+
if (end.pointType !== "Board" && endDir) {
|
|
36804
|
+
endPoint = processPoint(end, endDir);
|
|
36787
36805
|
}
|
|
36806
|
+
const stemWaypoints = [];
|
|
36788
36807
|
if (startDir) {
|
|
36789
|
-
let
|
|
36790
|
-
|
|
36791
|
-
|
|
36792
|
-
|
|
36793
|
-
|
|
36794
|
-
|
|
36795
|
-
|
|
36796
|
-
|
|
36797
|
-
|
|
36798
|
-
|
|
36799
|
-
break;
|
|
36800
|
-
case "top":
|
|
36801
|
-
waypoint = new Point(startPoint.x, startPoint.y - offset);
|
|
36802
|
-
break;
|
|
36803
|
-
}
|
|
36804
|
-
waypoints.push(waypoint);
|
|
36808
|
+
let stem;
|
|
36809
|
+
if (startDir === "right")
|
|
36810
|
+
stem = new Point(startPoint.x + offset, startPoint.y);
|
|
36811
|
+
else if (startDir === "left")
|
|
36812
|
+
stem = new Point(startPoint.x - offset, startPoint.y);
|
|
36813
|
+
else if (startDir === "bottom")
|
|
36814
|
+
stem = new Point(startPoint.x, startPoint.y + offset);
|
|
36815
|
+
else
|
|
36816
|
+
stem = new Point(startPoint.x, startPoint.y - offset);
|
|
36817
|
+
stemWaypoints.push(stem);
|
|
36805
36818
|
}
|
|
36806
36819
|
if (endDir) {
|
|
36807
|
-
let
|
|
36808
|
-
|
|
36809
|
-
|
|
36810
|
-
|
|
36811
|
-
|
|
36812
|
-
|
|
36813
|
-
|
|
36814
|
-
|
|
36815
|
-
|
|
36816
|
-
|
|
36817
|
-
break;
|
|
36818
|
-
case "top":
|
|
36819
|
-
waypoint = new Point(endPoint.x, endPoint.y - offset);
|
|
36820
|
-
break;
|
|
36821
|
-
}
|
|
36822
|
-
waypoints.push(waypoint);
|
|
36820
|
+
let stem;
|
|
36821
|
+
if (endDir === "right")
|
|
36822
|
+
stem = new Point(endPoint.x + offset, endPoint.y);
|
|
36823
|
+
else if (endDir === "left")
|
|
36824
|
+
stem = new Point(endPoint.x - offset, endPoint.y);
|
|
36825
|
+
else if (endDir === "bottom")
|
|
36826
|
+
stem = new Point(endPoint.x, endPoint.y + offset);
|
|
36827
|
+
else
|
|
36828
|
+
stem = new Point(endPoint.x, endPoint.y - offset);
|
|
36829
|
+
stemWaypoints.push(stem);
|
|
36823
36830
|
}
|
|
36824
|
-
|
|
36825
|
-
}
|
|
36826
|
-
|
|
36827
|
-
const { grid, newStart, newEnd } = createGrid(start, end, toVisitPoints);
|
|
36828
|
-
const startPoint = newStart || start;
|
|
36829
|
-
const endPoint = newEnd || end;
|
|
36830
|
-
const startDir = getPointerDirection(start);
|
|
36831
|
-
const endDir = getPointerDirection(end);
|
|
36832
|
-
const stemWaypoints = createStemWaypoints(startPoint, endPoint, startDir, endDir);
|
|
36833
|
-
let finalWaypoints = [];
|
|
36831
|
+
const allGridPoints = [startPoint, endPoint, ...stemWaypoints, ...toVisitPoints];
|
|
36832
|
+
const { grid } = createGrid(startPoint, endPoint, allGridPoints);
|
|
36833
|
+
let finalWaypoints = [startPoint];
|
|
36834
36834
|
if (stemWaypoints.length > 0) {
|
|
36835
|
-
|
|
36836
|
-
|
|
36837
|
-
|
|
36838
|
-
|
|
36839
|
-
finalWaypoints
|
|
36835
|
+
finalWaypoints.push(stemWaypoints[0]);
|
|
36836
|
+
}
|
|
36837
|
+
finalWaypoints.push(...toVisitPoints);
|
|
36838
|
+
if (stemWaypoints.length > 1) {
|
|
36839
|
+
finalWaypoints.push(stemWaypoints[1]);
|
|
36840
36840
|
}
|
|
36841
|
-
|
|
36842
|
-
const
|
|
36841
|
+
finalWaypoints.push(endPoint);
|
|
36842
|
+
const uniqueWaypoints = finalWaypoints.filter((point5, index2, self2) => index2 === 0 || !point5.barelyEqual(self2[index2 - 1]));
|
|
36843
|
+
const pathPoints = findPathPoints(uniqueWaypoints, grid, obstacles, startPoint, endPoint);
|
|
36843
36844
|
return {
|
|
36844
36845
|
lines: getLines(pathPoints),
|
|
36845
|
-
newStart,
|
|
36846
|
-
newEnd
|
|
36846
|
+
newStart: startPoint,
|
|
36847
|
+
newEnd: endPoint
|
|
36847
36848
|
};
|
|
36848
36849
|
}
|
|
36849
36850
|
|
package/dist/esm/index.js
CHANGED
|
@@ -36569,50 +36569,45 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
36569
36569
|
const startDir = getPointerDirection(start);
|
|
36570
36570
|
const endDir = getPointerDirection(end);
|
|
36571
36571
|
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
36572
|
+
const offset = conf.CONNECTOR_ITEM_OFFSET;
|
|
36572
36573
|
const offsetMap = {
|
|
36573
|
-
top: { x: 0, y: -
|
|
36574
|
-
bottom: { x: 0, y:
|
|
36575
|
-
right: { x:
|
|
36576
|
-
left: { x: -
|
|
36574
|
+
top: { x: 0, y: -offset },
|
|
36575
|
+
bottom: { x: 0, y: offset },
|
|
36576
|
+
right: { x: offset, y: 0 },
|
|
36577
|
+
left: { x: -offset, y: 0 }
|
|
36577
36578
|
};
|
|
36578
36579
|
const horizontalLines = [];
|
|
36579
36580
|
const verticalLines = [];
|
|
36580
|
-
let newStart;
|
|
36581
|
-
let newEnd;
|
|
36582
36581
|
const processPoint = (point5, dir2) => {
|
|
36582
|
+
if (point5.pointType === "Board")
|
|
36583
|
+
return;
|
|
36583
36584
|
const itemMbr = point5.item.getMbr();
|
|
36584
|
-
const
|
|
36585
|
-
const
|
|
36586
|
-
|
|
36587
|
-
|
|
36588
|
-
newPoint.y = pointOnMbr.y + offsetMap[dir2].y;
|
|
36589
|
-
verticalLines.push(mbrFloored.left - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.left, pointOnMbr.x, mbrFloored.right, mbrFloored.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
36590
|
-
horizontalLines.push(mbrFloored.top - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.top, pointOnMbr.y, mbrFloored.bottom, mbrFloored.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
36591
|
-
return newPoint;
|
|
36585
|
+
const pointOnMbrX = point5.x - offsetMap[dir2].x;
|
|
36586
|
+
const pointOnMbrY = point5.y - offsetMap[dir2].y;
|
|
36587
|
+
verticalLines.push(itemMbr.left - offset, itemMbr.left, pointOnMbrX, itemMbr.right, itemMbr.right + offset);
|
|
36588
|
+
horizontalLines.push(itemMbr.top - offset, itemMbr.top, pointOnMbrY, itemMbr.bottom, itemMbr.bottom + offset);
|
|
36592
36589
|
};
|
|
36593
36590
|
if (start.pointType !== "Board" && startDir) {
|
|
36594
|
-
|
|
36591
|
+
processPoint(start, startDir);
|
|
36595
36592
|
}
|
|
36596
36593
|
if (end.pointType !== "Board" && endDir) {
|
|
36597
|
-
|
|
36598
|
-
}
|
|
36599
|
-
const
|
|
36600
|
-
|
|
36601
|
-
const middle = new Point((finalStart.x + finalEnd.x) / 2, (finalStart.y + finalEnd.y) / 2);
|
|
36602
|
-
horizontalLines.push(middle.y, finalStart.y, finalEnd.y);
|
|
36603
|
-
verticalLines.push(middle.x, finalStart.x, finalEnd.x);
|
|
36604
|
-
toVisitPoints.forEach((p3) => {
|
|
36594
|
+
processPoint(end, endDir);
|
|
36595
|
+
}
|
|
36596
|
+
const allPoints = [start, end, ...toVisitPoints];
|
|
36597
|
+
allPoints.forEach((p3) => {
|
|
36605
36598
|
horizontalLines.push(p3.y);
|
|
36606
36599
|
verticalLines.push(p3.x);
|
|
36607
36600
|
});
|
|
36601
|
+
const middle = new Point((start.x + end.x) / 2, (start.y + end.y) / 2);
|
|
36602
|
+
horizontalLines.push(middle.y);
|
|
36603
|
+
verticalLines.push(middle.x);
|
|
36608
36604
|
const uniqueHorizontalLines = Array.from(new Set(horizontalLines)).sort((a2, b) => a2 - b);
|
|
36609
36605
|
const uniqueVerticalLines = Array.from(new Set(verticalLines)).sort((a2, b) => a2 - b);
|
|
36610
36606
|
const grid = uniqueVerticalLines.map((x) => uniqueHorizontalLines.map((y) => new Point(x, y)));
|
|
36611
36607
|
return {
|
|
36612
36608
|
grid,
|
|
36613
|
-
newStart,
|
|
36614
|
-
newEnd
|
|
36615
|
-
middlePoint: middle
|
|
36609
|
+
newStart: start,
|
|
36610
|
+
newEnd: end
|
|
36616
36611
|
};
|
|
36617
36612
|
}
|
|
36618
36613
|
function findPath(start, end, grid, obstacles, existingPath, newStart, newEnd) {
|
|
@@ -36772,71 +36767,77 @@ function reconstructPath(node2) {
|
|
|
36772
36767
|
}
|
|
36773
36768
|
return path2.reverse();
|
|
36774
36769
|
}
|
|
36775
|
-
function
|
|
36776
|
-
const
|
|
36770
|
+
function findOrthogonalPath(start, end, obstacles, toVisitPoints = []) {
|
|
36771
|
+
const startDir = getPointerDirection(start);
|
|
36772
|
+
const endDir = getPointerDirection(end);
|
|
36777
36773
|
const offset = conf.CONNECTOR_ITEM_OFFSET;
|
|
36778
|
-
|
|
36779
|
-
|
|
36774
|
+
let startPoint = start;
|
|
36775
|
+
let endPoint = end;
|
|
36776
|
+
const processPoint = (point5, dir2) => {
|
|
36777
|
+
if (point5.pointType === "Board")
|
|
36778
|
+
return point5;
|
|
36779
|
+
const offsetMap = {
|
|
36780
|
+
top: { x: 0, y: -offset },
|
|
36781
|
+
bottom: { x: 0, y: offset },
|
|
36782
|
+
right: { x: offset, y: 0 },
|
|
36783
|
+
left: { x: -offset, y: 0 }
|
|
36784
|
+
};
|
|
36785
|
+
const itemMbr = point5.item.getMbr();
|
|
36786
|
+
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
36787
|
+
const pointOnMbr = itemMbr.getLines()[revertMapDir[dir2]].getNearestPointOnLineSegment(point5);
|
|
36788
|
+
const newPoint = Object.create(Object.getPrototypeOf(point5), Object.getOwnPropertyDescriptors(point5));
|
|
36789
|
+
newPoint.x = pointOnMbr.x + offsetMap[dir2].x;
|
|
36790
|
+
newPoint.y = pointOnMbr.y + offsetMap[dir2].y;
|
|
36791
|
+
return newPoint;
|
|
36792
|
+
};
|
|
36793
|
+
if (start.pointType !== "Board" && startDir) {
|
|
36794
|
+
startPoint = processPoint(start, startDir);
|
|
36795
|
+
}
|
|
36796
|
+
if (end.pointType !== "Board" && endDir) {
|
|
36797
|
+
endPoint = processPoint(end, endDir);
|
|
36780
36798
|
}
|
|
36799
|
+
const stemWaypoints = [];
|
|
36781
36800
|
if (startDir) {
|
|
36782
|
-
let
|
|
36783
|
-
|
|
36784
|
-
|
|
36785
|
-
|
|
36786
|
-
|
|
36787
|
-
|
|
36788
|
-
|
|
36789
|
-
|
|
36790
|
-
|
|
36791
|
-
|
|
36792
|
-
break;
|
|
36793
|
-
case "top":
|
|
36794
|
-
waypoint = new Point(startPoint.x, startPoint.y - offset);
|
|
36795
|
-
break;
|
|
36796
|
-
}
|
|
36797
|
-
waypoints.push(waypoint);
|
|
36801
|
+
let stem;
|
|
36802
|
+
if (startDir === "right")
|
|
36803
|
+
stem = new Point(startPoint.x + offset, startPoint.y);
|
|
36804
|
+
else if (startDir === "left")
|
|
36805
|
+
stem = new Point(startPoint.x - offset, startPoint.y);
|
|
36806
|
+
else if (startDir === "bottom")
|
|
36807
|
+
stem = new Point(startPoint.x, startPoint.y + offset);
|
|
36808
|
+
else
|
|
36809
|
+
stem = new Point(startPoint.x, startPoint.y - offset);
|
|
36810
|
+
stemWaypoints.push(stem);
|
|
36798
36811
|
}
|
|
36799
36812
|
if (endDir) {
|
|
36800
|
-
let
|
|
36801
|
-
|
|
36802
|
-
|
|
36803
|
-
|
|
36804
|
-
|
|
36805
|
-
|
|
36806
|
-
|
|
36807
|
-
|
|
36808
|
-
|
|
36809
|
-
|
|
36810
|
-
break;
|
|
36811
|
-
case "top":
|
|
36812
|
-
waypoint = new Point(endPoint.x, endPoint.y - offset);
|
|
36813
|
-
break;
|
|
36814
|
-
}
|
|
36815
|
-
waypoints.push(waypoint);
|
|
36813
|
+
let stem;
|
|
36814
|
+
if (endDir === "right")
|
|
36815
|
+
stem = new Point(endPoint.x + offset, endPoint.y);
|
|
36816
|
+
else if (endDir === "left")
|
|
36817
|
+
stem = new Point(endPoint.x - offset, endPoint.y);
|
|
36818
|
+
else if (endDir === "bottom")
|
|
36819
|
+
stem = new Point(endPoint.x, endPoint.y + offset);
|
|
36820
|
+
else
|
|
36821
|
+
stem = new Point(endPoint.x, endPoint.y - offset);
|
|
36822
|
+
stemWaypoints.push(stem);
|
|
36816
36823
|
}
|
|
36817
|
-
|
|
36818
|
-
}
|
|
36819
|
-
|
|
36820
|
-
const { grid, newStart, newEnd } = createGrid(start, end, toVisitPoints);
|
|
36821
|
-
const startPoint = newStart || start;
|
|
36822
|
-
const endPoint = newEnd || end;
|
|
36823
|
-
const startDir = getPointerDirection(start);
|
|
36824
|
-
const endDir = getPointerDirection(end);
|
|
36825
|
-
const stemWaypoints = createStemWaypoints(startPoint, endPoint, startDir, endDir);
|
|
36826
|
-
let finalWaypoints = [];
|
|
36824
|
+
const allGridPoints = [startPoint, endPoint, ...stemWaypoints, ...toVisitPoints];
|
|
36825
|
+
const { grid } = createGrid(startPoint, endPoint, allGridPoints);
|
|
36826
|
+
let finalWaypoints = [startPoint];
|
|
36827
36827
|
if (stemWaypoints.length > 0) {
|
|
36828
|
-
|
|
36829
|
-
|
|
36830
|
-
|
|
36831
|
-
|
|
36832
|
-
finalWaypoints
|
|
36828
|
+
finalWaypoints.push(stemWaypoints[0]);
|
|
36829
|
+
}
|
|
36830
|
+
finalWaypoints.push(...toVisitPoints);
|
|
36831
|
+
if (stemWaypoints.length > 1) {
|
|
36832
|
+
finalWaypoints.push(stemWaypoints[1]);
|
|
36833
36833
|
}
|
|
36834
|
-
|
|
36835
|
-
const
|
|
36834
|
+
finalWaypoints.push(endPoint);
|
|
36835
|
+
const uniqueWaypoints = finalWaypoints.filter((point5, index2, self2) => index2 === 0 || !point5.barelyEqual(self2[index2 - 1]));
|
|
36836
|
+
const pathPoints = findPathPoints(uniqueWaypoints, grid, obstacles, startPoint, endPoint);
|
|
36836
36837
|
return {
|
|
36837
36838
|
lines: getLines(pathPoints),
|
|
36838
|
-
newStart,
|
|
36839
|
-
newEnd
|
|
36839
|
+
newStart: startPoint,
|
|
36840
|
+
newEnd: endPoint
|
|
36840
36841
|
};
|
|
36841
36842
|
}
|
|
36842
36843
|
|
package/dist/esm/node.js
CHANGED
|
@@ -39037,50 +39037,45 @@ function createGrid(start, end, toVisitPoints = []) {
|
|
|
39037
39037
|
const startDir = getPointerDirection(start);
|
|
39038
39038
|
const endDir = getPointerDirection(end);
|
|
39039
39039
|
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
39040
|
+
const offset = conf.CONNECTOR_ITEM_OFFSET;
|
|
39040
39041
|
const offsetMap = {
|
|
39041
|
-
top: { x: 0, y: -
|
|
39042
|
-
bottom: { x: 0, y:
|
|
39043
|
-
right: { x:
|
|
39044
|
-
left: { x: -
|
|
39042
|
+
top: { x: 0, y: -offset },
|
|
39043
|
+
bottom: { x: 0, y: offset },
|
|
39044
|
+
right: { x: offset, y: 0 },
|
|
39045
|
+
left: { x: -offset, y: 0 }
|
|
39045
39046
|
};
|
|
39046
39047
|
const horizontalLines = [];
|
|
39047
39048
|
const verticalLines = [];
|
|
39048
|
-
let newStart;
|
|
39049
|
-
let newEnd;
|
|
39050
39049
|
const processPoint = (point5, dir2) => {
|
|
39050
|
+
if (point5.pointType === "Board")
|
|
39051
|
+
return;
|
|
39051
39052
|
const itemMbr = point5.item.getMbr();
|
|
39052
|
-
const
|
|
39053
|
-
const
|
|
39054
|
-
|
|
39055
|
-
|
|
39056
|
-
newPoint.y = pointOnMbr.y + offsetMap[dir2].y;
|
|
39057
|
-
verticalLines.push(mbrFloored.left - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.left, pointOnMbr.x, mbrFloored.right, mbrFloored.right + conf.CONNECTOR_ITEM_OFFSET);
|
|
39058
|
-
horizontalLines.push(mbrFloored.top - conf.CONNECTOR_ITEM_OFFSET, mbrFloored.top, pointOnMbr.y, mbrFloored.bottom, mbrFloored.bottom + conf.CONNECTOR_ITEM_OFFSET);
|
|
39059
|
-
return newPoint;
|
|
39053
|
+
const pointOnMbrX = point5.x - offsetMap[dir2].x;
|
|
39054
|
+
const pointOnMbrY = point5.y - offsetMap[dir2].y;
|
|
39055
|
+
verticalLines.push(itemMbr.left - offset, itemMbr.left, pointOnMbrX, itemMbr.right, itemMbr.right + offset);
|
|
39056
|
+
horizontalLines.push(itemMbr.top - offset, itemMbr.top, pointOnMbrY, itemMbr.bottom, itemMbr.bottom + offset);
|
|
39060
39057
|
};
|
|
39061
39058
|
if (start.pointType !== "Board" && startDir) {
|
|
39062
|
-
|
|
39059
|
+
processPoint(start, startDir);
|
|
39063
39060
|
}
|
|
39064
39061
|
if (end.pointType !== "Board" && endDir) {
|
|
39065
|
-
|
|
39066
|
-
}
|
|
39067
|
-
const
|
|
39068
|
-
|
|
39069
|
-
const middle = new Point((finalStart.x + finalEnd.x) / 2, (finalStart.y + finalEnd.y) / 2);
|
|
39070
|
-
horizontalLines.push(middle.y, finalStart.y, finalEnd.y);
|
|
39071
|
-
verticalLines.push(middle.x, finalStart.x, finalEnd.x);
|
|
39072
|
-
toVisitPoints.forEach((p3) => {
|
|
39062
|
+
processPoint(end, endDir);
|
|
39063
|
+
}
|
|
39064
|
+
const allPoints = [start, end, ...toVisitPoints];
|
|
39065
|
+
allPoints.forEach((p3) => {
|
|
39073
39066
|
horizontalLines.push(p3.y);
|
|
39074
39067
|
verticalLines.push(p3.x);
|
|
39075
39068
|
});
|
|
39069
|
+
const middle = new Point((start.x + end.x) / 2, (start.y + end.y) / 2);
|
|
39070
|
+
horizontalLines.push(middle.y);
|
|
39071
|
+
verticalLines.push(middle.x);
|
|
39076
39072
|
const uniqueHorizontalLines = Array.from(new Set(horizontalLines)).sort((a2, b) => a2 - b);
|
|
39077
39073
|
const uniqueVerticalLines = Array.from(new Set(verticalLines)).sort((a2, b) => a2 - b);
|
|
39078
39074
|
const grid = uniqueVerticalLines.map((x) => uniqueHorizontalLines.map((y) => new Point(x, y)));
|
|
39079
39075
|
return {
|
|
39080
39076
|
grid,
|
|
39081
|
-
newStart,
|
|
39082
|
-
newEnd
|
|
39083
|
-
middlePoint: middle
|
|
39077
|
+
newStart: start,
|
|
39078
|
+
newEnd: end
|
|
39084
39079
|
};
|
|
39085
39080
|
}
|
|
39086
39081
|
function findPath(start, end, grid, obstacles, existingPath, newStart, newEnd) {
|
|
@@ -39240,71 +39235,77 @@ function reconstructPath(node2) {
|
|
|
39240
39235
|
}
|
|
39241
39236
|
return path2.reverse();
|
|
39242
39237
|
}
|
|
39243
|
-
function
|
|
39244
|
-
const
|
|
39238
|
+
function findOrthogonalPath(start, end, obstacles, toVisitPoints = []) {
|
|
39239
|
+
const startDir = getPointerDirection(start);
|
|
39240
|
+
const endDir = getPointerDirection(end);
|
|
39245
39241
|
const offset = conf.CONNECTOR_ITEM_OFFSET;
|
|
39246
|
-
|
|
39247
|
-
|
|
39242
|
+
let startPoint = start;
|
|
39243
|
+
let endPoint = end;
|
|
39244
|
+
const processPoint = (point5, dir2) => {
|
|
39245
|
+
if (point5.pointType === "Board")
|
|
39246
|
+
return point5;
|
|
39247
|
+
const offsetMap = {
|
|
39248
|
+
top: { x: 0, y: -offset },
|
|
39249
|
+
bottom: { x: 0, y: offset },
|
|
39250
|
+
right: { x: offset, y: 0 },
|
|
39251
|
+
left: { x: -offset, y: 0 }
|
|
39252
|
+
};
|
|
39253
|
+
const itemMbr = point5.item.getMbr();
|
|
39254
|
+
const revertMapDir = { top: 0, bottom: 1, right: 2, left: 3 };
|
|
39255
|
+
const pointOnMbr = itemMbr.getLines()[revertMapDir[dir2]].getNearestPointOnLineSegment(point5);
|
|
39256
|
+
const newPoint = Object.create(Object.getPrototypeOf(point5), Object.getOwnPropertyDescriptors(point5));
|
|
39257
|
+
newPoint.x = pointOnMbr.x + offsetMap[dir2].x;
|
|
39258
|
+
newPoint.y = pointOnMbr.y + offsetMap[dir2].y;
|
|
39259
|
+
return newPoint;
|
|
39260
|
+
};
|
|
39261
|
+
if (start.pointType !== "Board" && startDir) {
|
|
39262
|
+
startPoint = processPoint(start, startDir);
|
|
39263
|
+
}
|
|
39264
|
+
if (end.pointType !== "Board" && endDir) {
|
|
39265
|
+
endPoint = processPoint(end, endDir);
|
|
39248
39266
|
}
|
|
39267
|
+
const stemWaypoints = [];
|
|
39249
39268
|
if (startDir) {
|
|
39250
|
-
let
|
|
39251
|
-
|
|
39252
|
-
|
|
39253
|
-
|
|
39254
|
-
|
|
39255
|
-
|
|
39256
|
-
|
|
39257
|
-
|
|
39258
|
-
|
|
39259
|
-
|
|
39260
|
-
break;
|
|
39261
|
-
case "top":
|
|
39262
|
-
waypoint = new Point(startPoint.x, startPoint.y - offset);
|
|
39263
|
-
break;
|
|
39264
|
-
}
|
|
39265
|
-
waypoints.push(waypoint);
|
|
39269
|
+
let stem;
|
|
39270
|
+
if (startDir === "right")
|
|
39271
|
+
stem = new Point(startPoint.x + offset, startPoint.y);
|
|
39272
|
+
else if (startDir === "left")
|
|
39273
|
+
stem = new Point(startPoint.x - offset, startPoint.y);
|
|
39274
|
+
else if (startDir === "bottom")
|
|
39275
|
+
stem = new Point(startPoint.x, startPoint.y + offset);
|
|
39276
|
+
else
|
|
39277
|
+
stem = new Point(startPoint.x, startPoint.y - offset);
|
|
39278
|
+
stemWaypoints.push(stem);
|
|
39266
39279
|
}
|
|
39267
39280
|
if (endDir) {
|
|
39268
|
-
let
|
|
39269
|
-
|
|
39270
|
-
|
|
39271
|
-
|
|
39272
|
-
|
|
39273
|
-
|
|
39274
|
-
|
|
39275
|
-
|
|
39276
|
-
|
|
39277
|
-
|
|
39278
|
-
break;
|
|
39279
|
-
case "top":
|
|
39280
|
-
waypoint = new Point(endPoint.x, endPoint.y - offset);
|
|
39281
|
-
break;
|
|
39282
|
-
}
|
|
39283
|
-
waypoints.push(waypoint);
|
|
39281
|
+
let stem;
|
|
39282
|
+
if (endDir === "right")
|
|
39283
|
+
stem = new Point(endPoint.x + offset, endPoint.y);
|
|
39284
|
+
else if (endDir === "left")
|
|
39285
|
+
stem = new Point(endPoint.x - offset, endPoint.y);
|
|
39286
|
+
else if (endDir === "bottom")
|
|
39287
|
+
stem = new Point(endPoint.x, endPoint.y + offset);
|
|
39288
|
+
else
|
|
39289
|
+
stem = new Point(endPoint.x, endPoint.y - offset);
|
|
39290
|
+
stemWaypoints.push(stem);
|
|
39284
39291
|
}
|
|
39285
|
-
|
|
39286
|
-
}
|
|
39287
|
-
|
|
39288
|
-
const { grid, newStart, newEnd } = createGrid(start, end, toVisitPoints);
|
|
39289
|
-
const startPoint = newStart || start;
|
|
39290
|
-
const endPoint = newEnd || end;
|
|
39291
|
-
const startDir = getPointerDirection(start);
|
|
39292
|
-
const endDir = getPointerDirection(end);
|
|
39293
|
-
const stemWaypoints = createStemWaypoints(startPoint, endPoint, startDir, endDir);
|
|
39294
|
-
let finalWaypoints = [];
|
|
39292
|
+
const allGridPoints = [startPoint, endPoint, ...stemWaypoints, ...toVisitPoints];
|
|
39293
|
+
const { grid } = createGrid(startPoint, endPoint, allGridPoints);
|
|
39294
|
+
let finalWaypoints = [startPoint];
|
|
39295
39295
|
if (stemWaypoints.length > 0) {
|
|
39296
|
-
|
|
39297
|
-
|
|
39298
|
-
|
|
39299
|
-
|
|
39300
|
-
finalWaypoints
|
|
39296
|
+
finalWaypoints.push(stemWaypoints[0]);
|
|
39297
|
+
}
|
|
39298
|
+
finalWaypoints.push(...toVisitPoints);
|
|
39299
|
+
if (stemWaypoints.length > 1) {
|
|
39300
|
+
finalWaypoints.push(stemWaypoints[1]);
|
|
39301
39301
|
}
|
|
39302
|
-
|
|
39303
|
-
const
|
|
39302
|
+
finalWaypoints.push(endPoint);
|
|
39303
|
+
const uniqueWaypoints = finalWaypoints.filter((point5, index2, self2) => index2 === 0 || !point5.barelyEqual(self2[index2 - 1]));
|
|
39304
|
+
const pathPoints = findPathPoints(uniqueWaypoints, grid, obstacles, startPoint, endPoint);
|
|
39304
39305
|
return {
|
|
39305
39306
|
lines: getLines(pathPoints),
|
|
39306
|
-
newStart,
|
|
39307
|
-
newEnd
|
|
39307
|
+
newStart: startPoint,
|
|
39308
|
+
newEnd: endPoint
|
|
39308
39309
|
};
|
|
39309
39310
|
}
|
|
39310
39311
|
|