x가 전부 같거나, y가 전부 같은경우 제거

This commit is contained in:
hyojun.choi 2025-04-30 13:26:05 +09:00
parent adc0c41a67
commit 937f2eb3fe

View File

@ -303,7 +303,13 @@ export function removeDuplicatePolygons(polygons) {
}
})
return uniquePolygons
// x가 전부 같거나, y가 전부 같은 경우 제거
return uniquePolygons.filter((polygon) => {
const xValues = polygon.map((point) => point.x)
const yValues = polygon.map((point) => point.y)
return !(xValues.every((x) => x === xValues[0]) || yValues.every((y) => y === yValues[0]))
})
}
export const isSamePoint = (a, b) => {