작업 중
This commit is contained in:
parent
e685e53c5f
commit
89fbc1c1b4
@ -239,7 +239,7 @@ export default function Roof2() {
|
|||||||
]
|
]
|
||||||
|
|
||||||
if (canvas) {
|
if (canvas) {
|
||||||
const polygon = new QPolygon(eightPoint4, {
|
const polygon = new QPolygon(type1A, {
|
||||||
// const polygon = new QPolygon(eightPoint, {
|
// const polygon = new QPolygon(eightPoint, {
|
||||||
fill: 'transparent',
|
fill: 'transparent',
|
||||||
stroke: 'black',
|
stroke: 'black',
|
||||||
|
|||||||
@ -914,8 +914,8 @@ export default class QPolygon extends fabric.Group {
|
|||||||
|
|
||||||
#drawHelpLineInOctagon(chon) {
|
#drawHelpLineInOctagon(chon) {
|
||||||
this.drawRoofRidge()
|
this.drawRoofRidge()
|
||||||
this.drawHips()
|
// this.drawHips()
|
||||||
this.connectLinePoint()
|
// this.connectLinePoint()
|
||||||
}
|
}
|
||||||
|
|
||||||
/*마루 그리기
|
/*마루 그리기
|
||||||
@ -953,15 +953,16 @@ export default class QPolygon extends fabric.Group {
|
|||||||
nextWall = this.wall.lines[index + 1]
|
nextWall = this.wall.lines[index + 1]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.getLineDirection(prevLine) !== this.getLineDirection(nextLine) && currentWall.length < currentLine.length) {
|
// if (this.getLineDirection(prevLine) !== this.getLineDirection(nextLine) && currentWall.length < currentLine.length) {
|
||||||
dVector = this.getDirectionForDegree(prevLine, currentLine)
|
if (this.getLineDirection(prevWall) !== this.getLineDirection(nextWall) && currentWall.length < currentLine.length) {
|
||||||
|
dVector = this.getDirectionForDegree(prevWall, currentWall)
|
||||||
let {
|
let {
|
||||||
minLineLength,
|
minLineLength,
|
||||||
currentLineLength,
|
currentLineLength,
|
||||||
maxLineLength,
|
maxLineLength,
|
||||||
} = this.getRoofBaseLine(prevLine, currentLine, nextLine, dVector)
|
} = this.getRoofBaseLine(prevWall, currentWall, nextWall, dVector)
|
||||||
|
|
||||||
console.log('currentLine.length : ' + currentLine.length)
|
console.log('currentLine.length : ' + currentWall.length)
|
||||||
// 마루는 세개의 벽중에서 가장 길 수 없다.
|
// 마루는 세개의 벽중에서 가장 길 수 없다.
|
||||||
console.log('currentLineLength : ', currentLineLength, 'minLineLength : ', minLineLength, 'maxLineLength : ', maxLineLength)
|
console.log('currentLineLength : ', currentLineLength, 'minLineLength : ', minLineLength, 'maxLineLength : ', maxLineLength)
|
||||||
console.log('minLineLength <= currentLineLength <= maxLineLength', (minLineLength <= currentLineLength && currentLineLength <= maxLineLength))
|
console.log('minLineLength <= currentLineLength <= maxLineLength', (minLineLength <= currentLineLength && currentLineLength <= maxLineLength))
|
||||||
@ -974,26 +975,26 @@ export default class QPolygon extends fabric.Group {
|
|||||||
// console.log(ridgeRun)
|
// console.log(ridgeRun)
|
||||||
switch (dVector) {
|
switch (dVector) {
|
||||||
case 45:
|
case 45:
|
||||||
startXPoint = currentLine.x1 + (currentLineLength / 2)
|
startXPoint = currentWall.x1 + (currentLineLength / 2)
|
||||||
startYPoint = currentLine.y1 - (currentLineLength / 2)
|
startYPoint = currentWall.y1 - (currentLineLength / 2)
|
||||||
endXPoint = startXPoint
|
endXPoint = startXPoint
|
||||||
endYPoint = startYPoint - ridgeRun
|
endYPoint = startYPoint - ridgeRun
|
||||||
break
|
break
|
||||||
case 135:
|
case 135:
|
||||||
startXPoint = currentLine.x1 + (currentLineLength / 2)
|
startXPoint = currentWall.x1 + (currentLineLength / 2)
|
||||||
startYPoint = currentLine.y1 + (currentLineLength / 2)
|
startYPoint = currentWall.y1 + (currentLineLength / 2)
|
||||||
endXPoint = startXPoint + ridgeRun
|
endXPoint = startXPoint + ridgeRun
|
||||||
endYPoint = startYPoint
|
endYPoint = startYPoint
|
||||||
break
|
break
|
||||||
case 225:
|
case 225:
|
||||||
startXPoint = currentLine.x1 - (currentLineLength / 2)
|
startXPoint = currentWall.x1 - (currentLineLength / 2)
|
||||||
startYPoint = currentLine.y1 + (currentLineLength / 2)
|
startYPoint = currentWall.y1 + (currentLineLength / 2)
|
||||||
endXPoint = startXPoint
|
endXPoint = startXPoint
|
||||||
endYPoint = startYPoint + ridgeRun
|
endYPoint = startYPoint + ridgeRun
|
||||||
break
|
break
|
||||||
case 315:
|
case 315:
|
||||||
startXPoint = currentLine.x1 - (currentLineLength / 2)
|
startXPoint = currentWall.x1 - (currentLineLength / 2)
|
||||||
startYPoint = currentLine.y1 - (currentLineLength / 2)
|
startYPoint = currentWall.y1 - (currentLineLength / 2)
|
||||||
endXPoint = startXPoint - ridgeRun
|
endXPoint = startXPoint - ridgeRun
|
||||||
endYPoint = startYPoint
|
endYPoint = startYPoint
|
||||||
break
|
break
|
||||||
@ -1819,9 +1820,7 @@ export default class QPolygon extends fabric.Group {
|
|||||||
최대 생성 마루 갯수
|
최대 생성 마루 갯수
|
||||||
*/
|
*/
|
||||||
getMaxRidge(length) {
|
getMaxRidge(length) {
|
||||||
let a1 = 4
|
return ((length - 4) / 2) + 1
|
||||||
let d = 2
|
|
||||||
return ((length - a1) / d) + 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user