[big.js] Division by zero - actualSize 가 0이 되어 나누기에 문제가 됨
This commit is contained in:
parent
75312f5ccf
commit
9a2c6adb96
@ -7579,7 +7579,12 @@ export const drawRidgeRoof = (roofId, canvas, textMode) => {
|
|||||||
|
|
||||||
hipBasePoint = { x1: line.x1, y1: line.y1, x2: line.x2, y2: line.y2 }
|
hipBasePoint = { x1: line.x1, y1: line.y1, x2: line.x2, y2: line.y2 }
|
||||||
point = [mergePoint[0].x, mergePoint[0].y, mergePoint[3].x, mergePoint[3].y]
|
point = [mergePoint[0].x, mergePoint[0].y, mergePoint[3].x, mergePoint[3].y]
|
||||||
const theta = Big(Math.acos(Big(line.line.attributes.planeSize).div(line.line.attributes.actualSize)))
|
const theta = Big(Math.acos(Big(line.line.attributes.planeSize).div(
|
||||||
|
line.line.attributes.actualSize === 0 ||
|
||||||
|
line.line.attributes.actualSize === '' ||
|
||||||
|
line.line.attributes.actualSize === undefined ?
|
||||||
|
line.line.attributes.planeSize : line.line.attributes.actualSize
|
||||||
|
)))
|
||||||
.times(180)
|
.times(180)
|
||||||
.div(Math.PI)
|
.div(Math.PI)
|
||||||
.round(1)
|
.round(1)
|
||||||
@ -9223,7 +9228,11 @@ const getSortedPoint = (points, lines) => {
|
|||||||
const reCalculateSize = (line) => {
|
const reCalculateSize = (line) => {
|
||||||
const oldPlaneSize = line.attributes.planeSize
|
const oldPlaneSize = line.attributes.planeSize
|
||||||
const oldActualSize = line.attributes.actualSize
|
const oldActualSize = line.attributes.actualSize
|
||||||
const theta = Big(Math.acos(Big(oldPlaneSize).div(oldActualSize)))
|
const theta = Big(Math.acos(Big(oldPlaneSize).div(
|
||||||
|
oldActualSize === 0 || oldActualSize === '' || oldActualSize === undefined ?
|
||||||
|
oldPlaneSize :
|
||||||
|
oldActualSize
|
||||||
|
)))
|
||||||
.times(180)
|
.times(180)
|
||||||
.div(Math.PI)
|
.div(Math.PI)
|
||||||
const planeSize = calcLinePlaneSize({
|
const planeSize = calcLinePlaneSize({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user