지붕형상설정 편류 지붕 선택 시 방향 추가
This commit is contained in:
parent
b94be836df
commit
7365279bda
@ -170,6 +170,7 @@ export function useRoofShapeSetting(id) {
|
|||||||
//기존 wallLine 삭제
|
//기존 wallLine 삭제
|
||||||
|
|
||||||
let outerLines
|
let outerLines
|
||||||
|
let direction
|
||||||
|
|
||||||
switch (shapeNum) {
|
switch (shapeNum) {
|
||||||
case 1: {
|
case 1: {
|
||||||
@ -196,6 +197,7 @@ export function useRoofShapeSetting(id) {
|
|||||||
// 서쪽
|
// 서쪽
|
||||||
initLineSetting()
|
initLineSetting()
|
||||||
outerLines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
|
outerLines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
|
||||||
|
direction = 'west'
|
||||||
|
|
||||||
outerLines.forEach((line) => {
|
outerLines.forEach((line) => {
|
||||||
setWestAndEastRoof(line)
|
setWestAndEastRoof(line)
|
||||||
@ -240,6 +242,7 @@ export function useRoofShapeSetting(id) {
|
|||||||
case 6: {
|
case 6: {
|
||||||
initLineSetting()
|
initLineSetting()
|
||||||
outerLines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
|
outerLines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
|
||||||
|
direction = 'east'
|
||||||
|
|
||||||
outerLines.forEach((line) => {
|
outerLines.forEach((line) => {
|
||||||
setWestAndEastRoof(line)
|
setWestAndEastRoof(line)
|
||||||
@ -285,6 +288,7 @@ export function useRoofShapeSetting(id) {
|
|||||||
case 7: {
|
case 7: {
|
||||||
initLineSetting()
|
initLineSetting()
|
||||||
outerLines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
|
outerLines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
|
||||||
|
direction = 'south'
|
||||||
|
|
||||||
outerLines.forEach((line) => {
|
outerLines.forEach((line) => {
|
||||||
setSouthAndNorthRoof(line)
|
setSouthAndNorthRoof(line)
|
||||||
@ -329,6 +333,7 @@ export function useRoofShapeSetting(id) {
|
|||||||
case 8: {
|
case 8: {
|
||||||
initLineSetting()
|
initLineSetting()
|
||||||
outerLines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
|
outerLines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
|
||||||
|
direction = 'north'
|
||||||
|
|
||||||
outerLines.forEach((line) => {
|
outerLines.forEach((line) => {
|
||||||
setSouthAndNorthRoof(line)
|
setSouthAndNorthRoof(line)
|
||||||
@ -389,7 +394,7 @@ export function useRoofShapeSetting(id) {
|
|||||||
canvas.remove(obj)
|
canvas.remove(obj)
|
||||||
})
|
})
|
||||||
|
|
||||||
const polygon = addPolygonByLines(outerLines, { name: POLYGON_TYPE.WALL })
|
const polygon = addPolygonByLines(outerLines, { name: POLYGON_TYPE.WALL, direction })
|
||||||
polygon.lines = [...outerLines]
|
polygon.lines = [...outerLines]
|
||||||
|
|
||||||
addPitchTextsByOuterLines()
|
addPitchTextsByOuterLines()
|
||||||
|
|||||||
@ -1746,6 +1746,9 @@ export function useMode() {
|
|||||||
return { x1: point.x, y1: point.y }
|
return { x1: point.x, y1: point.y }
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
if (wall.direction) {
|
||||||
|
roof.direction = wall.direction
|
||||||
|
}
|
||||||
roof.name = POLYGON_TYPE.ROOF
|
roof.name = POLYGON_TYPE.ROOF
|
||||||
roof.setWall(wall)
|
roof.setWall(wall)
|
||||||
|
|
||||||
|
|||||||
@ -1340,6 +1340,7 @@ export const splitPolygonWithLines = (polygon) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const newRoofs = removeDuplicatePolygons(roofs)
|
const newRoofs = removeDuplicatePolygons(roofs)
|
||||||
|
|
||||||
newRoofs.forEach((roofPoint, index) => {
|
newRoofs.forEach((roofPoint, index) => {
|
||||||
let defense, pitch
|
let defense, pitch
|
||||||
const polygonLines = [...polygon.lines]
|
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) {
|
switch (direction) {
|
||||||
case 'top':
|
case 'top':
|
||||||
@ -1406,7 +1408,7 @@ export const splitPolygonWithLines = (polygon) => {
|
|||||||
originY: 'center',
|
originY: 'center',
|
||||||
selectable: true,
|
selectable: true,
|
||||||
defense: defense,
|
defense: defense,
|
||||||
direction: defense,
|
direction: newRoofs.length === 1 ? polygonDirection : defense,
|
||||||
pitch: pitch,
|
pitch: pitch,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user