보조선 intersect 검사 수정

This commit is contained in:
hyojun.choi 2024-11-05 15:15:52 +09:00
parent 1fb9e26efc
commit 6ccadf80af
2 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ import { useAdsorptionPoint } from '@/hooks/useAdsorptionPoint'
import { useSwal } from '@/hooks/useSwal'
import { booleanPointInPolygon } from '@turf/turf'
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 { POLYGON_TYPE } from '@/common/common'
@ -587,7 +587,7 @@ export function useAuxiliaryDrawing(id) {
return
}
// 기존 점과 겹치는지 확인
if (interSectionPointsWithRoofLines.some((point) => point.x === intersectionPoint.x && point.y === intersectionPoint.y)) {
if (interSectionPointsWithRoofLines.some((point) => isSamePoint(point, intersectionPoint))) {
return
}

View File

@ -1445,7 +1445,7 @@ function removeDuplicatePolygons(polygons) {
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
}