Compare commits
No commits in common. "5065999f80c2daba12364da4d78f947b572e98bf" and "be4c6ecf657cb8b8c6ee509d3cf9b863e1ab3c77" have entirely different histories.
5065999f80
...
be4c6ecf65
@ -213,7 +213,6 @@ export const SAVE_KEY = [
|
|||||||
'editable',
|
'editable',
|
||||||
'isSortedPoints',
|
'isSortedPoints',
|
||||||
'isMultipleOf45',
|
'isMultipleOf45',
|
||||||
'from',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
export const OBJECT_PROTOTYPE = [fabric.Line.prototype, fabric.Polygon.prototype, fabric.Triangle.prototype, fabric.Group.prototype]
|
export const OBJECT_PROTOTYPE = [fabric.Line.prototype, fabric.Polygon.prototype, fabric.Triangle.prototype, fabric.Group.prototype]
|
||||||
|
|||||||
@ -133,7 +133,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
const offsetObjects = moduleSelectionData.roofConstructions.find((item) => item.addRoof.index === roofIndex)
|
const offsetObjects = moduleSelectionData.roofConstructions.find((item) => item.addRoof.index === roofIndex)
|
||||||
|
|
||||||
roof.lines.forEach((line) => {
|
roof.lines.forEach((line) => {
|
||||||
line.attributes = { ...line.attributes, offset: getOffset(offsetObjects.addRoof, line.attributes.type, roof.pitch, roof.from) }
|
line.attributes = { ...line.attributes, offset: getOffset(offsetObjects.addRoof, line.attributes.type) }
|
||||||
})
|
})
|
||||||
//배치면 설치 영역
|
//배치면 설치 영역
|
||||||
makeModuleInstArea(roof, detail)
|
makeModuleInstArea(roof, detail)
|
||||||
@ -167,45 +167,19 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const getOffset = (data, type, pitch, from = '') => {
|
const getOffset = (data, type) => {
|
||||||
const degree = getDegreeByChon(pitch) //각도
|
|
||||||
|
|
||||||
// 계산 값
|
|
||||||
function calculateExpression(thetaDegrees) {
|
|
||||||
const thetaRadians = (thetaDegrees * Math.PI) / 180 // 각도를 라디안으로 변환
|
|
||||||
const cosTheta = Math.cos(thetaRadians)
|
|
||||||
|
|
||||||
if (cosTheta === 0) {
|
|
||||||
throw new Error('cos(θ) is zero')
|
|
||||||
}
|
|
||||||
|
|
||||||
const numerator = Math.sqrt(1 + Math.pow(1 / cosTheta, 2))
|
|
||||||
const denominator = Math.sqrt(2)
|
|
||||||
|
|
||||||
return numerator / denominator
|
|
||||||
}
|
|
||||||
|
|
||||||
//경사 신장률은 1 / cos쎄타
|
|
||||||
const calculateHeightRate = 1 / Math.cos((degree * Math.PI) / 180)
|
|
||||||
const calculateValue = calculateHeightRate / calculateExpression(degree)
|
|
||||||
|
|
||||||
const eavesResult = from === 'roofCover' ? (data.eavesMargin * Math.cos((degree * Math.PI) / 180)) / 10 : data.eavesMargin / 10
|
|
||||||
const ridgeResult = from === 'roofCover' ? (data.ridgeMargin * Math.cos((degree * Math.PI) / 180)) / 10 : data.ridgeMargin / 10
|
|
||||||
const kerabaMargin = from === 'roofCover' ? data.kerabaMargin / calculateValue / 10 : data.kerabaMargin / 10
|
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case LINE_TYPE.WALLLINE.EAVES:
|
case LINE_TYPE.WALLLINE.EAVES:
|
||||||
return eavesResult
|
return data.eavesMargin / 10
|
||||||
case LINE_TYPE.WALLLINE.GABLE:
|
case LINE_TYPE.WALLLINE.GABLE:
|
||||||
return kerabaMargin
|
return data.kerabaMargin / 10
|
||||||
case LINE_TYPE.SUBLINE.RIDGE:
|
case LINE_TYPE.SUBLINE.RIDGE:
|
||||||
case LINE_TYPE.WALLLINE.SHED:
|
case LINE_TYPE.WALLLINE.SHED:
|
||||||
return ridgeResult
|
return data.ridgeMargin / 10
|
||||||
default:
|
default:
|
||||||
return 200 / 10
|
return 200 / 10
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//선택 배치면 배열`
|
//선택 배치면 배열`
|
||||||
let selectedModuleInstSurfaceArray = []
|
let selectedModuleInstSurfaceArray = []
|
||||||
|
|
||||||
|
|||||||
@ -678,7 +678,8 @@ export function useRoofShapeSetting(id) {
|
|||||||
// 벽
|
// 벽
|
||||||
attributes = {
|
attributes = {
|
||||||
type: LINE_TYPE.WALLLINE.WALL,
|
type: LINE_TYPE.WALLLINE.WALL,
|
||||||
offset: hasSleeve === '0' ? 0 : sleeveOffset / 10,
|
width: hasSleeve === '0' ? 0 : sleeveOffset / 10,
|
||||||
|
sleeve: hasSleeve === '1',
|
||||||
}
|
}
|
||||||
selectedLine.attributes = { ...attributes, isFixed: true }
|
selectedLine.attributes = { ...attributes, isFixed: true }
|
||||||
break
|
break
|
||||||
|
|||||||
@ -1158,7 +1158,6 @@ export const usePolygon = () => {
|
|||||||
originY: 'center',
|
originY: 'center',
|
||||||
selectable: true,
|
selectable: true,
|
||||||
defense: defense,
|
defense: defense,
|
||||||
from: 'roofCover',
|
|
||||||
direction: polygonDirection ?? defense,
|
direction: polygonDirection ?? defense,
|
||||||
pitch: pitch,
|
pitch: pitch,
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user