From eb48e11a5d693c0a0196d96d315d00173bda98f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Mon, 24 Feb 2025 10:11:50 +0900 Subject: [PATCH] =?UTF-8?q?-=20surface=20=EC=83=9D=EC=84=B1=20=EC=8B=9C=20?= =?UTF-8?q?padding=20/=20margin=20polygon=20=EA=B2=80=EC=A6=9D=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/module/useModuleBasicSetting.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js index c5ef9667..53b03c01 100644 --- a/src/hooks/module/useModuleBasicSetting.js +++ b/src/hooks/module/useModuleBasicSetting.js @@ -171,7 +171,7 @@ export function useModuleBasicSetting(tabNum) { case LINE_TYPE.SUBLINE.RIDGE: return data.ridgeIntvl / 10 default: - return 60 + return 60 / 10 } } //선택 배치면 배열` @@ -241,13 +241,23 @@ export function useModuleBasicSetting(tabNum) { } else { let offsetLength = canvasSetting.roofSizeSet === '3' ? -30 : (trestleDetail.eaveIntvl / 10) * -1 setSurfaceShapePattern(roof, roofDisplay.column, true, roof.roofMaterial) //패턴 변경 + // let offsetPoints = createPaddingPolygon(createRoofPolygon(roof.points), roof.lines).vertices //안쪽 offset let offsetPoints = null + console.log(roof, roof.getCurrentPoints()) + const polygon = createRoofPolygon(roof.getCurrentPoints()) + const originPolygon = new QPolygon(roof.getCurrentPoints(), { fontSize: 0 }) - if (['south', 'west'].includes(roof.direction)) { - offsetPoints = createPaddingPolygon(createRoofPolygon(roof.getCurrentPoints()), roof.lines).vertices //안쪽 offset + let result = createPaddingPolygon(polygon, roof.lines).vertices + + //margin polygon 의 point가 기준 polygon의 밖에 있는지 판단한다. + const allPointsOutside = result.every((point) => !originPolygon.inPolygon(point)) + + if (allPointsOutside) { + offsetPoints = createMarginPolygon(polygon, roof.lines).vertices } else { - offsetPoints = createMarginPolygon(createRoofPolygon(roof.getCurrentPoints()), roof.lines).vertices //안쪽 offset + offsetPoints = createPaddingPolygon(polygon, roof.lines).vertices } + //모듈설치영역?? 생성 const surfaceId = uuidv4()