diff --git a/src/util/skeleton-utils.js b/src/util/skeleton-utils.js index ca4eb76d..55699734 100644 --- a/src/util/skeleton-utils.js +++ b/src/util/skeleton-utils.js @@ -440,8 +440,8 @@ export const skeletonBuilder = (roofId, canvas, textMode) => { */ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => { if (!skeleton?.Edges) return [] - let roof = canvas?.getObjects().find((object) => object.id === roofId) - let wall = canvas.getObjects().find((obj) => obj.name === POLYGON_TYPE.WALL && obj.attributes.roofId === roofId) + const roof = canvas?.getObjects().find((object) => object.id === roofId) + const wall = canvas.getObjects().find((obj) => obj.name === POLYGON_TYPE.WALL && obj.attributes.roofId === roofId) let skeletonLines = [] let findPoints = []; @@ -766,6 +766,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => { }); }; + console.log("wallBaseLines", wall.baseLines) // const sortedWallLines = sortCurrentRoofLines(wall.lines); // roofLines의 방향에 맞춰 currentRoofLines 조정 후 정렬 const alignedCurrentRoofLines = alignLineDirection(currentRoofLines, roofLines); @@ -784,16 +785,19 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => { //wall.baseLine은 움직인라인 const movedLines = [] - - wallLines.forEach((wallLine, index) => { + // 조건에 맞는 라인들만 필터링 + const validWallLines = wallLines.filter((wallLine, index) => wallLine.idx - 1 === index); - // const roofLine = sortedRoofLines[index]; - // const currentRoofLine = sortedCurrentRoofLines[index]; - // const moveLine = sortedWallBaseLines[index] - // const wallBaseLine = sortedWallBaseLines[index] + validWallLines.forEach((wallLine, index) => { - const roofLine = sortRoofLines[index]; + const originalIndex = wallLines.indexOf(wallLine); + const roofLine = sortRoofLines[originalIndex]; + const currentRoofLine = currentRoofLines[originalIndex]; + const moveLine = wall.baseLines[originalIndex]; + const wallBaseLine = wall.baseLines[originalIndex]; + + // const roofLine = sortRoofLines[index]; if(roofLine.attributes.wallLine !== wallLine.id || (roofLine.idx - 1) !== index ){ console.log("wallLine2::::", wallLine.id) @@ -804,9 +808,9 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => { return false }//roofLines.find(line => line.attributes.wallLineId === wallLine.attributes.wallId); - const currentRoofLine = currentRoofLines[index]; - const moveLine = wall.baseLines[index] - const wallBaseLine = wall.baseLines[index] + // const currentRoofLine = currentRoofLines[index]; + // const moveLine = wall.baseLines[index] + // const wallBaseLine = wall.baseLines[index] //console.log("wallBaseLine", wallBaseLine); //roofline 외곽선 설정