작업 중

This commit is contained in:
Jaeyoung Lee 2024-07-30 13:34:47 +09:00
parent e685e53c5f
commit 89fbc1c1b4
2 changed files with 17 additions and 18 deletions

View File

@ -239,7 +239,7 @@ export default function Roof2() {
]
if (canvas) {
const polygon = new QPolygon(eightPoint4, {
const polygon = new QPolygon(type1A, {
// const polygon = new QPolygon(eightPoint, {
fill: 'transparent',
stroke: 'black',

View File

@ -914,8 +914,8 @@ export default class QPolygon extends fabric.Group {
#drawHelpLineInOctagon(chon) {
this.drawRoofRidge()
this.drawHips()
this.connectLinePoint()
// this.drawHips()
// this.connectLinePoint()
}
/*
@ -953,15 +953,16 @@ export default class QPolygon extends fabric.Group {
nextWall = this.wall.lines[index + 1]
}
if (this.getLineDirection(prevLine) !== this.getLineDirection(nextLine) && currentWall.length < currentLine.length) {
dVector = this.getDirectionForDegree(prevLine, currentLine)
// if (this.getLineDirection(prevLine) !== this.getLineDirection(nextLine) && currentWall.length < currentLine.length) {
if (this.getLineDirection(prevWall) !== this.getLineDirection(nextWall) && currentWall.length < currentLine.length) {
dVector = this.getDirectionForDegree(prevWall, currentWall)
let {
minLineLength,
currentLineLength,
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('minLineLength <= currentLineLength <= maxLineLength', (minLineLength <= currentLineLength && currentLineLength <= maxLineLength))
@ -974,26 +975,26 @@ export default class QPolygon extends fabric.Group {
// console.log(ridgeRun)
switch (dVector) {
case 45:
startXPoint = currentLine.x1 + (currentLineLength / 2)
startYPoint = currentLine.y1 - (currentLineLength / 2)
startXPoint = currentWall.x1 + (currentLineLength / 2)
startYPoint = currentWall.y1 - (currentLineLength / 2)
endXPoint = startXPoint
endYPoint = startYPoint - ridgeRun
break
case 135:
startXPoint = currentLine.x1 + (currentLineLength / 2)
startYPoint = currentLine.y1 + (currentLineLength / 2)
startXPoint = currentWall.x1 + (currentLineLength / 2)
startYPoint = currentWall.y1 + (currentLineLength / 2)
endXPoint = startXPoint + ridgeRun
endYPoint = startYPoint
break
case 225:
startXPoint = currentLine.x1 - (currentLineLength / 2)
startYPoint = currentLine.y1 + (currentLineLength / 2)
startXPoint = currentWall.x1 - (currentLineLength / 2)
startYPoint = currentWall.y1 + (currentLineLength / 2)
endXPoint = startXPoint
endYPoint = startYPoint + ridgeRun
break
case 315:
startXPoint = currentLine.x1 - (currentLineLength / 2)
startYPoint = currentLine.y1 - (currentLineLength / 2)
startXPoint = currentWall.x1 - (currentLineLength / 2)
startYPoint = currentWall.y1 - (currentLineLength / 2)
endXPoint = startXPoint - ridgeRun
endYPoint = startYPoint
break
@ -1819,9 +1820,7 @@ export default class QPolygon extends fabric.Group {
최대 생성 마루 갯수
*/
getMaxRidge(length) {
let a1 = 4
let d = 2
return ((length - a1) / d) + 1
return ((length - 4) / 2) + 1
}
/*