확장자 1단계마무리
This commit is contained in:
parent
16eb41aab6
commit
2a7c78a927
@ -189,14 +189,7 @@ export const useLine = () => {
|
|||||||
actualSize: calcLineActualSizeByLineLength(lineLength, getDegreeByChon(pitch)),
|
actualSize: calcLineActualSizeByLineLength(lineLength, getDegreeByChon(pitch)),
|
||||||
}
|
}
|
||||||
} else if (isDiagonal) {
|
} else if (isDiagonal) {
|
||||||
// [좌표정수화 비대칭 보정] face direction 무관하게 dx/dy 평균 비율 사용.
|
const yLength = Math.abs(y2 - y1) * 10
|
||||||
// (587,-58)→(931,285) 처럼 좌표 round 로 dx=344, dy=343 비대칭이 생겨도
|
|
||||||
// 같은 라인은 face direction 과 무관하게 같은 actualSize 가 산출된다.
|
|
||||||
const dxRaw = Math.abs(x2 - x1)
|
|
||||||
const dyRaw = Math.abs(y2 - y1)
|
|
||||||
const hypotPx = Math.hypot(dxRaw, dyRaw)
|
|
||||||
const axisAvg = (dxRaw + dyRaw) / 2
|
|
||||||
const yLength = hypotPx > 0 ? lineLength * (axisAvg / hypotPx) : 0
|
|
||||||
|
|
||||||
const h = yLength * Math.tan(getDegreeByChon(pitch) * (Math.PI / 180))
|
const h = yLength * Math.tan(getDegreeByChon(pitch) * (Math.PI / 180))
|
||||||
|
|
||||||
@ -210,12 +203,7 @@ export const useLine = () => {
|
|||||||
actualSize: calcLineActualSizeByLineLength(lineLength, getDegreeByChon(pitch)),
|
actualSize: calcLineActualSizeByLineLength(lineLength, getDegreeByChon(pitch)),
|
||||||
}
|
}
|
||||||
} else if (isDiagonal) {
|
} else if (isDiagonal) {
|
||||||
// [좌표정수화 비대칭 보정] 위와 동일한 평균 axis 사용 → 두 face 일관성 보장
|
const xLength = Math.abs(x2 - x1) * 10
|
||||||
const dxRaw = Math.abs(x2 - x1)
|
|
||||||
const dyRaw = Math.abs(y2 - y1)
|
|
||||||
const hypotPx = Math.hypot(dxRaw, dyRaw)
|
|
||||||
const axisAvg = (dxRaw + dyRaw) / 2
|
|
||||||
const xLength = hypotPx > 0 ? lineLength * (axisAvg / hypotPx) : 0
|
|
||||||
|
|
||||||
const h = xLength * Math.tan(getDegreeByChon(pitch) * (Math.PI / 180))
|
const h = xLength * Math.tan(getDegreeByChon(pitch) * (Math.PI / 180))
|
||||||
|
|
||||||
|
|||||||
@ -89,11 +89,8 @@ export const usePolygon = () => {
|
|||||||
const maxY = line.top + line.length
|
const maxY = line.top + line.length
|
||||||
const degree = (Math.atan2(y2 - y1, x2 - x1) * 180) / Math.PI
|
const degree = (Math.atan2(y2 - y1, x2 - x1) * 180) / Math.PI
|
||||||
|
|
||||||
// [표시 round] 저장값은 0.01 정밀도, 라벨은 정수 표시
|
|
||||||
const text = new fabric.Textbox(
|
const text = new fabric.Textbox(
|
||||||
+roofSizeSet === 1
|
+roofSizeSet === 1 ? (actualSize ? actualSize.toString() : length.toString()) : planeSize ? planeSize.toString() : length.toString(),
|
||||||
? (actualSize ? Math.round(actualSize).toString() : Math.round(length).toString())
|
|
||||||
: planeSize ? Math.round(planeSize).toString() : Math.round(length).toString(),
|
|
||||||
{
|
{
|
||||||
left: left,
|
left: left,
|
||||||
top: top,
|
top: top,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user