지붕면 할당 시 제대로 나눠지지 않는 현상 수정
This commit is contained in:
parent
890146db4c
commit
b896bc38b9
@ -982,15 +982,15 @@ export const usePolygon = () => {
|
||||
/*line.set({ strokeWidth: 5, stroke: 'green' })
|
||||
canvas.add(line)
|
||||
canvas.renderAll()*/
|
||||
const startPoint = line.startPoint // 시작점
|
||||
let arrivalPoint = line.endPoint // 도착점
|
||||
const startPoint = { ...line.startPoint } // 시작점
|
||||
let arrivalPoint = { ...line.endPoint } // 도착점
|
||||
|
||||
let currentPoint = startPoint
|
||||
const roofPoints = [startPoint]
|
||||
let roofPoints = [startPoint]
|
||||
|
||||
const startLine = line
|
||||
const visitPoints = [startPoint]
|
||||
const visitLines = [startLine]
|
||||
let startLine = line
|
||||
let visitPoints = [startPoint]
|
||||
let visitLines = [startLine]
|
||||
let notVisitedLines = []
|
||||
let cnt = 0
|
||||
|
||||
@ -1018,7 +1018,10 @@ export const usePolygon = () => {
|
||||
if (notVisitedLines.length === 0) {
|
||||
break
|
||||
} 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 }
|
||||
roofPoints.push(currentPoint)
|
||||
cnt++
|
||||
|
||||
if (cnt > 100) {
|
||||
break
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user