@fleet-frontend/mower-maps 0.2.2 → 0.2.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/dist/index.esm.js
CHANGED
|
@@ -23387,23 +23387,26 @@ const useCheckElement = () => {
|
|
|
23387
23387
|
return doodleTransformedPoints.some((point) => isPointInPolygon(point, currentBoundaryPoints));
|
|
23388
23388
|
});
|
|
23389
23389
|
// 4. 检查当前 obstacle 和 doodle 不能相交,且间隔要大于2m
|
|
23390
|
-
// console.log('doodlesInBoundary--->', doodlesInBoundary);
|
|
23391
23390
|
for (const doodle of doodlesInBoundary) {
|
|
23392
|
-
|
|
23393
|
-
//
|
|
23394
|
-
|
|
23395
|
-
|
|
23396
|
-
|
|
23397
|
-
|
|
23398
|
-
|
|
23399
|
-
|
|
23400
|
-
|
|
23401
|
-
|
|
23402
|
-
|
|
23403
|
-
|
|
23404
|
-
|
|
23405
|
-
|
|
23406
|
-
|
|
23391
|
+
// doodle 转换后的数据是二维数组,数组的每一项都是一个polygon,这里之所以不用flat()扁平处理
|
|
23392
|
+
// 因为多个polygon可能会有相交/相切的情况,单纯flat会导致无法处理flat后的不正常的矩形数据
|
|
23393
|
+
const doodleTransformedPoints = transformSvgElements(doodle);
|
|
23394
|
+
for (const points of doodleTransformedPoints) {
|
|
23395
|
+
// 检查相交
|
|
23396
|
+
if (doPolygonsIntersect(currentObstaclePolygon, points)) {
|
|
23397
|
+
return {
|
|
23398
|
+
result: true,
|
|
23399
|
+
code: CheckObstaclePointErrorType.DOODLE_INTERSECT,
|
|
23400
|
+
};
|
|
23401
|
+
}
|
|
23402
|
+
// 检查距离
|
|
23403
|
+
const distance = polygonToPolygonDistance(currentObstaclePolygon, points);
|
|
23404
|
+
if (distance < minDistance) {
|
|
23405
|
+
return {
|
|
23406
|
+
result: true,
|
|
23407
|
+
code: CheckObstaclePointErrorType.DOODLE_DISTANCE_TOO_CLOSE,
|
|
23408
|
+
};
|
|
23409
|
+
}
|
|
23407
23410
|
}
|
|
23408
23411
|
}
|
|
23409
23412
|
return {
|
package/dist/index.js
CHANGED
|
@@ -23407,23 +23407,26 @@ const useCheckElement = () => {
|
|
|
23407
23407
|
return doodleTransformedPoints.some((point) => isPointInPolygon(point, currentBoundaryPoints));
|
|
23408
23408
|
});
|
|
23409
23409
|
// 4. 检查当前 obstacle 和 doodle 不能相交,且间隔要大于2m
|
|
23410
|
-
// console.log('doodlesInBoundary--->', doodlesInBoundary);
|
|
23411
23410
|
for (const doodle of doodlesInBoundary) {
|
|
23412
|
-
|
|
23413
|
-
//
|
|
23414
|
-
|
|
23415
|
-
|
|
23416
|
-
|
|
23417
|
-
|
|
23418
|
-
|
|
23419
|
-
|
|
23420
|
-
|
|
23421
|
-
|
|
23422
|
-
|
|
23423
|
-
|
|
23424
|
-
|
|
23425
|
-
|
|
23426
|
-
|
|
23411
|
+
// doodle 转换后的数据是二维数组,数组的每一项都是一个polygon,这里之所以不用flat()扁平处理
|
|
23412
|
+
// 因为多个polygon可能会有相交/相切的情况,单纯flat会导致无法处理flat后的不正常的矩形数据
|
|
23413
|
+
const doodleTransformedPoints = transformSvgElements(doodle);
|
|
23414
|
+
for (const points of doodleTransformedPoints) {
|
|
23415
|
+
// 检查相交
|
|
23416
|
+
if (doPolygonsIntersect(currentObstaclePolygon, points)) {
|
|
23417
|
+
return {
|
|
23418
|
+
result: true,
|
|
23419
|
+
code: exports.CheckObstaclePointErrorType.DOODLE_INTERSECT,
|
|
23420
|
+
};
|
|
23421
|
+
}
|
|
23422
|
+
// 检查距离
|
|
23423
|
+
const distance = polygonToPolygonDistance(currentObstaclePolygon, points);
|
|
23424
|
+
if (distance < minDistance) {
|
|
23425
|
+
return {
|
|
23426
|
+
result: true,
|
|
23427
|
+
code: exports.CheckObstaclePointErrorType.DOODLE_DISTANCE_TOO_CLOSE,
|
|
23428
|
+
};
|
|
23429
|
+
}
|
|
23427
23430
|
}
|
|
23428
23431
|
}
|
|
23429
23432
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCheckElement.d.ts","sourceRoot":"","sources":["../../../../src/render/svgEditMap/hooks/useCheckElement.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAGnF,eAAO,MAAM,eAAe;uBAIU;QAClC,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,oBAAoB,CAAC;KAC7B;8CA+He;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,gBACtB,MAAM,EAAE,EAAE,KACvB;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,2BAA2B,CAAA;KAAE;
|
|
1
|
+
{"version":3,"file":"useCheckElement.d.ts","sourceRoot":"","sources":["../../../../src/render/svgEditMap/hooks/useCheckElement.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAGnF,eAAO,MAAM,eAAe;uBAIU;QAClC,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,oBAAoB,CAAC;KAC7B;8CA+He;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,gBACtB,MAAM,EAAE,EAAE,KACvB;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,2BAA2B,CAAA;KAAE;CA2H7D,CAAC"}
|