Merge branch 'feature/jaeyoung' into dev
This commit is contained in:
commit
51bbe46eb1
@ -1679,7 +1679,10 @@ export function useMode() {
|
|||||||
const offsetEdges = []
|
const offsetEdges = []
|
||||||
|
|
||||||
polygon.edges.forEach((edge, i) => {
|
polygon.edges.forEach((edge, i) => {
|
||||||
const offset = lines[i % lines.length].attributes.offset === 0 ? 0.1 : lines[i % lines.length].attributes.offset
|
const offset =
|
||||||
|
lines[i % lines.length].attributes.offset === undefined || lines[i % lines.length].attributes.offset === 0
|
||||||
|
? 0.1
|
||||||
|
: lines[i % lines.length].attributes.offset
|
||||||
const dx = edge.outwardNormal.x * offset
|
const dx = edge.outwardNormal.x * offset
|
||||||
const dy = edge.outwardNormal.y * offset
|
const dy = edge.outwardNormal.y * offset
|
||||||
offsetEdges.push(createOffsetEdge(edge, dx, dy))
|
offsetEdges.push(createOffsetEdge(edge, dx, dy))
|
||||||
@ -1714,7 +1717,10 @@ export function useMode() {
|
|||||||
const offsetEdges = []
|
const offsetEdges = []
|
||||||
|
|
||||||
polygon.edges.forEach((edge, i) => {
|
polygon.edges.forEach((edge, i) => {
|
||||||
const offset = lines[i % lines.length].attributes.offset === 0 ? 1 : lines[i % lines.length].attributes.offset
|
const offset =
|
||||||
|
lines[i % lines.length].attributes.offset === undefined || lines[i % lines.length].attributes.offset === 0
|
||||||
|
? 0.1
|
||||||
|
: lines[i % lines.length].attributes.offset
|
||||||
const dx = edge.inwardNormal.x * offset
|
const dx = edge.inwardNormal.x * offset
|
||||||
const dy = edge.inwardNormal.y * offset
|
const dy = edge.inwardNormal.y * offset
|
||||||
offsetEdges.push(createOffsetEdge(edge, dx, dy))
|
offsetEdges.push(createOffsetEdge(edge, dx, dy))
|
||||||
|
|||||||
@ -2257,8 +2257,7 @@ const changeHipAndGableRoof = (currentRoof, canvas, textMode) => {
|
|||||||
ridge.attributes.actualSize = calcLinePlaneSize({ x1: ridge.x1, y1: ridge.y1, x2: ridge.x2, y2: ridge.y2 })
|
ridge.attributes.actualSize = calcLinePlaneSize({ x1: ridge.x1, y1: ridge.y1, x2: ridge.x2, y2: ridge.y2 })
|
||||||
}
|
}
|
||||||
|
|
||||||
const prevDegree = prevRoof.attributes.pitch > 0 ? getDegreeByChon(prevRoof.attributes.pitch) : prevRoof.attributes.degree
|
const currentDegree = currentRoof.attributes.pitch > 0 ? getDegreeByChon(currentRoof.attributes.pitch) : currentRoof.attributes.degree
|
||||||
const nextDegree = nextRoof.attributes.pitch > 0 ? getDegreeByChon(nextRoof.attributes.pitch) : nextRoof.attributes.degree
|
|
||||||
|
|
||||||
const hip1 = new QLine([currentRoof.x1, currentRoof.y1, midX.plus(hipX2).toNumber(), midY.plus(hipY2).toNumber()], {
|
const hip1 = new QLine([currentRoof.x1, currentRoof.y1, midX.plus(hipX2).toNumber(), midY.plus(hipY2).toNumber()], {
|
||||||
parentId: roof.id,
|
parentId: roof.id,
|
||||||
@ -2283,7 +2282,7 @@ const changeHipAndGableRoof = (currentRoof, canvas, textMode) => {
|
|||||||
x2: midX.plus(hipX2).toNumber(),
|
x2: midX.plus(hipX2).toNumber(),
|
||||||
y2: midY.plus(hipY2).toNumber(),
|
y2: midY.plus(hipY2).toNumber(),
|
||||||
},
|
},
|
||||||
prevDegree,
|
currentDegree,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -2318,7 +2317,7 @@ const changeHipAndGableRoof = (currentRoof, canvas, textMode) => {
|
|||||||
x2: midX.plus(hipX2).toNumber(),
|
x2: midX.plus(hipX2).toNumber(),
|
||||||
y2: midY.plus(hipY2).toNumber(),
|
y2: midY.plus(hipY2).toNumber(),
|
||||||
},
|
},
|
||||||
nextDegree,
|
currentDegree,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -2345,7 +2344,6 @@ const changeHipAndGableRoof = (currentRoof, canvas, textMode) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
hipLines.forEach((hip, i) => {
|
hipLines.forEach((hip, i) => {
|
||||||
const gableDegree = i === 0 ? prevDegree : nextDegree
|
|
||||||
const gableLine = new QLine([hip.x2, hip.y2, currentRoof.attributes.ridgeCoordinate.x1, currentRoof.attributes.ridgeCoordinate.y1], {
|
const gableLine = new QLine([hip.x2, hip.y2, currentRoof.attributes.ridgeCoordinate.x1, currentRoof.attributes.ridgeCoordinate.y1], {
|
||||||
parentId: roof.id,
|
parentId: roof.id,
|
||||||
fontSize: roof.fontSize,
|
fontSize: roof.fontSize,
|
||||||
@ -2369,7 +2367,7 @@ const changeHipAndGableRoof = (currentRoof, canvas, textMode) => {
|
|||||||
x2: currentRoof.attributes.ridgeCoordinate.x1,
|
x2: currentRoof.attributes.ridgeCoordinate.x1,
|
||||||
y2: currentRoof.attributes.ridgeCoordinate.y1,
|
y2: currentRoof.attributes.ridgeCoordinate.y1,
|
||||||
},
|
},
|
||||||
gableDegree,
|
currentDegree,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -3433,7 +3431,10 @@ function createRoofMarginPolygon(polygon, lines, arcSegments = 0) {
|
|||||||
const offsetEdges = []
|
const offsetEdges = []
|
||||||
|
|
||||||
polygon.edges.forEach((edge, i) => {
|
polygon.edges.forEach((edge, i) => {
|
||||||
const offset = lines[i % lines.length].attributes.offset
|
const offset =
|
||||||
|
lines[i % lines.length].attributes.offset === undefined || lines[i % lines.length].attributes.offset === 0
|
||||||
|
? 0.1
|
||||||
|
: lines[i % lines.length].attributes.offset
|
||||||
const dx = edge.outwardNormal.x * offset
|
const dx = edge.outwardNormal.x * offset
|
||||||
const dy = edge.outwardNormal.y * offset
|
const dy = edge.outwardNormal.y * offset
|
||||||
offsetEdges.push(createOffsetEdge(edge, dx, dy))
|
offsetEdges.push(createOffsetEdge(edge, dx, dy))
|
||||||
@ -3461,7 +3462,10 @@ function createRoofPaddingPolygon(polygon, lines, arcSegments = 0) {
|
|||||||
const offsetEdges = []
|
const offsetEdges = []
|
||||||
|
|
||||||
polygon.edges.forEach((edge, i) => {
|
polygon.edges.forEach((edge, i) => {
|
||||||
const offset = lines[i % lines.length].attributes.offset
|
const offset =
|
||||||
|
lines[i % lines.length].attributes.offset === undefined || lines[i % lines.length].attributes.offset === 0
|
||||||
|
? 0.1
|
||||||
|
: lines[i % lines.length].attributes.offset
|
||||||
const dx = edge.inwardNormal.x * offset
|
const dx = edge.inwardNormal.x * offset
|
||||||
const dy = edge.inwardNormal.y * offset
|
const dy = edge.inwardNormal.y * offset
|
||||||
offsetEdges.push(createOffsetEdge(edge, dx, dy))
|
offsetEdges.push(createOffsetEdge(edge, dx, dy))
|
||||||
@ -3523,7 +3527,8 @@ export const inPolygon = (polygonPoints, rectPoints) => {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 포인트를 기준으로 선의 길이를 구한다. 선의 길이는 10을 곱하여 사용한다.
|
* 포인트를 기준으로 선의 길이를 구한다. 선의 길이는 10을 곱하여 사용한다.
|
||||||
* @param points {{x1, y1, x2, y2}}
|
* @param points
|
||||||
|
* @returns number
|
||||||
*/
|
*/
|
||||||
export const calcLinePlaneSize = (points) => {
|
export const calcLinePlaneSize = (points) => {
|
||||||
const { x1, y1, x2, y2 } = points
|
const { x1, y1, x2, y2 } = points
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user