지붕형상설정 편류 지붕 선택 시 방향 추가

This commit is contained in:
hyojun.choi 2024-11-07 10:52:11 +09:00
parent b94be836df
commit 7365279bda
3 changed files with 13 additions and 3 deletions

View File

@ -170,6 +170,7 @@ export function useRoofShapeSetting(id) {
//기존 wallLine 삭제
let outerLines
let direction
switch (shapeNum) {
case 1: {
@ -196,6 +197,7 @@ export function useRoofShapeSetting(id) {
// 서쪽
initLineSetting()
outerLines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
direction = 'west'
outerLines.forEach((line) => {
setWestAndEastRoof(line)
@ -240,6 +242,7 @@ export function useRoofShapeSetting(id) {
case 6: {
initLineSetting()
outerLines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
direction = 'east'
outerLines.forEach((line) => {
setWestAndEastRoof(line)
@ -285,6 +288,7 @@ export function useRoofShapeSetting(id) {
case 7: {
initLineSetting()
outerLines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
direction = 'south'
outerLines.forEach((line) => {
setSouthAndNorthRoof(line)
@ -329,6 +333,7 @@ export function useRoofShapeSetting(id) {
case 8: {
initLineSetting()
outerLines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
direction = 'north'
outerLines.forEach((line) => {
setSouthAndNorthRoof(line)
@ -389,7 +394,7 @@ export function useRoofShapeSetting(id) {
canvas.remove(obj)
})
const polygon = addPolygonByLines(outerLines, { name: POLYGON_TYPE.WALL })
const polygon = addPolygonByLines(outerLines, { name: POLYGON_TYPE.WALL, direction })
polygon.lines = [...outerLines]
addPitchTextsByOuterLines()

View File

@ -1746,6 +1746,9 @@ export function useMode() {
return { x1: point.x, y1: point.y }
}),
)
if (wall.direction) {
roof.direction = wall.direction
}
roof.name = POLYGON_TYPE.ROOF
roof.setWall(wall)

View File

@ -1340,6 +1340,7 @@ export const splitPolygonWithLines = (polygon) => {
})
const newRoofs = removeDuplicatePolygons(roofs)
newRoofs.forEach((roofPoint, index) => {
let defense, pitch
const polygonLines = [...polygon.lines]
@ -1378,7 +1379,8 @@ export const splitPolygonWithLines = (polygon) => {
}
})
const direction = representLine.direction
const direction = newRoofs.length === 1 ? polygon.direction : representLine.direction
const polygonDirection = polygon.direction
switch (direction) {
case 'top':
@ -1406,7 +1408,7 @@ export const splitPolygonWithLines = (polygon) => {
originY: 'center',
selectable: true,
defense: defense,
direction: defense,
direction: newRoofs.length === 1 ? polygonDirection : defense,
pitch: pitch,
})