object 배치 수정
This commit is contained in:
parent
f30fe6337f
commit
e186ca1774
@ -51,15 +51,12 @@ export default function ObjectSetting({ setShowObjectSettingModal }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const applyObject = () => {
|
const applyObject = () => {
|
||||||
// if (surfaceShapePolygons.length === 0) {
|
if (surfaceShapePolygons.length === 0) {
|
||||||
// swalFire({ text: '지붕이 없어요 지붕부터 그리세요', icon: 'error' })
|
swalFire({ text: '지붕이 없어요 지붕부터 그리세요', icon: 'error' })
|
||||||
// return
|
return
|
||||||
// }
|
}
|
||||||
|
|
||||||
//개구배치, 그림자배치
|
//개구배치, 그림자배치
|
||||||
|
|
||||||
console.log(surfaceShapePolygons)
|
|
||||||
|
|
||||||
if (buttonAct === 1 || buttonAct === 2) {
|
if (buttonAct === 1 || buttonAct === 2) {
|
||||||
applyOpeningAndShadow(objectPlacement, buttonAct, surfaceShapePolygons)
|
applyOpeningAndShadow(objectPlacement, buttonAct, surfaceShapePolygons)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -200,20 +200,34 @@ export function useObjectBatch() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 오브젝트 도머 배치
|
||||||
|
* @param {} dormerPlacement
|
||||||
|
* @param {*} buttonAct
|
||||||
|
* @param {*} surfaceShapePolygons
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
const applyDormers = (dormerPlacement, buttonAct, surfaceShapePolygons) => {
|
const applyDormers = (dormerPlacement, buttonAct, surfaceShapePolygons) => {
|
||||||
const dormerName = buttonAct === 3 ? BATCH_TYPE.TRIANGLE_DORMER : BATCH_TYPE.PENTAGON_DORMER
|
const dormerName = buttonAct === 3 ? BATCH_TYPE.TRIANGLE_DORMER : BATCH_TYPE.PENTAGON_DORMER
|
||||||
const dormerTempName = buttonAct === 3 ? BATCH_TYPE.TRIANGLE_DORMER_TEMP : BATCH_TYPE.PENTAGON_DORMER_TEMP
|
const dormerTempName = buttonAct === 3 ? BATCH_TYPE.TRIANGLE_DORMER_TEMP : BATCH_TYPE.PENTAGON_DORMER_TEMP
|
||||||
const height = dormerPlacement.heightRef.current.value / 10
|
const height = dormerPlacement.heightRef.current !== null ? dormerPlacement.heightRef.current.value / 10 : 0
|
||||||
const width = dormerPlacement.widthRef.current.value / 10
|
const width = dormerPlacement.widthRef.current !== null ? dormerPlacement.widthRef.current.value / 10 : 0 //triangle일때는 없음
|
||||||
const pitch = dormerPlacement.pitchRef.current.value
|
const pitch = dormerPlacement.pitchRef.current !== null ? dormerPlacement.pitchRef.current.value : 0
|
||||||
const offsetRef = dormerPlacement.offsetRef.current.value === '' ? 0 : parseInt(dormerPlacement.offsetRef.current.value) / 10
|
const offsetRef =
|
||||||
const offsetWidthRef = dormerPlacement.offsetWidthRef.current.value === '' ? 0 : parseInt(dormerPlacement.offsetWidthRef.current.value) / 10
|
dormerPlacement.offsetRef.current !== null
|
||||||
|
? dormerPlacement.offsetRef.current.value === ''
|
||||||
|
? 0
|
||||||
|
: parseInt(dormerPlacement.offsetRef.current.value) / 10
|
||||||
|
: 0
|
||||||
|
const offsetWidthRef =
|
||||||
|
dormerPlacement.offsetWidthRef.current !== null
|
||||||
|
? dormerPlacement.offsetWidthRef.current.value === ''
|
||||||
|
? 0
|
||||||
|
: parseInt(dormerPlacement.offsetWidthRef.current.value) / 10
|
||||||
|
: 0
|
||||||
const directionRef = dormerPlacement.directionRef.current
|
const directionRef = dormerPlacement.directionRef.current
|
||||||
|
|
||||||
let dormer, dormerOffset, isDown, selectedSurface, pentagonPoints, pentagonOffsetPoints
|
let dormer, dormerOffset, isDown, selectedSurface, pentagonPoints, pentagonOffsetPoints
|
||||||
|
|
||||||
console.log('dormerPlacement', dormerPlacement)
|
|
||||||
|
|
||||||
if (height === '' || pitch === '' || height <= 0 || pitch <= 0) {
|
if (height === '' || pitch === '' || height <= 0 || pitch <= 0) {
|
||||||
swalFire({ text: getMessage('common.canvas.validate.size'), icon: 'error' })
|
swalFire({ text: getMessage('common.canvas.validate.size'), icon: 'error' })
|
||||||
return
|
return
|
||||||
@ -636,8 +650,6 @@ export function useObjectBatch() {
|
|||||||
const splitDormerPentagon = (pentagon, direction, offsetMode) => {
|
const splitDormerPentagon = (pentagon, direction, offsetMode) => {
|
||||||
const points = pentagon.points
|
const points = pentagon.points
|
||||||
|
|
||||||
console.log(pentagon.points)
|
|
||||||
|
|
||||||
let leftPoints = []
|
let leftPoints = []
|
||||||
let rightPoints = []
|
let rightPoints = []
|
||||||
|
|
||||||
@ -699,8 +711,6 @@ export function useObjectBatch() {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(leftPoints, rightPoints)
|
|
||||||
|
|
||||||
return [leftPoints, rightPoints]
|
return [leftPoints, rightPoints]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user