오각형 밸리데이션 추가

This commit is contained in:
yjnoh 2024-10-18 14:01:19 +09:00
parent 8152b83b06
commit 4ac1e6ea9a

View File

@ -471,32 +471,28 @@ export function useObjectBatch() {
addCanvasMouseEventListener('mouse:up', (e) => { addCanvasMouseEventListener('mouse:up', (e) => {
if (dormer) { if (dormer) {
// const trianglePolygon = pointsToTurfPolygon(triangleToPolygon(dormer)) const pentagonPolygon = pointsToTurfPolygon(dormer.points)
// const selectedSurfacePolygon = polygonToTurfPolygon(selectedSurface) const selectedSurfacePolygon = polygonToTurfPolygon(selectedSurface)
// //지붕 밖으로 그렸을때 //지붕 밖으로 그렸을때
// if (!turf.booleanWithin(trianglePolygon, selectedSurfacePolygon)) { if (!turf.booleanWithin(pentagonPolygon, selectedSurfacePolygon)) {
// swalFire({ text: '개구를 배치할 수 없습니다.', icon: 'error' }) swalFire({ text: '개구를 배치할 수 없습니다.', icon: 'error' })
// //일단 지워 //일단 지워
// deleteTempObjects() deleteTempObjects()
// return return
// } }
//각도 추가 //각도 추가
let originAngle = 0 //기본 남쪽
let direction = 'south'
let direction = 'south'
if (directionRef === 'left') { if (directionRef === 'left') {
//서 //서
originAngle = 90
direction = 'west' direction = 'west'
} else if (directionRef === 'right') { } else if (directionRef === 'right') {
//동 //동
originAngle = 270
direction = 'east' direction = 'east'
} else if (directionRef === 'up') { } else if (directionRef === 'up') {
//북 //북
originAngle = 180
direction = 'north' direction = 'north'
} }