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]);
var c3 = c2.cc();
c3.x = dh;
c3.y = dh;
// ピンヘッダを通す穴の並び4箇所
c3.pln(iw - 18.80, 2.54, iw - 41.65, 2.54);
c3.pln(iw - 45.73, 2.54, iw - 63.50, 2.54);
c3.pln(iw - 27.95, 50.8, iw - 45.73, 50.8);
c3.pln(iw - 50.8, 50.8, iw - 63.49, 50.8);
// ピンヘッダ6本ぶんのまとまりを通す大きめの穴1箇所
c3.rc(iw - 61, 21, -7, 9);
// USBポートと電源を通す穴2箇所
c3.rc(iw + 6.35, 8.525, -16.875, 13.43);
c3.rc(iw + 2.905, 40.275, -15.34, 10.9);