From e0a644c84ec7d82b137625f9c26bd15a7e668f47 Mon Sep 17 00:00:00 2001 From: Jaeyoung Lee Date: Thu, 18 Jul 2024 18:19:12 +0900 Subject: [PATCH] =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/fabric/QPolygon.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/fabric/QPolygon.js b/src/components/fabric/QPolygon.js index df66abb4..ef880c35 100644 --- a/src/components/fabric/QPolygon.js +++ b/src/components/fabric/QPolygon.js @@ -27,6 +27,7 @@ export default class QPolygon extends fabric.Group { helpLines = [] wall + constructor(points, options, canvas) { /*if (points.length !== 4 && points.length !== 6) { throw new Error('Points must be 4 or 6.') @@ -701,13 +702,21 @@ export default class QPolygon extends fabric.Group { } getRoofRidge(prevLine, currentLine, nextLine) { - console.log(prevLine) - console.log(this.getLineDirection(prevLine), this.getLineDirection(currentLine), this.getLineDirection(nextLine)) if (this.getLineDirection(prevLine) !== this.getLineDirection(nextLine)) { - + console.log(this.getLineDirection(prevLine), this.getLineDirection(currentLine), this.getLineDirection(nextLine)) + console.log(currentLine.length) + if (currentLine.length < prevLine.length && currentLine.length < nextLine.length) { + console.log(currentLine.length) + } } } + getMaxRidge(length) { + let a1 = 4 + let d = 2 + return ((length - a1) / d) + 1 + } + getPointBetweenLine(line1, line2) { let dVector = this.getDirectionForDegree(line1, line2) let xp = line1.x2, yp = line1.y2