diff --git a/src/util/qpolygon-utils.js b/src/util/qpolygon-utils.js index 7d234010..482693dc 100644 --- a/src/util/qpolygon-utils.js +++ b/src/util/qpolygon-utils.js @@ -311,8 +311,6 @@ export function removeDuplicatePolygons(polygons, hasAuxiliaryLine = false) { // return isValidPoints(polygon) // }) - console.log('uniquePolygons2', uniquePolygons) - return uniquePolygons } @@ -373,6 +371,14 @@ function checkPolygonSelfIntersection(coordinates) { } } + // 모든 점이 같은 직선상에 있는지 검사 (degenerate polygon) + const allSameX = coordinates.every((point) => point.x === coordinates[0].x) + const allSameY = coordinates.every((point) => point.y === coordinates[0].y) + + if (allSameX || allSameY) { + return true // 직선상의 점들은 유효하지 않은 다각형이므로 true 반환 + } + const intersections = [] const edges = []