|
@@ -495,7 +495,7 @@ export default {
|
|
|
return eachPoint.y
|
|
|
})
|
|
|
let yLength = Math.max(...yArray) - Math.min(...yArray)
|
|
|
- yCenter = (Math.max(...yArray) + Math.min(...yArray)) / 2
|
|
|
+ yCenter = (Math.max(...yArray) + Math.min(...yArray)) / 2
|
|
|
let zArray = rawWholeData.map((eachPoint) => {
|
|
|
return eachPoint.z
|
|
|
})
|
|
@@ -513,7 +513,7 @@ export default {
|
|
|
return (eachX - xCenter) * pxPerUnitLength + svgWidth / 2
|
|
|
})
|
|
|
let wholeYArrayInPx = yArray.map((eachY) => {
|
|
|
- return (eachY - yCenter) * pxPerUnitLength + svgHeight / 2
|
|
|
+ return (-1) * (eachY - yCenter) * pxPerUnitLength + svgHeight / 2
|
|
|
})
|
|
|
|
|
|
// 组合成最终数据用来渲染
|
|
@@ -882,16 +882,16 @@ export default {
|
|
|
|
|
|
// 选择框位置复原到原始坐标系
|
|
|
const brushLeft = (brushLeftPxBeformTransform - svgWidth / 2) / pxPerUnitLength + xCenter
|
|
|
- const brushTop = (brushTopPxBeformTransform - svgHeight / 2) / pxPerUnitLength + yCenter
|
|
|
+ const brushTop = (brushTopPxBeformTransform - svgHeight / 2) / pxPerUnitLength * (-1) + yCenter
|
|
|
const brushRight = (brushRightPxBeformTransform - svgWidth / 2) / pxPerUnitLength + xCenter
|
|
|
- const brushBottom = (brushBottomPxBeformTransform - svgHeight / 2) / pxPerUnitLength + yCenter
|
|
|
+ const brushBottom = (brushBottomPxBeformTransform - svgHeight / 2) / pxPerUnitLength * (-1) + yCenter
|
|
|
console.log('brush area in raw coordinate: ', brushLeft, brushTop, brushRight, brushBottom);
|
|
|
|
|
|
// 计算出选择框的外围影响区域
|
|
|
const affectionAreaLeft = brushLeft - pointDistance * Math.SQRT2 * 1.25
|
|
|
- const affectionAreaTop = brushTop - pointDistance * Math.SQRT2 * 1.25
|
|
|
+ const affectionAreaTop = brushTop + pointDistance * Math.SQRT2 * 1.25
|
|
|
const affectionAreaRight = brushRight + pointDistance * Math.SQRT2 * 1.25
|
|
|
- const affectionAreaBottom = brushBottom + pointDistance * Math.SQRT2 * 1.25
|
|
|
+ const affectionAreaBottom = brushBottom - pointDistance * Math.SQRT2 * 1.25
|
|
|
console.log('affection area in raw coordinate: ', affectionAreaLeft, affectionAreaTop, affectionAreaRight, affectionAreaBottom);
|
|
|
|
|
|
// 筛选出框选区域可能影响到的所有外围点
|
|
@@ -904,11 +904,11 @@ export default {
|
|
|
continue
|
|
|
}
|
|
|
// 如果在affection范围外,pass
|
|
|
- if (point.x < affectionAreaLeft || point.x > affectionAreaRight || point.y < affectionAreaTop || point.y > affectionAreaBottom) {
|
|
|
+ if (point.x < affectionAreaLeft || point.x > affectionAreaRight || point.y < affectionAreaBottom || point.y > affectionAreaTop) {
|
|
|
continue
|
|
|
}
|
|
|
// 如果在框选区域内,pass
|
|
|
- if (point.x >= brushLeft && point.x <= brushRight && point.y >= brushTop && point.y <= brushBottom) {
|
|
|
+ if (point.x >= brushLeft && point.x <= brushRight && point.y <= brushTop && point.y >= brushBottom) {
|
|
|
continue
|
|
|
}
|
|
|
affectedPointList.push(point)
|
|
@@ -926,7 +926,7 @@ export default {
|
|
|
continue
|
|
|
}
|
|
|
// 如果在框选区域内,留下
|
|
|
- if (point.x >= brushLeft && point.x <= brushRight && point.y >= brushTop && point.y <= brushBottom) {
|
|
|
+ if (point.x >= brushLeft && point.x <= brushRight && point.y <= brushTop && point.y >= brushBottom) {
|
|
|
pointInBrushList.push(point)
|
|
|
}
|
|
|
}
|
|
@@ -977,7 +977,7 @@ export default {
|
|
|
const neiPos = neighbourPosList[key];
|
|
|
|
|
|
// 如果点位在框选区域外
|
|
|
- if (neiPos.x < brushLeft || neiPos.x > brushRight || neiPos.y < brushTop || neiPos.y > brushBottom) {
|
|
|
+ if (neiPos.x < brushLeft || neiPos.x > brushRight || neiPos.y > brushTop || neiPos.y < brushBottom) {
|
|
|
// 在外围点位表中找匹配的点
|
|
|
const matchedPoint = affectedPointList.find((affectedPoint) => {
|
|
|
return getDistance2D(affectedPoint, neiPos) < pointDistance * 0.1
|