1156 : 【HANASYS DESIGN】伏図入力と実測値入力の2種類で屋根を作成した時、寸法の整合性が取れない
지붕덮개, 배치면에 따라 모듈 크기 바뀌어야함
This commit is contained in:
parent
be881b656f
commit
c4c773f929
@ -199,9 +199,9 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
const calculateHeightRate = 1 / Math.cos((degree * Math.PI) / 180)
|
const calculateHeightRate = 1 / Math.cos((degree * Math.PI) / 180)
|
||||||
const calculateValue = calculateHeightRate / calculateExpression(degree)
|
const calculateValue = calculateHeightRate / calculateExpression(degree)
|
||||||
|
|
||||||
const eavesResult = +roofSizeSet === 1 ? (data.eavesMargin * Math.cos((degree * Math.PI) / 180)) / 10 : data.eavesMargin / 10
|
const eavesResult = from === 'roofCover' ? (data.eavesMargin * Math.cos((degree * Math.PI) / 180)) / 10 : data.eavesMargin / 10
|
||||||
const ridgeResult = +roofSizeSet === 1 ? (data.ridgeMargin * Math.cos((degree * Math.PI) / 180)) / 10 : data.ridgeMargin / 10
|
const ridgeResult = from === 'roofCover' ? (data.ridgeMargin * Math.cos((degree * Math.PI) / 180)) / 10 : data.ridgeMargin / 10
|
||||||
const kerabaMargin = +roofSizeSet === 1 && isDiagonal ? data.kerabaMargin / calculateValue / 10 : data.kerabaMargin / 10
|
const kerabaMargin = from === 'roofCover' && isDiagonal ? data.kerabaMargin / calculateValue / 10 : data.kerabaMargin / 10
|
||||||
|
|
||||||
switch (line.attributes.type) {
|
switch (line.attributes.type) {
|
||||||
case LINE_TYPE.WALLLINE.EAVES:
|
case LINE_TYPE.WALLLINE.EAVES:
|
||||||
@ -359,6 +359,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
perPixelTargetFind: true,
|
perPixelTargetFind: true,
|
||||||
isSaleStoreNorthFlg: moduleSelectionData.common.saleStoreNorthFlg == '1' ? true : false, //북면설치가능점 여부
|
isSaleStoreNorthFlg: moduleSelectionData.common.saleStoreNorthFlg == '1' ? true : false, //북면설치가능점 여부
|
||||||
// angle: -compasDeg,
|
// angle: -compasDeg,
|
||||||
|
from: roof.from ?? '',
|
||||||
})
|
})
|
||||||
|
|
||||||
setupSurface.setViewLengthText(false)
|
setupSurface.setViewLengthText(false)
|
||||||
@ -532,6 +533,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
|
|
||||||
for (let i = 0; i < moduleSetupSurfaces.length; i++) {
|
for (let i = 0; i < moduleSetupSurfaces.length; i++) {
|
||||||
//배치면이 여러개 일때 옮겨가면서 동작해야함
|
//배치면이 여러개 일때 옮겨가면서 동작해야함
|
||||||
|
const moduleSetupSurface = moduleSetupSurfaces[i]
|
||||||
turfPolygon = polygonToTurfPolygon(moduleSetupSurfaces[i])
|
turfPolygon = polygonToTurfPolygon(moduleSetupSurfaces[i])
|
||||||
trestlePolygon = moduleSetupSurfaces[i]
|
trestlePolygon = moduleSetupSurfaces[i]
|
||||||
manualDrawModules = moduleSetupSurfaces[i].modules // 앞에서 자동으로 했을때 추가됨
|
manualDrawModules = moduleSetupSurfaces[i].modules // 앞에서 자동으로 했을때 추가됨
|
||||||
@ -543,7 +545,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
let tmpHeight = flowDirection === 'south' || flowDirection === 'north' ? moduleHeight : moduleWidth
|
let tmpHeight = flowDirection === 'south' || flowDirection === 'north' ? moduleHeight : moduleWidth
|
||||||
|
|
||||||
let { width, height } =
|
let { width, height } =
|
||||||
canvasSetting.roofSizeSet == '1'
|
moduleSetupSurface.from === 'roofCover'
|
||||||
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurfaces[i].roofMaterial.pitch), flowDirection)
|
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurfaces[i].roofMaterial.pitch), flowDirection)
|
||||||
: { width: tmpWidth, height: tmpHeight }
|
: { width: tmpWidth, height: tmpHeight }
|
||||||
|
|
||||||
@ -923,6 +925,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//단 열수 지정배치
|
||||||
const manualModuleLayoutSetup = (layoutSetupRef) => {
|
const manualModuleLayoutSetup = (layoutSetupRef) => {
|
||||||
const moduleSetupSurfaces = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE) //모듈설치면를 가져옴
|
const moduleSetupSurfaces = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE) //모듈설치면를 가져옴
|
||||||
|
|
||||||
@ -1023,6 +1026,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
|
|
||||||
for (let i = 0; i < moduleSetupSurfaces.length; i++) {
|
for (let i = 0; i < moduleSetupSurfaces.length; i++) {
|
||||||
//배치면이 여러개 일때 옮겨가면서 동작해야함
|
//배치면이 여러개 일때 옮겨가면서 동작해야함
|
||||||
|
const moduleSetupSurface = moduleSetupSurfaces[i]
|
||||||
turfPolygon = polygonToTurfPolygon(moduleSetupSurfaces[i])
|
turfPolygon = polygonToTurfPolygon(moduleSetupSurfaces[i])
|
||||||
trestlePolygon = moduleSetupSurfaces[i]
|
trestlePolygon = moduleSetupSurfaces[i]
|
||||||
manualDrawModules = moduleSetupSurfaces[i].modules // 앞에서 자동으로 했을때 추가됨
|
manualDrawModules = moduleSetupSurfaces[i].modules // 앞에서 자동으로 했을때 추가됨
|
||||||
@ -1036,11 +1040,11 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
let tmpHeight = flowDirection === 'south' || flowDirection === 'north' ? moduleHeight : moduleWidth
|
let tmpHeight = flowDirection === 'south' || flowDirection === 'north' ? moduleHeight : moduleWidth
|
||||||
|
|
||||||
width =
|
width =
|
||||||
canvasSetting.roofSizeSet == '1'
|
moduleSetupSurface.from === 'roofCover'
|
||||||
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurfaces[i].roofMaterial.pitch), flowDirection).width
|
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurfaces[i].roofMaterial.pitch), flowDirection).width
|
||||||
: tmpWidth
|
: tmpWidth
|
||||||
height =
|
height =
|
||||||
canvasSetting.roofSizeSet == '1'
|
moduleSetupSurface.from === 'roofCover'
|
||||||
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurfaces[i].roofMaterial.pitch), flowDirection).height
|
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurfaces[i].roofMaterial.pitch), flowDirection).height
|
||||||
: tmpHeight
|
: tmpHeight
|
||||||
|
|
||||||
@ -1363,11 +1367,11 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
|
|
||||||
//복시도, 실치수에 따른 모듈 높이 조정
|
//복시도, 실치수에 따른 모듈 높이 조정
|
||||||
width =
|
width =
|
||||||
canvasSetting.roofSizeSet == '1'
|
trestlePolygon.from === 'roofCover'
|
||||||
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(trestlePolygon.roofMaterial.pitch), flowDirection).width
|
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(trestlePolygon.roofMaterial.pitch), flowDirection).width
|
||||||
: tmpWidth
|
: tmpWidth
|
||||||
height =
|
height =
|
||||||
canvasSetting.roofSizeSet == '1'
|
trestlePolygon.from === 'roofCover'
|
||||||
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(trestlePolygon.roofMaterial.pitch), flowDirection).height
|
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(trestlePolygon.roofMaterial.pitch), flowDirection).height
|
||||||
: tmpHeight
|
: tmpHeight
|
||||||
|
|
||||||
@ -3230,6 +3234,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
const mousePoint = canvas.getPointer(e.e)
|
const mousePoint = canvas.getPointer(e.e)
|
||||||
|
|
||||||
for (let i = 0; i < moduleSetupSurfaces.length; i++) {
|
for (let i = 0; i < moduleSetupSurfaces.length; i++) {
|
||||||
|
const moduleSetupSurface = moduleSetupSurfaces[i]
|
||||||
turfPolygon = polygonToTurfPolygon(moduleSetupSurfaces[i], true)
|
turfPolygon = polygonToTurfPolygon(moduleSetupSurfaces[i], true)
|
||||||
trestlePolygon = moduleSetupSurfaces[i]
|
trestlePolygon = moduleSetupSurfaces[i]
|
||||||
manualDrawModules = moduleSetupSurfaces[i].modules // 앞에서 자동으로 했을때 추가됨
|
manualDrawModules = moduleSetupSurfaces[i].modules // 앞에서 자동으로 했을때 추가됨
|
||||||
@ -3242,7 +3247,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
let tmpHeight = flowDirection === 'south' || flowDirection === 'north' ? moduleHeight : moduleWidth
|
let tmpHeight = flowDirection === 'south' || flowDirection === 'north' ? moduleHeight : moduleWidth
|
||||||
|
|
||||||
let { width, height } =
|
let { width, height } =
|
||||||
canvasSetting.roofSizeSet == '1'
|
moduleSetupSurface.from === 'roofCover'
|
||||||
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurfaces[i].roofMaterial.pitch), flowDirection)
|
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurfaces[i].roofMaterial.pitch), flowDirection)
|
||||||
: { width: tmpWidth, height: tmpHeight }
|
: { width: tmpWidth, height: tmpHeight }
|
||||||
|
|
||||||
@ -3960,7 +3965,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
10
|
10
|
||||||
}
|
}
|
||||||
|
|
||||||
return canvasSetting.roofSizeSet == '1'
|
return moduleSetupSurface.from === 'roofCover'
|
||||||
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurface.roofMaterial.pitch), moduleSetupSurface.direction)
|
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurface.roofMaterial.pitch), moduleSetupSurface.direction)
|
||||||
: { width: tmpWidth, height: tmpHeight }
|
: { width: tmpWidth, height: tmpHeight }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1156,12 +1156,12 @@ export const useTrestle = () => {
|
|||||||
case 'south': {
|
case 'south': {
|
||||||
rackInfos.forEach((rackInfo) => {
|
rackInfos.forEach((rackInfo) => {
|
||||||
const { rackLen, itemId, supFitQty, supFitIntvlPct, rackRowsCd, smartRack, smartRackYn } = rackInfo
|
const { rackLen, itemId, supFitQty, supFitIntvlPct, rackRowsCd, smartRack, smartRackYn } = rackInfo
|
||||||
let rackLength = getTrestleLength(rackLen, degree) / 10
|
let rackLength = getTrestleLength(rackLen, degree, surface) / 10
|
||||||
|
|
||||||
if (smartRackYn === 'Y') {
|
if (smartRackYn === 'Y') {
|
||||||
let smartRackId = uuidv4()
|
let smartRackId = uuidv4()
|
||||||
smartRack.forEach(({ seq, setRackTpCd, setRackTpLen, supFitQty }) => {
|
smartRack.forEach(({ seq, setRackTpCd, setRackTpLen, supFitQty }) => {
|
||||||
rackLength = getTrestleLength(setRackTpLen, degree) / 10
|
rackLength = getTrestleLength(setRackTpLen, degree, surface) / 10
|
||||||
if (setRackTpCd === 'RACK') {
|
if (setRackTpCd === 'RACK') {
|
||||||
const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY - rackLength], {
|
const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY - rackLength], {
|
||||||
name: TRESTLE_MATERIAL.SMART_RACK,
|
name: TRESTLE_MATERIAL.SMART_RACK,
|
||||||
@ -1230,11 +1230,11 @@ export const useTrestle = () => {
|
|||||||
rackInfos.forEach((rackInfo) => {
|
rackInfos.forEach((rackInfo) => {
|
||||||
const { rackLen, itemId, supFitQty, supFitIntvlPct, rackRowsCd, smartRack, smartRackYn } = rackInfo
|
const { rackLen, itemId, supFitQty, supFitIntvlPct, rackRowsCd, smartRack, smartRackYn } = rackInfo
|
||||||
|
|
||||||
let rackLength = getTrestleLength(rackLen, degree) / 10
|
let rackLength = getTrestleLength(rackLen, degree, surface) / 10
|
||||||
if (smartRackYn === 'Y') {
|
if (smartRackYn === 'Y') {
|
||||||
let smartRackId = uuidv4()
|
let smartRackId = uuidv4()
|
||||||
smartRack.forEach(({ seq, setRackTpCd, setRackTpLen, supFitQty }) => {
|
smartRack.forEach(({ seq, setRackTpCd, setRackTpLen, supFitQty }) => {
|
||||||
rackLength = getTrestleLength(setRackTpLen, degree) / 10
|
rackLength = getTrestleLength(setRackTpLen, degree, surface) / 10
|
||||||
if (setRackTpCd === 'RACK') {
|
if (setRackTpCd === 'RACK') {
|
||||||
const rack = new fabric.Line([startPointX, startPointY, startPointX - rackLength, startPointY], {
|
const rack = new fabric.Line([startPointX, startPointY, startPointX - rackLength, startPointY], {
|
||||||
name: TRESTLE_MATERIAL.SMART_RACK,
|
name: TRESTLE_MATERIAL.SMART_RACK,
|
||||||
@ -1302,11 +1302,11 @@ export const useTrestle = () => {
|
|||||||
case 'west': {
|
case 'west': {
|
||||||
rackInfos.forEach((rackInfo) => {
|
rackInfos.forEach((rackInfo) => {
|
||||||
const { rackLen, itemId, supFitQty, supFitIntvlPct, rackRowsCd, smartRack, smartRackYn } = rackInfo
|
const { rackLen, itemId, supFitQty, supFitIntvlPct, rackRowsCd, smartRack, smartRackYn } = rackInfo
|
||||||
let rackLength = getTrestleLength(rackLen, degree) / 10
|
let rackLength = getTrestleLength(rackLen, degree, surface) / 10
|
||||||
if (smartRackYn === 'Y') {
|
if (smartRackYn === 'Y') {
|
||||||
let smartRackId = uuidv4()
|
let smartRackId = uuidv4()
|
||||||
smartRack.forEach(({ seq, setRackTpCd, setRackTpLen, supFitQty }) => {
|
smartRack.forEach(({ seq, setRackTpCd, setRackTpLen, supFitQty }) => {
|
||||||
rackLength = getTrestleLength(setRackTpLen, degree) / 10
|
rackLength = getTrestleLength(setRackTpLen, degree, surface) / 10
|
||||||
if (setRackTpCd === 'RACK') {
|
if (setRackTpCd === 'RACK') {
|
||||||
const rack = new fabric.Line([startPointX, startPointY, startPointX + rackLength, startPointY], {
|
const rack = new fabric.Line([startPointX, startPointY, startPointX + rackLength, startPointY], {
|
||||||
name: TRESTLE_MATERIAL.SMART_RACK,
|
name: TRESTLE_MATERIAL.SMART_RACK,
|
||||||
@ -1372,11 +1372,11 @@ export const useTrestle = () => {
|
|||||||
case 'north': {
|
case 'north': {
|
||||||
rackInfos.forEach((rackInfo) => {
|
rackInfos.forEach((rackInfo) => {
|
||||||
const { rackLen, itemId, supFitQty, supFitIntvlPct, rackRowsCd, smartRack, smartRackYn } = rackInfo
|
const { rackLen, itemId, supFitQty, supFitIntvlPct, rackRowsCd, smartRack, smartRackYn } = rackInfo
|
||||||
let rackLength = getTrestleLength(rackLen, degree) / 10
|
let rackLength = getTrestleLength(rackLen, degree, surface) / 10
|
||||||
if (smartRackYn === 'Y') {
|
if (smartRackYn === 'Y') {
|
||||||
let smartRackId = uuidv4()
|
let smartRackId = uuidv4()
|
||||||
smartRack.forEach(({ seq, setRackTpCd, setRackTpLen, supFitQty }) => {
|
smartRack.forEach(({ seq, setRackTpCd, setRackTpLen, supFitQty }) => {
|
||||||
rackLength = getTrestleLength(setRackTpLen, degree) / 10
|
rackLength = getTrestleLength(setRackTpLen, degree, surface) / 10
|
||||||
if (setRackTpCd === 'RACK') {
|
if (setRackTpCd === 'RACK') {
|
||||||
const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY + rackLength], {
|
const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY + rackLength], {
|
||||||
name: TRESTLE_MATERIAL.SMART_RACK,
|
name: TRESTLE_MATERIAL.SMART_RACK,
|
||||||
@ -2478,9 +2478,9 @@ export const useTrestle = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 각도에 따른 길이 반환
|
// 각도에 따른 길이 반환
|
||||||
function getTrestleLength(length, degree) {
|
function getTrestleLength(length, degree, surface) {
|
||||||
if (+roofSizeSet !== 1) {
|
if (surface.from !== 'roofCover') {
|
||||||
// 복시도 입력이 아닌경우 그냥 길이 return
|
// 지붕덮개로부터 온게 아니면 그냥 length 리턴
|
||||||
return length
|
return length
|
||||||
}
|
}
|
||||||
const radians = (degree * Math.PI) / 180
|
const radians = (degree * Math.PI) / 180
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user