보조선 intersect 검사 수정
This commit is contained in:
parent
1fb9e26efc
commit
6ccadf80af
@ -21,7 +21,7 @@ import { useAdsorptionPoint } from '@/hooks/useAdsorptionPoint'
|
|||||||
import { useSwal } from '@/hooks/useSwal'
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
import { booleanPointInPolygon } from '@turf/turf'
|
import { booleanPointInPolygon } from '@turf/turf'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
import { calculateAngle } from '@/util/qpolygon-utils'
|
import { calculateAngle, isSamePoint } from '@/util/qpolygon-utils'
|
||||||
import { QPolygon } from '@/components/fabric/QPolygon'
|
import { QPolygon } from '@/components/fabric/QPolygon'
|
||||||
import { POLYGON_TYPE } from '@/common/common'
|
import { POLYGON_TYPE } from '@/common/common'
|
||||||
|
|
||||||
@ -587,7 +587,7 @@ export function useAuxiliaryDrawing(id) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 기존 점과 겹치는지 확인
|
// 기존 점과 겹치는지 확인
|
||||||
if (interSectionPointsWithRoofLines.some((point) => point.x === intersectionPoint.x && point.y === intersectionPoint.y)) {
|
if (interSectionPointsWithRoofLines.some((point) => isSamePoint(point, intersectionPoint))) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1445,7 +1445,7 @@ function removeDuplicatePolygons(polygons) {
|
|||||||
return uniquePolygons
|
return uniquePolygons
|
||||||
}
|
}
|
||||||
|
|
||||||
const isSamePoint = (a, b) => {
|
export const isSamePoint = (a, b) => {
|
||||||
return Math.abs(Math.round(a.x) - Math.round(b.x)) <= 1 && Math.abs(Math.round(a.y) - Math.round(b.y)) <= 1
|
return Math.abs(Math.round(a.x) - Math.round(b.x)) <= 1 && Math.abs(Math.round(a.y) - Math.round(b.y)) <= 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user