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