From c0327545cf43552214a60fb03c086b4fa54e716f Mon Sep 17 00:00:00 2001 From: Koichi Kamichi Date: Tue, 12 Jan 2016 00:31:18 +0900 Subject: [PATCH] Supports new G/T left-bottom corner's shape. --- kage.js | 8 ++++---- kagecd.js | 38 +++++++++++++++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/kage.js b/kage.js index c58fda5..0966119 100644 --- a/kage.js +++ b/kage.js @@ -97,9 +97,9 @@ function Kage(size){ var box = this.getBox(buhin); if(sx != 0 || sy != 0){ if(sx > 100){ - sx -= 200; // Ǥ°ÕÅÀ¥â¡¼¥É + sx -= 200; } else { - sx2 = 0; // Ãæ¿´ÅÀ¥â¡¼¥É + sx2 = 0; sy2 = 0; } } @@ -376,7 +376,7 @@ function Kage(size){ this.kMage = 6; this.kUseCurve = 0; - this.kAdjustKakatoL = ([8, 5, 3, 1]); // for KAKATO adjustment 000,100,200,300 + this.kAdjustKakatoL = ([8, 5, 3, 1, 0]); // for KAKATO adjustment 000,100,200,300,400 this.kAdjustKakatoR = ([4, 3, 2, 1]); // for KAKATO adjustment 000,100,200,300 this.kAdjustKakatoRangeX = 12; // check area width this.kAdjustKakatoRangeY = ([1, 11, 14, 18]); // 3 steps of checking @@ -396,7 +396,7 @@ function Kage(size){ this.kMage = 10; this.kUseCurve = 0; - this.kAdjustKakatoL = ([14, 9, 5, 2]); // for KAKATO adjustment 000,100,200,300 + this.kAdjustKakatoL = ([14, 9, 5, 2, 0]); // for KAKATO adjustment 000,100,200,300,400 this.kAdjustKakatoR = ([8, 6, 4, 2]); // for KAKATO adjustment 000,100,200,300 this.kAdjustKakatoRangeX = 20; // check area width this.kAdjustKakatoRangeY = ([1, 19, 24, 30]); // 3 steps of checking diff --git a/kagecd.js b/kagecd.js index 914cdbb..220df57 100644 --- a/kagecd.js +++ b/kagecd.js @@ -840,9 +840,13 @@ function cdDrawLine(kage, polygons, tx1, ty1, tx2, ty2, ta1, ta2){ poly.set(1, x2 + kMinWidthT, y2 + kage.kAdjustKakatoL[opt2]); break; case 23: - poly.set(2, x2 - kMinWidthT, y2 + kage.kAdjustKakatoR[opt2] + kMinWidthT); + poly.set(2, x2 - kMinWidthT, y2 + kage.kAdjustKakatoR[opt2] + kMinWidthT); poly.set(1, x2 + kMinWidthT, y2 + kage.kAdjustKakatoR[opt2]); - break; + break; + case 24: //for T/H design + poly.set(2, x2 - kMinWidthT, y2 + kage.kMinWidthY); + poly.set(1, x2 + kMinWidthT, y2 + kage.kMinWidthY); + break; case 32: poly.set(2, x2 - kMinWidthT, y2 + kage.kMinWidthY); poly.set(1, x2 + kMinWidthT, y2 + kage.kMinWidthY); @@ -850,6 +854,24 @@ function cdDrawLine(kage, polygons, tx1, ty1, tx2, ty2, ta1, ta2){ } polygons.push(poly); + + if(a2 == 24){ //for T design + poly = new Polygon(); + poly.push(x2, y2 + kage.kMinWidthY); + poly.push(x2 + kMinWidthT, y2 - kage.kMinWidthY * 3); + poly.push(x2 + kMinWidthT * 2, y2 - kage.kMinWidthY); + poly.push(x2 + kMinWidthT * 2, y2 + kage.kMinWidthY); + polygons.push(poly); + } + + if(a2 == 13 && opt2 == 4){ //for new GTH box's left bottom corner + poly = new Polygon(); + poly.push(x2 - kMinWidthT, y2 - kage.kMinWidthY * 3); + poly.push(x2 - kMinWidthT * 2, y2); + poly.push(x2 - kage.kMinWidthY, y2 + kage.kMinWidthY * 5); + poly.push(x2 + kMinWidthT, y2 + kage.kMinWidthY); + polygons.push(poly); + } if(a1 == 22){ //box's right top corner poly = new Polygon(); @@ -1114,7 +1136,17 @@ function cdDrawLine(kage, polygons, tx1, ty1, tx2, ty2, ta1, ta2){ poly.push(x1 - kMinWidthT, y1 + kMinWidthT + 4); polygons.push(poly); } - + + + if(a2 == 13 && opt2 == 4){ //for new GTH box's left bottom corner MUKI KANKEINASHI + poly = new Polygon(); + poly.push(x2 - kMinWidthT, y2 - kage.kMinWidthY * 3); + poly.push(x2 - kMinWidthT * 2, y2); + poly.push(x2 - kage.kMinWidthY, y2 + kage.kMinWidthY * 5); + poly.push(x2 + kMinWidthT, y2 + kage.kMinWidthY); + polygons.push(poly); + } + XX = Math.sin(rad) * v; XY = Math.cos(rad) * v * -1; YX = Math.cos(rad) * v; -- 1.7.10.4