지붕덮개 계산식 수정
This commit is contained in:
parent
f45862568f
commit
c869d6c44d
@ -7250,11 +7250,12 @@ const drawHipLine = (points, canvas, roof, textMode, currentRoof, prevDegree, cu
|
|||||||
const baseX = Big(points[0]).minus(Big(points[2])).abs()
|
const baseX = Big(points[0]).minus(Big(points[2])).abs()
|
||||||
const baseY = Big(points[1]).minus(Big(points[3])).abs()
|
const baseY = Big(points[1]).minus(Big(points[3])).abs()
|
||||||
if (baseX.gt(1) && baseY.gt(1)) {
|
if (baseX.gt(1) && baseY.gt(1)) {
|
||||||
const base = calcLinePlaneSize({ x1: points[0], y1: points[1], x2: points[2], y2: points[3] }) / 10
|
const hypotenuse = calcLinePlaneSize({ x1: points[0], y1: points[1], x2: points[2], y2: points[3] })
|
||||||
const heightX = baseX.times(Math.tan((currentDegree * Math.PI) / 180)).round()
|
const base = getAdjacent(hypotenuse)
|
||||||
const heightY = baseY.times(Math.tan((prevDegree * Math.PI) / 180)).round()
|
const heightX = base * Math.tan((currentDegree * Math.PI) / 180)
|
||||||
const degreeX = Math.atan(heightX.div(base).toNumber()) / (Math.PI / 180)
|
const heightY = base * Math.tan((prevDegree * Math.PI) / 180)
|
||||||
const degreeY = Math.atan(heightY.div(base).toNumber()) / (Math.PI / 180)
|
const degreeX = Math.atan2(heightX, hypotenuse) * (180 / Math.PI)
|
||||||
|
const degreeY = Math.atan2(heightY, hypotenuse) * (180 / Math.PI)
|
||||||
if (Math.abs(degreeX - degreeY) < 1) {
|
if (Math.abs(degreeX - degreeY) < 1) {
|
||||||
currentDegree = degreeX
|
currentDegree = degreeX
|
||||||
prevDegree = degreeY
|
prevDegree = degreeY
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user