배치면의 경우 실제 길이 계산 시 통일 제거, 모듈 설치 시 영역 검사 spare 엄격하게 적용 #642

Merged
ysCha merged 1 commits from dev into prd-deploy 2026-02-04 11:40:09 +09:00
5 changed files with 31 additions and 22 deletions
Showing only changes of commit 9f0044fe67 - Show all commits

View File

@ -8,7 +8,7 @@ export const useTurf = () => {
* @param spare * @param spare
* @returns * @returns
*/ */
const checkModuleDisjointSurface = (module, surface, spare = 1) => { const checkModuleDisjointSurface = (module, surface, spare = 0) => {
// 표면 영역을 spare만큼 수동 확장 // 표면 영역을 spare만큼 수동 확장
const expandedSurface = { const expandedSurface = {
type: 'Polygon', type: 'Polygon',

View File

@ -2229,7 +2229,7 @@ export function useModuleBasicSetting(tabNum) {
//첫번재 모듈 설치 후 두번째 모듈을 몇개까지 설치 할 수 있는지 계산 //첫번재 모듈 설치 후 두번째 모듈을 몇개까지 설치 할 수 있는지 계산
if (installedModuleHeightCount > 0) { if (installedModuleHeightCount > 0) {
// moduleMaxRows = totalModuleMaxRows - installedModuleHeightCount //두번째 모듈일때 // moduleMaxRows = totalModuleMaxRows - installedModuleHeightCount //두번째 모듈일때
isChidoriLine = installedModuleHeightCount % 2 != 0 ? true : false //첫번째에서 짝수에서 끝났으면 홀수는 치도리가 아님 짝수는 치도리 isChidoriLine = installedModuleHeightCount % 2 !== 0 //첫번째에서 짝수에서 끝났으면 홀수는 치도리가 아님 짝수는 치도리
} }
for (let i = 0; i < calcModuleHeightCount; i++) { for (let i = 0; i < calcModuleHeightCount; i++) {
@ -2249,7 +2249,7 @@ export function useModuleBasicSetting(tabNum) {
widthMargin = j === 0 ? 0 : intvHor * j // 가로 마진값 widthMargin = j === 0 ? 0 : intvHor * j // 가로 마진값
chidoriLength = 0 //치도리가 아니여도 기본값을 5정도 준다 chidoriLength = 0 //치도리가 아니여도 기본값을 5정도 준다
if (isChidori) { if (isChidori) {
chidoriLength = installedModuleHeightCount % 2 == 0 ? 0 : width / 2 - intvHor chidoriLength = installedModuleHeightCount % 2 === 0 ? 0 : width / 2 - intvHor
} }
//치도리 일때 는 짝수(1 기준) 일때만 치도리 라인으로 본다 //치도리 일때 는 짝수(1 기준) 일때만 치도리 라인으로 본다

View File

@ -241,6 +241,7 @@ export function usePlacementShapeDrawing(id) {
originY: 'center', originY: 'center',
direction: 'south', direction: 'south',
pitch: globalPitch, pitch: globalPitch,
from: 'surface',
}) })
setSurfaceShapePattern(roof, roofDisplay.column) setSurfaceShapePattern(roof, roofDisplay.column)

View File

@ -1045,6 +1045,7 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) {
newPolygon.set({ newPolygon.set({
originWidth: width, originWidth: width,
originHeight: height, originHeight: height,
from: 'surface',
}) })
// 캔버스에 추가 // 캔버스에 추가

View File

@ -1950,6 +1950,12 @@ export const usePolygon = () => {
return return
} }
// 배치면으로 그린 내용은 업데이트를 해준다.
if (polygon.from === 'surface') {
forceUpdate = true
}
if (polygon.from !== 'surface') {
// createdRoofs들의 모든 lines를 확인해서 length값이 1이하인 차이가 있으면 통일 시킨다. // createdRoofs들의 모든 lines를 확인해서 length값이 1이하인 차이가 있으면 통일 시킨다.
const allRoofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF) const allRoofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
const allRoofLines = allRoofs.flatMap((roof) => roof.lines) const allRoofLines = allRoofs.flatMap((roof) => roof.lines)
@ -1972,6 +1978,7 @@ export const usePolygon = () => {
} }
} }
} }
}
polygon.lines.forEach((line, index) => { polygon.lines.forEach((line, index) => {
if (line.attributes.isCalculated && !forceUpdate) { if (line.attributes.isCalculated && !forceUpdate) {