버그 수정중
This commit is contained in:
parent
f40d8a7afb
commit
88b73eb91e
@ -135,8 +135,8 @@ export default function Roof2() {
|
|||||||
const makeQPolygon = () => {
|
const makeQPolygon = () => {
|
||||||
const type1 = [
|
const type1 = [
|
||||||
{ x: 100, y: 100 },
|
{ x: 100, y: 100 },
|
||||||
{ x: 800, y: 100 },
|
{ x: 850, y: 100 },
|
||||||
{ x: 800, y: 800 },
|
{ x: 850, y: 800 },
|
||||||
{ x: 500, y: 800 },
|
{ x: 500, y: 800 },
|
||||||
{ x: 500, y: 400 },
|
{ x: 500, y: 400 },
|
||||||
{ x: 100, y: 400 },
|
{ x: 100, y: 400 },
|
||||||
@ -160,16 +160,16 @@ export default function Roof2() {
|
|||||||
]
|
]
|
||||||
|
|
||||||
const type4 = [
|
const type4 = [
|
||||||
{ x: 153.96209743461895, y: 446.46989831140326 },
|
{ x: 150, y: 450 },
|
||||||
{ x: 153.96209743461895, y: 796.879061239893 },
|
{ x: 150, y: 800 },
|
||||||
{ x: 754.3712603631087, y: 796.879061239893 },
|
{ x: 750, y: 800 },
|
||||||
{ x: 754.3712603631087, y: 196.46989831140326 },
|
{ x: 750, y: 300 },
|
||||||
{ x: 403.962097434619, y: 196.46989831140326 },
|
{ x: 550, y: 300 },
|
||||||
{ x: 403.962097434619, y: 446.46989831140326 },
|
{ x: 550, y: 450 },
|
||||||
]
|
]
|
||||||
if (canvas) {
|
if (canvas) {
|
||||||
const polygon = new QPolygon(
|
const polygon = new QPolygon(
|
||||||
type3,
|
type1,
|
||||||
{
|
{
|
||||||
fill: 'transparent',
|
fill: 'transparent',
|
||||||
stroke: 'black',
|
stroke: 'black',
|
||||||
|
|||||||
@ -30,7 +30,6 @@ export default class QPolygon extends fabric.Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const sortPoints = sortedPoints(points)
|
const sortPoints = sortedPoints(points)
|
||||||
console.log(sortPoints)
|
|
||||||
const polygon = new fabric.Polygon(sortPoints, options)
|
const polygon = new fabric.Polygon(sortPoints, options)
|
||||||
|
|
||||||
super([polygon], {})
|
super([polygon], {})
|
||||||
@ -321,7 +320,9 @@ export default class QPolygon extends fabric.Group {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
//외각선 기준
|
//외각선 기준
|
||||||
const topIndex = findTopTwoIndexesByDistance(this.lines) //배열중에 큰 2값을 가져옴 TODO: 나중에는 인자로 받아서 다각으로 수정 해야됨
|
const topIndex = findTopTwoIndexesByDistance(this.lines).sort(
|
||||||
|
(a, b) => a - b,
|
||||||
|
) //배열중에 큰 2값을 가져옴 TODO: 나중에는 인자로 받아서 다각으로 수정 해야됨
|
||||||
|
|
||||||
//일단 배열 6개 짜리 기준의 선 번호
|
//일단 배열 6개 짜리 기준의 선 번호
|
||||||
if (topIndex[0] === 4) {
|
if (topIndex[0] === 4) {
|
||||||
@ -639,7 +640,7 @@ export default class QPolygon extends fabric.Group {
|
|||||||
y: (lines[1].y1 + lines[1].y2) / 2,
|
y: (lines[1].y1 + lines[1].y2) / 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
ridgeLength = Math.min(this.lines[2].length, this.lines[5].length)
|
ridgeLength = Math.min(this.lines[4].length, this.lines[5].length)
|
||||||
ridgePoint1 = [vPoint1.x, vPoint1.y, vPoint1.x + ridgeLength, vPoint1.y]
|
ridgePoint1 = [vPoint1.x, vPoint1.y, vPoint1.x + ridgeLength, vPoint1.y]
|
||||||
ridgePoint2 = [vPoint2.x, vPoint2.y, vPoint2.x, vPoint2.y + ridgeLength]
|
ridgePoint2 = [vPoint2.x, vPoint2.y, vPoint2.x, vPoint2.y + ridgeLength]
|
||||||
}
|
}
|
||||||
@ -694,7 +695,7 @@ export default class QPolygon extends fabric.Group {
|
|||||||
|
|
||||||
// 용마루 보조선
|
// 용마루 보조선
|
||||||
const ridgeHelpLine1 = new QLine(
|
const ridgeHelpLine1 = new QLine(
|
||||||
[lines2[1].x2, lines2[1].y2, ridgePoint1[2], ridgePoint1[3]],
|
[lines2[0].x2, lines2[0].y2, ridgePoint1[2], ridgePoint1[3]],
|
||||||
{
|
{
|
||||||
fontSize: this.fontSize,
|
fontSize: this.fontSize,
|
||||||
stroke: 'black',
|
stroke: 'black',
|
||||||
@ -705,7 +706,7 @@ export default class QPolygon extends fabric.Group {
|
|||||||
|
|
||||||
// 용마루 보조선
|
// 용마루 보조선
|
||||||
const ridgeHelpLine2 = new QLine(
|
const ridgeHelpLine2 = new QLine(
|
||||||
[lines2[0].x2, lines2[0].y2, ridgePoint2[2], ridgePoint2[3]],
|
[lines2[1].x2, lines2[1].y2, ridgePoint2[2], ridgePoint2[3]],
|
||||||
{
|
{
|
||||||
fontSize: this.fontSize,
|
fontSize: this.fontSize,
|
||||||
stroke: 'black',
|
stroke: 'black',
|
||||||
@ -751,7 +752,6 @@ export default class QPolygon extends fabric.Group {
|
|||||||
this.addWithUpdate(ridgeEndLine)
|
this.addWithUpdate(ridgeEndLine)
|
||||||
|
|
||||||
this.canvas.renderAll()
|
this.canvas.renderAll()
|
||||||
console.log(JSON.stringify(this.points))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#drawHelpLineInOctagon(chon) {}
|
#drawHelpLineInOctagon(chon) {}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user