Merge branch 'dev' of ssh://git.jetbrains.space/nalpari/q-cast-iii/qcast-front into dev

This commit is contained in:
yoosangwook 2025-01-24 11:03:26 +09:00
commit 92ea757a17

View File

@ -859,6 +859,7 @@ export const usePolygon = () => {
line.endPoint = endPoint
})
// polygon line에서 각각 출발한다.
polygonLines.forEach((line) => {
/*line.set({ strokeWidth: 5, stroke: 'green' })
canvas.add(line)
@ -872,9 +873,11 @@ export const usePolygon = () => {
const startLine = line
const visitPoints = [startPoint]
const visitLines = [startLine]
let notVisitedLines = []
let cnt = 0
while (!isSamePoint(currentPoint, arrivalPoint)) {
//현재 점으로 부터 갈 수 있는 다른 라인을 찾는다.
let nextLines = allLines.filter(
(line2) =>
(isSamePoint(line2.startPoint, currentPoint) || isSamePoint(line2.endPoint, currentPoint)) &&
@ -892,8 +895,13 @@ export const usePolygon = () => {
)
}
if (!nextLines) {
break
if (nextLines.length === 0) {
//아직 안갔던 line중 0번째를 선택한다.
if (notVisitedLines.length === 0) {
break
} else {
// nextLines = [...notVisitedLines.shift().line]
}
}
let comparisonPoints = []
@ -919,6 +927,14 @@ export const usePolygon = () => {
nextLines.forEach((nextLine) => {
if (isSamePoint(nextLine.startPoint, minDistancePoint) || isSamePoint(nextLine.endPoint, minDistancePoint)) {
visitLines.push(nextLine)
} else {
notVisitedLines.push({
line: nextLine,
endPoint: nextLine.endPoint,
startPoint: nextLine.startPoint,
currentPoint: { ...currentPoint },
roofPoints: [...roofPoints],
})
}
})