var f3js = require('f3js');
var dep = 2 /* 板厚 [1,5] */
, w = 5 /* ギザギザ幅 [2,6] */
, width = 100 /* タブレット把持部分の幅 [50,200] */;
// テストでいろいろ描いてみる
f3js.drawCircle(28, width + 28, 5);
f3js.drawRectangle(23, width + 35, 10, 5);
var rect = f3js.drawRectangle(23, width + 42, 10, 5);
rect.fill = true;
rect.stroke = false;
f3js.text('test', 23, width + 48);
// スタンド
var c = f3js.createContainer();
c.x = 5, c.y = width + 5 - dep;
var p = c.createPath();
p.moveTo(0, 0);
p.jointTo(75, 0, w, dep);
p.jointTo(75, 24, w, dep);
p.lineTo(65, 24);
p.lineTo(65, 15);
p.jointTo(15, 15, w, dep);
p.lineTo(15, 130);
// p.jointTo(0, 130, w, dep);
p.lineTo(0, 130);
p.jointTo(0, 0, w, dep);
p.close();
var plates = p.extrude(width);
plates[0].x = 5; plates[0].y = 5;
f3js.add(plates[0]);
plates[1].x = 80; plates[1].y = 5;
f3js.add(plates[1]);
plates[2].x = 104; plates[2].y = 5;
f3js.add(plates[2]);
plates[3].x = 154; plates[3].y = 5;
f3js.add(plates[3]);
plates[4].x = 75; plates[4].y = 0;
c.add(plates[4]);
// ついでに小さい立方体も出してみる
var c = f3js.createContainer();
c.x = 42;
c.y = width + 35;
var rect2 = c.drawJointRectangle(0, 0, 30, 30);
rect2.fill = true;
var plates2 = rect2.extrude(30);
plates2[0].x = 30;
plates2[0].y = 2;
c.add(plates2[0]); // v0.2.3現在、側面には fill = true を設定できない仕様
plates2[1].x = 60;
plates2[1].y = 2;
c.add(plates2[1]);
plates2[2].x = 0;
plates2[2].y = 32;
c.add(plates2[2]);
plates2[3].x = 30;
plates2[3].y = 32;
c.add(plates2[3]);
plates2[4].x = 60;
plates2[4].y = 30;
c.add(plates2[4]);