지붕면 할당 시 제대로 나눠지지 않는 현상 수정

This commit is contained in:
hyojun.choi 2025-02-27 14:53:35 +09:00
parent 890146db4c
commit b896bc38b9

View File

@ -982,15 +982,15 @@ export const usePolygon = () => {
/*line.set({ strokeWidth: 5, stroke: 'green' }) /*line.set({ strokeWidth: 5, stroke: 'green' })
canvas.add(line) canvas.add(line)
canvas.renderAll()*/ canvas.renderAll()*/
const startPoint = line.startPoint // 시작점 const startPoint = { ...line.startPoint } // 시작점
let arrivalPoint = line.endPoint // 도착점 let arrivalPoint = { ...line.endPoint } // 도착점
let currentPoint = startPoint let currentPoint = startPoint
const roofPoints = [startPoint] let roofPoints = [startPoint]
const startLine = line let startLine = line
const visitPoints = [startPoint] let visitPoints = [startPoint]
const visitLines = [startLine] let visitLines = [startLine]
let notVisitedLines = [] let notVisitedLines = []
let cnt = 0 let cnt = 0
@ -1018,7 +1018,10 @@ export const usePolygon = () => {
if (notVisitedLines.length === 0) { if (notVisitedLines.length === 0) {
break break
} else { } else {
// nextLines = [...notVisitedLines.shift().line] let notVisitedLine = notVisitedLines.shift()
roofPoints = [...notVisitedLine.roofPoints]
currentPoint = { ...notVisitedLine.currentPoint }
continue
} }
} }
@ -1059,6 +1062,7 @@ export const usePolygon = () => {
currentPoint = { ...minDistancePoint } currentPoint = { ...minDistancePoint }
roofPoints.push(currentPoint) roofPoints.push(currentPoint)
cnt++ cnt++
if (cnt > 100) { if (cnt > 100) {
break break
} }