Merge branch 'dev' of ssh://git.jetbrains.space/nalpari/q-cast-iii/qcast-front into dev
This commit is contained in:
commit
92ea757a17
@ -859,6 +859,7 @@ export const usePolygon = () => {
|
|||||||
line.endPoint = endPoint
|
line.endPoint = endPoint
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// polygon line에서 각각 출발한다.
|
||||||
polygonLines.forEach((line) => {
|
polygonLines.forEach((line) => {
|
||||||
/*line.set({ strokeWidth: 5, stroke: 'green' })
|
/*line.set({ strokeWidth: 5, stroke: 'green' })
|
||||||
canvas.add(line)
|
canvas.add(line)
|
||||||
@ -872,9 +873,11 @@ export const usePolygon = () => {
|
|||||||
const startLine = line
|
const startLine = line
|
||||||
const visitPoints = [startPoint]
|
const visitPoints = [startPoint]
|
||||||
const visitLines = [startLine]
|
const visitLines = [startLine]
|
||||||
|
let notVisitedLines = []
|
||||||
let cnt = 0
|
let cnt = 0
|
||||||
|
|
||||||
while (!isSamePoint(currentPoint, arrivalPoint)) {
|
while (!isSamePoint(currentPoint, arrivalPoint)) {
|
||||||
|
//현재 점으로 부터 갈 수 있는 다른 라인을 찾는다.
|
||||||
let nextLines = allLines.filter(
|
let nextLines = allLines.filter(
|
||||||
(line2) =>
|
(line2) =>
|
||||||
(isSamePoint(line2.startPoint, currentPoint) || isSamePoint(line2.endPoint, currentPoint)) &&
|
(isSamePoint(line2.startPoint, currentPoint) || isSamePoint(line2.endPoint, currentPoint)) &&
|
||||||
@ -892,8 +895,13 @@ export const usePolygon = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!nextLines) {
|
if (nextLines.length === 0) {
|
||||||
break
|
//아직 안갔던 line중 0번째를 선택한다.
|
||||||
|
if (notVisitedLines.length === 0) {
|
||||||
|
break
|
||||||
|
} else {
|
||||||
|
// nextLines = [...notVisitedLines.shift().line]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let comparisonPoints = []
|
let comparisonPoints = []
|
||||||
@ -919,6 +927,14 @@ export const usePolygon = () => {
|
|||||||
nextLines.forEach((nextLine) => {
|
nextLines.forEach((nextLine) => {
|
||||||
if (isSamePoint(nextLine.startPoint, minDistancePoint) || isSamePoint(nextLine.endPoint, minDistancePoint)) {
|
if (isSamePoint(nextLine.startPoint, minDistancePoint) || isSamePoint(nextLine.endPoint, minDistancePoint)) {
|
||||||
visitLines.push(nextLine)
|
visitLines.push(nextLine)
|
||||||
|
} else {
|
||||||
|
notVisitedLines.push({
|
||||||
|
line: nextLine,
|
||||||
|
endPoint: nextLine.endPoint,
|
||||||
|
startPoint: nextLine.startPoint,
|
||||||
|
currentPoint: { ...currentPoint },
|
||||||
|
roofPoints: [...roofPoints],
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user