dev #854

Merged
ysCha merged 2 commits from dev into dev-deploy 2026-05-14 17:27:00 +09:00
6 changed files with 36 additions and 36 deletions

View File

@ -11,7 +11,7 @@ const s3 = new S3Client({
})
const uploadImage = async (file) => {
console.log('🚀 ~ uploadImage ~ file:', file)
// console.log('🚀 ~ uploadImage ~ file:', file)
const Body = Buffer.from(await file.arrayBuffer())
const Key = `cads/${file.name}`
const ContentType = 'image/png'
@ -49,7 +49,7 @@ export async function DELETE(req) {
try {
const searchParams = req.nextUrl.searchParams
const Key = `cads/${searchParams.get('fileName')}`
console.log('🚀 ~ DELETE ~ Key:', Key)
// console.log('🚀 ~ DELETE ~ Key:', Key)
if (!Key) {
return NextResponse.json({ error: 'fileName parameter is required' }, { status: 400 })

View File

@ -57,7 +57,7 @@ export async function DELETE(req) {
try {
const searchParams = req.nextUrl.searchParams
const Key = `maps/${searchParams.get('fileName')}`
console.log('🚀 ~ DELETE ~ Key:', Key)
// console.log('🚀 ~ DELETE ~ Key:', Key)
if (!Key) {
return NextResponse.json({ error: 'fileName parameter is required' }, { status: 400 })

View File

@ -55,7 +55,7 @@ export async function DELETE(req) {
}
const Key = `upload/${fileName}`
console.log('🚀 ~ DELETE ~ Key:', Key)
// console.log('🚀 ~ DELETE ~ Key:', Key)
await s3.send(
new DeleteObjectCommand({

View File

@ -5,7 +5,7 @@ import configProduction from './config.production'
// 클라이언트에서는 이 함수를 사용하여 config 값을 참조합니다.
const Config = () => {
console.log('🚀 ~ Config ~ process.env.NEXT_PUBLIC_RUN_MODE:', process.env.NEXT_PUBLIC_RUN_MODE)
// console.log('🚀 ~ Config ~ process.env.NEXT_PUBLIC_RUN_MODE:', process.env.NEXT_PUBLIC_RUN_MODE)
switch (process.env.NEXT_PUBLIC_RUN_MODE) {
case 'local':
return configLocal

View File

@ -10,7 +10,7 @@ import fs from 'fs/promises'
const imageSavePath = 'public/cadImages'
const convertDwgToPng = async (fileName, data) => {
console.log('fileName', fileName)
// console.log('fileName', fileName)
try {
await fs.readdir(imageSavePath)
} catch {

View File

@ -281,7 +281,7 @@ const movingLineFromSkeleton = (roofId, canvas) => {
else if (moveDirection === 'out') point.x = Big(point.x).plus(moveUpDownLength).toNumber();
// if (__isLocalMS) logger.log(`[BR-TRACE] i=${i} right/${moveDirection} x ${__bx}→${point.x}`)
} else if (__isLocalMS) {
// logger.warn(`[BR-TRACE] i=${i} position=${position} 매칭 분기 없음 (이동 안 됨)`)
logger.warn(`[BR-TRACE] i=${i} position=${position} 매칭 분기 없음 (이동 안 됨)`)
}
});
@ -469,7 +469,7 @@ const buildRawMovedPoints = (roofId, canvas) => {
else if (moveDirection === 'in') point.x = Big(point.x).minus(moveUpDownLength).toNumber()
// if (__isLocalBR) logger.log(`[BR-TRACE] i=${i} right/${moveDirection} x ${__bx}→${point.x}`)
} else if (__isLocalBR) {
// logger.warn(`[BR-TRACE] i=${i} position=${position} 매칭 분기 없음 (이동 안 됨)`)
logger.warn(`[BR-TRACE] i=${i} position=${position} 매칭 분기 없음 (이동 안 됨)`)
}
})
@ -483,7 +483,7 @@ const buildRawMovedPoints = (roofId, canvas) => {
return newPoints
} catch (e) {
// logger.warn('[buildRawMovedPoints] 실패 → null fallback:', e)
logger.warn('[buildRawMovedPoints] 실패 → null fallback:', e)
return null
}
}
@ -566,9 +566,9 @@ export const verifyMoveBoundary = (roofId, canvas) => {
const boundaryTol = Math.max(1.0, Math.abs(crossOrig) * 0.05)
if (crossNew < -boundaryTol) {
// logger.warn(
// `[verifyMoveBoundary] 꼭짓점[${i}] 골짜기 → 볼록 뒤집힘 (CROSSED): ${crossOrig.toFixed(1)} → ${crossNew.toFixed(1)}`
// )
logger.warn(
`[verifyMoveBoundary] 꼭짓점[${i}] 골짜기 → 볼록 뒤집힘 (CROSSED): ${crossOrig.toFixed(1)}${crossNew.toFixed(1)}`
)
return 'crossed'
}
if (Math.abs(crossNew) <= boundaryTol) {
@ -586,7 +586,7 @@ export const verifyMoveBoundary = (roofId, canvas) => {
// logger.log(`[verifyMoveBoundary] 최종 판정: ${worst} (moved indices=[${movedIdx.join(',')}])`)
return worst
} catch (e) {
// logger.warn('[verifyMoveBoundary] 판정 실패 → unknown:', e)
logger.warn('[verifyMoveBoundary] 판정 실패 → unknown:', e)
return 'unknown'
}
}
@ -601,7 +601,7 @@ const safeMovedPointsWithFallback = (roofId, canvas) => {
const movedPoints = movingLineFromSkeleton(roofId, canvas)
if (!Array.isArray(movedPoints) || movedPoints.length === 0) {
// logger.warn('[safeMovedPointsWithFallback] movedPoints 비정상 → bail out')
logger.warn('[safeMovedPointsWithFallback] movedPoints 비정상 → bail out')
return null
}
@ -651,13 +651,13 @@ const safeMovedPointsWithFallback = (roofId, canvas) => {
}
if (zeroLenEdges > 0 || severeReduction || selfIntersect) {
// logger.warn('[safeMovedPointsWithFallback] 붕괴/교차 감지 (로그만)', {
// movedLen: movedPoints.length,
// oldLen: oldPoints.length,
// zeroLenEdges,
// severeReduction,
// selfIntersect,
// })
logger.warn('[safeMovedPointsWithFallback] 붕괴/교차 감지 (로그만)', {
movedLen: movedPoints.length,
oldLen: oldPoints.length,
zeroLenEdges,
severeReduction,
selfIntersect,
})
}
return movedPoints
@ -975,7 +975,7 @@ export const skeletonBuilder = (roofId, canvas, textMode) => {
// 1. 지붕 폴리곤 유효성 검사
const coordinates = preprocessPolygonCoordinates(roof.points)
if (coordinates.length < 3) {
// logger.warn('Polygon has less than 3 unique points. Cannot generate skeleton.')
logger.warn('Polygon has less than 3 unique points. Cannot generate skeleton.')
return
}
@ -1076,10 +1076,10 @@ export const skeletonBuilder = (roofId, canvas, textMode) => {
try {
const __moveVerdict = verifyMoveBoundary(roofId, canvas)
if (__moveVerdict === 'crossed') {
// logger.warn('[skeleton] 경계 넘음(crossed) → 오버된 wall.baseLine 좌표 기반 재빌드 진행')
logger.warn('[skeleton] 경계 넘음(crossed) → 오버된 wall.baseLine 좌표 기반 재빌드 진행')
}
} catch (e) {
// logger.warn('[skeleton] verifyMoveBoundary 예외 → 기존 흐름 진행:', e)
logger.warn('[skeleton] verifyMoveBoundary 예외 → 기존 흐름 진행:', e)
}
const movedPoints = safeMovedPointsWithFallback(roofId, canvas)
@ -1187,7 +1187,7 @@ export const skeletonBuilder = (roofId, canvas, textMode) => {
const next = changRoofLinePoints[(i + 1) % changRoofLinePoints.length]
const dist = Math.hypot(next.x - curr.x, next.y - curr.y)
if (dist < 0.5) {
// logger.warn(`[SK_WARN] 인접 중복점: [${i}](${Math.round(curr.x)},${Math.round(curr.y)}) ↔ [${(i + 1) % changRoofLinePoints.length}](${Math.round(next.x)},${Math.round(next.y)}) dist=${dist.toFixed(3)}`)
logger.warn(`[SK_WARN] 인접 중복점: [${i}](${Math.round(curr.x)},${Math.round(curr.y)}) ↔ [${(i + 1) % changRoofLinePoints.length}](${Math.round(next.x)},${Math.round(next.y)}) dist=${dist.toFixed(3)}`)
}
}
@ -1198,7 +1198,7 @@ export const skeletonBuilder = (roofId, canvas, textMode) => {
const next = changRoofLinePoints[(i + 1) % changRoofLinePoints.length]
const cross = (curr.x - prev.x) * (next.y - prev.y) - (curr.y - prev.y) * (next.x - prev.x)
if (Math.abs(cross) < 1.0) {
// logger.warn(`[SK_WARN] 일직선 점: [${i}](${Math.round(curr.x)},${Math.round(curr.y)}) cross=${cross.toFixed(3)}`)
logger.warn(`[SK_WARN] 일직선 점: [${i}](${Math.round(curr.x)},${Math.round(curr.y)}) cross=${cross.toFixed(3)}`)
}
}
@ -1363,12 +1363,12 @@ export const skeletonBuilder = (roofId, canvas, textMode) => {
export const drawSkeletonRidgeRoofFromBaseLines = (roofId, canvas, textMode) => {
const roof = canvas?.getObjects().find((o) => o.id === roofId)
if (!roof) {
// logger.warn('[SK_OVER_FN] roof 없음 → 중단')
logger.warn('[SK_OVER_FN] roof 없음 → 중단')
return
}
const wall = canvas.getObjects().find((obj) => obj.name === POLYGON_TYPE.WALL && obj.attributes?.roofId === roofId)
if (!wall || !wall.baseLines?.length) {
// logger.warn('[SK_OVER_FN] wall/baseLines 없음 → 중단')
logger.warn('[SK_OVER_FN] wall/baseLines 없음 → 중단')
return
}
@ -1382,14 +1382,14 @@ export const drawSkeletonRidgeRoofFromBaseLines = (roofId, canvas, textMode) =>
continue
}
if (bl == null || !isFinite(bl.x1) || !isFinite(bl.y1)) {
// logger.warn(`[SK_OVER_FN] baseLines[${i}] invalid coord → skip`)
logger.warn(`[SK_OVER_FN] baseLines[${i}] invalid coord → skip`)
continue
}
rawPoints.push({ x: bl.x1, y: bl.y1 })
}
if (rawPoints.length < 3) {
// logger.warn(`[SK_OVER_FN] 유효 baseLines 끝점 ${rawPoints.length} < 3 → 중단`)
logger.warn(`[SK_OVER_FN] 유효 baseLines 끝점 ${rawPoints.length} < 3 → 중단`)
return
}
@ -1731,8 +1731,8 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode, isOver
const _seen = new Map()
roofLines.forEach((l, i) => {
const k = _keyOfEdge(l)
// if (_seen.has(k)) logger.warn(`[PAIR-DIAG] key collision: idx ${_seen.get(k)} vs ${i} key=${k}`)
// else _seen.set(k, i)
if (_seen.has(k)) logger.warn(`[PAIR-DIAG] key collision: idx ${_seen.get(k)} vs ${i} key=${k}`)
else _seen.set(k, i)
})
roofLines.forEach((rl, i) => {
const wl = wallLines[i]
@ -1826,7 +1826,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode, isOver
const wbL = wallBaseLine[l]
const wL = wallLine[l]
if (Math.abs(wbL - wL) < 0.1) {
// logger.warn(`⚠️ [${condition.toUpperCase()}_${isStart ? 'START' : 'END'}] Line crossing detected! newPoint:`, newPointM, 'pLine:', pLineM)
logger.warn(`⚠️ [${condition.toUpperCase()}_${isStart ? 'START' : 'END'}] Line crossing detected! newPoint:`, newPointM, 'pLine:', pLineM)
if (moveAxis === 'x') {
getAddLine({ x: pLineM, y: pLineL }, { x: newPointM, y: pLineL }, 'green')
getAddLine({ x: newPointM, y: pLineL }, ePoint, 'pink')
@ -3342,7 +3342,7 @@ const calcOverCorrectedPoints = (points, origPoints) => {
// 보정 실패 시(꼭짓점 부족) 원본 반환 → 기존 동작 보장
if (cleaned.length >= 3) return cleaned
if (deduped.length >= 3) return deduped
// logger.warn('[SK_OVER] calcOverCorrectedPoints: 보정 실패 → 원본 반환')
logger.warn('[SK_OVER] calcOverCorrectedPoints: 보정 실패 → 원본 반환')
return points
}
@ -4664,7 +4664,7 @@ const checkPointInPolygon = (point, wall) => {
// 2. wall.baseLines를 이용한 Ray Casting Algorithm
if (!wall.baseLines || !Array.isArray(wall.baseLines)) {
// logger.warn('wall.baseLines가 없습니다');
logger.warn('wall.baseLines가 없습니다');
return false;
}
@ -4963,7 +4963,7 @@ function updateAndAddLine(innerLines, targetPoint) {
}
}
if (!foundLine) {
// logger.warn(`[updateAndAddLine] NOT FOUND position=${targetPoint.position} point=(${targetPoint.x.toFixed(2)},${targetPoint.y.toFixed(2)})`);
logger.warn(`[updateAndAddLine] NOT FOUND position=${targetPoint.position} point=(${targetPoint.x.toFixed(2)},${targetPoint.y.toFixed(2)})`);
return [...innerLines];
}