var iw = 69 // 幅[mm][10,200]
, ih = 54 // 高さ[mm][10, 200]
, id = 15 // 奥行[mm][10, 200]
, dw = 7
, dh = 2
, w = iw + dh*2
, h = ih + dh*2
, d = id + dh*2;
var f3js = require('f3js')
, c = f3js.createContainer()
, p = c.drawJointRectangle(0, 0, w, h, dw, dh);
c.x = 10;
c.y = 10;
// 基板を固定する穴4つ
c.drawCircle(15.234 + dh, 2.539 + dh, 1.6);
c.c(13.965 + dh, 50.761 + dh, 1.6); // shorthand for drawCircle
c.c(65.995 + dh, 17.774 + dh, 1.6);
c.c(65.995 + dh, 45.683 + dh, 1.6);
var planes = p.extrude(d);
planes[0].x = w;
planes[0].y = 0;
planes[1].x = w;
planes[1].y = d * 2;
planes[2].x = w;
planes[2].y = d;
planes[3].x = w + h;
planes[3].y = d * 2;
for (var i = 0; i < planes.length-1; i ++) {
c.add(planes[i]);
}
var c2 = f3js.cc(); // shorthand for createContainer
c2.x = 10;
c2.y = h + 10;
c2.add(planes[4]);
// ピンヘッダを通す穴の並び4箇所
c2.pln(18.80 + dh, 2.54 + dh, 41.65 + dh, 2.54 + dh);
c2.pln(45.73 + dh, 2.54 + dh, 63.50 + dh, 2.54 + dh);
c2.pln(27.95 + dh, 50.8 + dh, 45.73 + dh, 50.8 + dh);
c2.pln(50.8 + dh, 50.8 + dh, 63.49 + dh, 50.8 + dh);
// ピンヘッダ6本ぶんのまとまりを通す大きめの穴1箇所
c2.rc(63, 23, 7, 9);
// USBポートと電源を通す穴2箇所
c2.rc(-6.35 + dh, 8.525 + dh, 16.875, 13.43);
c2.rc(-2.905 + dh, 40.275 + dh, 15.34, 10.9);