{ "nodes": [ { "datums": [ { "expr": "2 * (v.depth - v.wood)/2.8", "name": "x", "type": "float", "uid": 0 }, { "expr": "2 * v.height/3", "name": "y", "type": "float", "uid": 1 }, { "expr": "5", "name": "N", "type": "int", "uid": 2 }, { "expr": "v.depth/2", "name": "r", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('m-Xf13.9286-Yf16.6667-Zf0aaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f0.951057Y+*f-0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f0.587785Y+*f-0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f-0.587785Y+*f0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f-0.951057Y+*f0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Y',float('3.928600'),float('6.666700'),float('-inf'),float('23.928600'),float('26.666700'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -501.92672897435494, -148.8469018841291 ], "name": "p0", "script": [ "# Neil Gershenfeld 2/14/15", "# Matt Keeter 6/12/15", "", "import fab", "import math", "", "title('Polygon')", "", "input('x', float)", "input('y', float)", "input('N', int)", "input('r', float)", "", "output('shape', fab.shapes.move(fab.shapes.polygon_radius(x, y, r, N), x, y))", "", "# UI", "# (we need to do a bit of work to make the UI work for both even and", "# odd vertex counts; otherwise it will be off for one or the other)", "a_ = 0 if (N % 2) else (math.pi / N)", "sb.ui.wireframe([", " (x + r * math.sin(a_ + a * math.pi * 2/N),", " y + r * math.cos(a_ + a * math.pi * 2/N), 0)", " for a in range(N)], close=True)", "sb.ui.point(x, y)", "sb.ui.point(x + r * math.sin(a_), y + r * math.cos(a_),", " drag=(None, r, None))", "" ], "uid": 1 }, { "datums": [ { "expr": "0.0", "name": "_x", "type": "float", "uid": 0 }, { "expr": "0.0", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "z", "type": "float", "uid": 2 }, { "expr": "0", "name": "a", "type": "float", "uid": 3 }, { "expr": "\u0011[__4.__5]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf0-Zf0m_+*f1Y*f0Z+*f-0Y*f1Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f0.984808X*f-0.173648Y+*f0.173648X*f0.984808Y_m-Xf-0-Yf-0-Zf0m-Xf13.9286-Yf16.6667-Zf0aaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f0.951057Y+*f-0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f0.587785Y+*f-0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f-0.587785Y+*f0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f-0.951057Y+*f0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Y',float('5.026576'),float('nan'),float('-inf'),float('28.195696'),float('nan'),float('inf'))", "name": "rotated", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ -729.19694786710375, 100.26992634064848 ], "name": "r1", "script": [ "import fab", "import math", "", "title('Rotate (Y)')", "", "input('_x', float)", "input('y', float)", "input('z', float)", "input('a', float)", "", "input('shape', fab.types.Shape)", "output('rotated', fab.shapes.rotate_x(shape, a, y, z))", "", "# UI", "rad = math.radians(a)", "sb.ui.wireframe([(_x, y + math.cos(rad), z + math.sin(rad)),", " (_x, y, z),", " (_x, y + 1, z)], color=sb.color.teal)", "", "# Draw a semi-circular arc showing the rotation", "if int(a) % 360 != 0:", " sb.ui.wireframe([", " (_x, y + math.cos(math.radians(a_)) * 0.3,", " z + math.sin(math.radians(a_)) * 0.3)", " for a_ in range(int(a) % 360)], color=sb.color.teal)", "", "sb.ui.point(_x, y, z, color=sb.color.teal)", "", "def drag_pt(this, x, y, z):", " this.a = math.degrees(math.atan2(z - this.z, y - this.y))", "sb.ui.point(_x, y + math.cos(rad), z + math.sin(rad),", " color=sb.color.teal, drag=drag_pt, relative=False)", "", "" ], "uid": 3 }, { "datums": [ { "expr": "0.0", "name": "x", "type": "float", "uid": 0 }, { "expr": "0.0", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "_z", "type": "float", "uid": 2 }, { "expr": "-10", "name": "a", "type": "float", "uid": 3 }, { "expr": "\u0011[__1.__4]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf0-Zf0m+*f0.984808X*f-0.173648Y+*f0.173648X*f0.984808Y_m-Xf-0-Yf-0-Zf0m-Xf13.9286-Yf16.6667-Zf0aaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f0.951057Y+*f-0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f0.587785Y+*f-0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f-0.587785Y+*f0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f-0.951057Y+*f0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Y',float('5.026576'),float('2.410266'),float('-inf'),float('28.195696'),float('25.579388'),float('inf'))", "name": "rotated", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ -412.52283419829701, 374.58970001914332 ], "name": "r2", "script": [ "import fab", "import math", "", "title('Rotate (Z)')", "", "input('x', float)", "input('y', float)", "input('_z', float)", "input('a', float)", "", "input('shape', fab.types.Shape)", "output('rotated', fab.shapes.rotate_z(shape, a, x, y))", "", "# UI", "rad = math.radians(a)", "sb.ui.wireframe([(x + math.cos(rad), y + math.sin(rad), _z),", " (x, y, _z),", " (x + 1, y, _z)], color=sb.color.teal)", "", "# Draw a semi-circular arc showing the rotation", "if int(a) % 360 != 0:", " sb.ui.wireframe([", " (x + math.cos(math.radians(a_)) * 0.3,", " y + math.sin(math.radians(a_)) * 0.3, _z)", " for a_ in range(int(a) % 360)], color=sb.color.teal)", "", "sb.ui.point(x, y, _z, color=sb.color.teal)", "", "def drag_pt(this, x, y, z):", " this.a = math.degrees(math.atan2(y - this.y, x - this.x))", "sb.ui.point(x + math.cos(rad), y + math.sin(rad), _z,", " color=sb.color.teal, drag=drag_pt, relative=False)", "", "" ], "uid": 4 }, { "datums": [ { "expr": "17.5", "name": "width", "type": "float", "uid": 0 }, { "expr": "20", "name": "depth", "type": "float", "uid": 1 }, { "expr": "25", "name": "height", "type": "float", "uid": 2 }, { "expr": "0.5", "name": "wood", "type": "float", "uid": 3 }, { "expr": "1.13", "name": "buttonDiameter", "type": "float", "uid": 4 } ], "inspector": [ 214.08452515179454, -755.6129041187163 ], "name": "v", "script": [ "import fab", "", "title('script')", "input('width', float)", "input('depth', float)", "input('height', float)", "input('wood', float)", "input('buttonDiameter', float)" ], "uid": 7 }, { "datums": [ { "expr": "\u0011[__0.__4]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__3.__5]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aaa-f0X-Xf20a-f0Y-Yf24.5nm-Xf0-Yf0-Zf0m_+*f1Y*f0Z+*f-0Y*f1Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f0.984808X*f-0.173648Y+*f0.173648X*f0.984808Y_m-Xf-0-Yf-0-Zf0m-Xf13.9286-Yf16.6667-Zf0aaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f0.951057Y+*f-0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f0.587785Y+*f-0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f-0.587785Y+*f0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f-0.951057Y+*f0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Y',float('0.000000'),float('0.000000'),float('-inf'),float('20.000000'),float('24.500000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ -95.07366498980457, -113.77668105337267 ], "name": "d0", "script": [ "import fab.types", "", "title('Difference')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 2 }, { "datums": [ { "expr": "r0.x0", "name": "x0", "type": "float", "uid": 0 }, { "expr": "r0.y1 - (v.height / 9)", "name": "y0", "type": "float", "uid": 1 }, { "expr": "r0.x1", "name": "x1", "type": "float", "uid": 2 }, { "expr": "r0.y1 ", "name": "y1", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f0X-Xf20a-f21.7222Y-Yf24.5',float('0.000000'),float('21.722221'),float('-inf'),float('20.000000'),float('24.500000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -283.66241029744958, -634.3439614893515 ], "name": "r3", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Rectangle (corner)')", "", "input('x0', float)", "input('y0', float)", "input('x1', float)", "input('y1', float)", "", "output('shape', fab.shapes.rectangle(x0, x1, y0, y1))", "", "# UI", "sb.ui.wireframe([(x0, y0, 0), (x1, y0, 0),", " (x1, y1, 0), (x0, y1, 0)], close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(x1, y1)", "", "" ], "uid": 5 }, { "datums": [ { "expr": "\u0011[__2.__2]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__5.__4]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('iaaa-f0X-Xf20a-f0Y-Yf24.5nm-Xf0-Yf0-Zf0m_+*f1Y*f0Z+*f-0Y*f1Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f0.984808X*f-0.173648Y+*f0.173648X*f0.984808Y_m-Xf-0-Yf-0-Zf0m-Xf13.9286-Yf16.6667-Zf0aaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f0.951057Y+*f-0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f0.587785Y+*f-0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f-0.587785Y+*f0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f-0.951057Y+*f0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Yaa-f0X-Xf20a-f21.7222Y-Yf24.5',float('0.000000'),float('0.000000'),float('-inf'),float('20.000000'),float('24.500000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 246.07499435761207, -110.43371651379057 ], "name": "u1", "script": [ "import fab.types", "", "title('Side')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a | b)", "" ], "uid": 6 }, { "datums": [ { "expr": "0.0", "name": "_x", "type": "float", "uid": 0 }, { "expr": "0.0", "name": "_y", "type": "float", "uid": 1 }, { "expr": "0", "name": "zmin", "type": "float", "uid": 2 }, { "expr": "v.wood", "name": "zmax", "type": "float", "uid": 3 }, { "expr": "\u0011[__6.__2]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('am__f1iaaa-f0X-Xf20a-f0Y-Yf24.5nm-Xf0-Yf0-Zf0m_+*f1Y*f0Z+*f-0Y*f1Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f0.984808X*f-0.173648Y+*f0.173648X*f0.984808Y_m-Xf-0-Yf-0-Zf0m-Xf13.9286-Yf16.6667-Zf0aaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f0.951057Y+*f-0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f0.587785Y+*f-0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f-0.587785Y+*f0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f-0.951057Y+*f0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Yaa-f0X-Xf20a-f21.7222Y-Yf24.5a-f0Z-Zf0.5',float('0.000000'),float('0.000000'),float('0.000000'),float('20.000000'),float('24.500000'),float('0.500000'))", "name": "out", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 135.72067170765723, 99.843063633218208 ], "name": "e0", "script": [ "import fab", "", "title('Extrude')", "", "input('_x', float)", "input('_y', float)", "input('zmin', float)", "input('zmax', float)", "", "input('shape', fab.types.Shape)", "output('out', fab.shapes.extrude_z(shape, zmin, zmax))", "", "# UI", "sb.ui.wireframe([(_x, _y, zmin), (_x, _y, zmax)], color=sb.color.green)", "sb.ui.point(_x, _y, zmin, color=sb.color.green)", "sb.ui.point(_x, _y, zmax, color=sb.color.green)", "", "" ], "uid": 8 }, { "datums": [ { "expr": "0.0", "name": "x", "type": "float", "uid": 0 }, { "expr": "0.0", "name": "_y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "z", "type": "float", "uid": 2 }, { "expr": "90", "name": "a", "type": "float", "uid": 3 }, { "expr": "\u0011[__8.__5]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf0-Zf0m+*f6.12323e-17X*f1ZY+*f-1X*f6.12323e-17Zm-Xf-0-Yf0-Zf-0am__f1iaaa-f0X-Xf20a-f0Y-Yf24.5nm-Xf0-Yf0-Zf0m_+*f1Y*f0Z+*f-0Y*f1Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f0.984808X*f-0.173648Y+*f0.173648X*f0.984808Y_m-Xf-0-Yf-0-Zf0m-Xf13.9286-Yf16.6667-Zf0aaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f0.951057Y+*f-0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f0.587785Y+*f-0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f-0.587785Y+*f0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f-0.951057Y+*f0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Yaa-f0X-Xf20a-f21.7222Y-Yf24.5a-f0Z-Zf0.5',float('-0.500000'),float('0.000000'),float('0.000000'),float('0.000000'),float('24.500000'),float('20.000000'))", "name": "rotated", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ -23.512108080801482, 365.50640743791479 ], "name": "r4", "script": [ "import fab", "import math", "", "title('Rotate (Y)')", "", "input('x', float)", "input('_y', float)", "input('z', float)", "input('a', float)", "", "input('shape', fab.types.Shape)", "output('rotated', fab.shapes.rotate_y(shape, a, x, z))", "", "# UI", "rad = math.radians(a)", "sb.ui.wireframe([(x + math.cos(rad), _y, z + math.sin(rad)),", " (x, _y, z),", " (x + 1, _y, z)], color=sb.color.teal)", "", "# Draw a semi-circular arc showing the rotation", "if int(a) % 360 != 0:", " sb.ui.wireframe([", " (x + math.cos(math.radians(a_)) * 0.3, _y,", " z + math.sin(math.radians(a_)) * 0.3)", " for a_ in range(int(a) % 360)], color=sb.color.teal)", "", "sb.ui.point(x, _y, z, color=sb.color.teal)", "", "def drag_pt(this, x, y, z):", " this.a = math.degrees(math.atan2(z - this.z, x - this.x))", "sb.ui.point(x + math.cos(rad), _y, z + math.sin(rad),", " color=sb.color.teal, drag=drag_pt, relative=False)", "", "" ], "uid": 9 }, { "datums": [ { "expr": "0.0", "name": "_x", "type": "float", "uid": 0 }, { "expr": "0.0", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "z", "type": "float", "uid": 2 }, { "expr": "90", "name": "a", "type": "float", "uid": 3 }, { "expr": "\u0011[__9.__5]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf0-Zf0m_+*f6.12323e-17Y*f1Z+*f-1Y*f6.12323e-17Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f6.12323e-17X*f1ZY+*f-1X*f6.12323e-17Zm-Xf-0-Yf0-Zf-0am__f1iaaa-f0X-Xf20a-f0Y-Yf24.5nm-Xf0-Yf0-Zf0m_+*f1Y*f0Z+*f-0Y*f1Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f0.984808X*f-0.173648Y+*f0.173648X*f0.984808Y_m-Xf-0-Yf-0-Zf0m-Xf13.9286-Yf16.6667-Zf0aaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f0.951057Y+*f-0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f0.587785Y+*f-0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f-0.587785Y+*f0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f-0.951057Y+*f0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Yaa-f0X-Xf20a-f21.7222Y-Yf24.5a-f0Z-Zf0.5',float('-0.500000'),float('-20.000000'),float('0.000000'),float('0.000000'),float('0.000000'),float('24.500000'))", "name": "rotated", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 258.6331888888169, 365.50640743791479 ], "name": "r5", "script": [ "import fab", "import math", "", "title('Rotate (X)')", "", "input('_x', float)", "input('y', float)", "input('z', float)", "input('a', float)", "", "input('shape', fab.types.Shape)", "output('rotated', fab.shapes.rotate_x(shape, a, y, z))", "", "# UI", "rad = math.radians(a)", "sb.ui.wireframe([(_x, y + math.cos(rad), z + math.sin(rad)),", " (_x, y, z),", " (_x, y + 1, z)], color=sb.color.teal)", "", "# Draw a semi-circular arc showing the rotation", "if int(a) % 360 != 0:", " sb.ui.wireframe([", " (_x, y + math.cos(math.radians(a_)) * 0.3,", " z + math.sin(math.radians(a_)) * 0.3)", " for a_ in range(int(a) % 360)], color=sb.color.teal)", "", "sb.ui.point(_x, y, z, color=sb.color.teal)", "", "def drag_pt(this, x, y, z):", " this.a = math.degrees(math.atan2(z - this.z, y - this.y))", "sb.ui.point(_x, y + math.cos(rad), z + math.sin(rad),", " color=sb.color.teal, drag=drag_pt, relative=False)", "", "" ], "uid": 10 }, { "datums": [ { "expr": "\u0011[__10.__5]", "name": "shape", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "0.0", "name": "_x", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "_y", "type": "float", "uid": 2 }, { "expr": "2", "name": "i", "type": "int", "uid": 3 }, { "expr": "1", "name": "j", "type": "int", "uid": 4 }, { "expr": "v.width", "name": "dx", "type": "float", "uid": 5 }, { "expr": "0", "name": "dy", "type": "float", "uid": 6 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf0-Zf0im-Xf0-Yf0-Zf0m-Xf0-Yf0-Zf0m_+*f6.12323e-17Y*f1Z+*f-1Y*f6.12323e-17Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f6.12323e-17X*f1ZY+*f-1X*f6.12323e-17Zm-Xf-0-Yf0-Zf-0am__f1iaaa-f0X-Xf20a-f0Y-Yf24.5nm-Xf0-Yf0-Zf0m_+*f1Y*f0Z+*f-0Y*f1Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f0.984808X*f-0.173648Y+*f0.173648X*f0.984808Y_m-Xf-0-Yf-0-Zf0m-Xf13.9286-Yf16.6667-Zf0aaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f0.951057Y+*f-0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f0.587785Y+*f-0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f-0.587785Y+*f0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f-0.951057Y+*f0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Yaa-f0X-Xf20a-f21.7222Y-Yf24.5a-f0Z-Zf0.5m-Xf17.5-Yf0-Zf0m-Xf0-Yf0-Zf0m_+*f6.12323e-17Y*f1Z+*f-1Y*f6.12323e-17Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f6.12323e-17X*f1ZY+*f-1X*f6.12323e-17Zm-Xf-0-Yf0-Zf-0am__f1iaaa-f0X-Xf20a-f0Y-Yf24.5nm-Xf0-Yf0-Zf0m_+*f1Y*f0Z+*f-0Y*f1Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f0.984808X*f-0.173648Y+*f0.173648X*f0.984808Y_m-Xf-0-Yf-0-Zf0m-Xf13.9286-Yf16.6667-Zf0aaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f0.951057Y+*f-0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f0.587785Y+*f-0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f-0.587785Y+*f0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f-0.951057Y+*f0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Yaa-f0X-Xf20a-f21.7222Y-Yf24.5a-f0Z-Zf0.5',float('-0.500000'),float('-20.000000'),float('0.000000'),float('17.500000'),float('0.000000'),float('24.500000'))", "name": "array", "type": "_fabtypes.Shape", "uid": 7 } ], "inspector": [ 618.99513071550746, 299.02674512446242 ], "name": "a0", "script": [ "import fab", "", "title('Array (2D)')", "", "input('shape', fab.types.Shape)", "input('_x', float)", "input('_y', float)", "input('i', int)", "input('j', int)", "input('dx', float)", "input('dy', float)", "", "output('array', fab.shapes.iterate2d(shape, i, j, dx, dy))", "", "# UI", "sb.ui.wireframe([", " (_x + dx, _y, 0), (_x, _y, 0), (_x, _y + dy, 0)], color=sb.color.teal)", "sb.ui.wireframe([", " (_x + dx, _y - 0.3, 0), (_x + dx, _y + 0.3, 0)], color=sb.color.teal)", "sb.ui.wireframe([", " (_x + 0.3, _y + dy, 0), (_x - 0.3, _y + dy, 0)], color=sb.color.teal)", "", "sb.ui.point(_x, _y, 0, color=sb.color.teal)", "sb.ui.point(_x + dx, _y, 0, color=sb.color.teal, drag=(dx, None, None))", "sb.ui.point(_x, _y + dy, 0, color=sb.color.teal, drag=(None, dy, None))", "" ], "uid": 11 }, { "datums": [ { "expr": "-v.wood", "name": "xmin", "type": "float", "uid": 0 }, { "expr": "-v.depth - v.wood", "name": "ymin", "type": "float", "uid": 1 }, { "expr": "8.6 * v.height /10", "name": "zmin", "type": "float", "uid": 2 }, { "expr": "v.width ", "name": "xmax", "type": "float", "uid": 3 }, { "expr": "-v.depth ", "name": "ymax", "type": "float", "uid": 4 }, { "expr": "v.height", "name": "zmax", "type": "float", "uid": 5 }, { "expr": "\u0012fab.types.Shape('am__f1aa-f-0.5X-Xf17.5a-f-20.5Y-Yf-20a-f21.5Z-Zf25',float('-0.500000'),float('-20.500000'),float('21.500000'),float('17.500000'),float('-20.000000'),float('25.000000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 6 } ], "inspector": [ 480.50577483671054, -486.30965644386333 ], "name": "fronttop", "script": [ "import fab", "", "title('Top front')", "", "input('xmin', float)", "input('ymin', float)", "input('zmin', float)", "input('xmax', float)", "input('ymax', float)", "input('zmax', float)", "", "output('shape', fab.shapes.cube(xmin, xmax, ymin, ymax, zmin, zmax))", "", "# UI", "sb.ui.wireframe([(xmin, ymin, zmin), (xmax, ymin, zmin),", " (xmax, ymax, zmin), (xmin, ymax, zmin)], close=True, color=sb.color.teal)", "sb.ui.wireframe([(xmin, ymin, zmax), (xmax, ymin, zmax),", " (xmax, ymax, zmax), (xmin, ymax, zmax)], close=True, color=sb.color.teal)", "sb.ui.wireframe([(xmin, ymin, zmin), (xmin, ymax, zmin),", " (xmin, ymax, zmax), (xmin, ymin, zmax)], close=True, color=sb.color.teal)", "sb.ui.wireframe([(xmax, ymin, zmin), (xmax, ymax, zmin),", " (xmax, ymax, zmax), (xmax, ymin, zmax)], close=True, color=sb.color.teal)", "sb.ui.point(xmin, ymin, zmin, color=sb.color.teal)", "sb.ui.point(xmax, ymax, zmax, color=sb.color.teal)", "" ], "uid": 13 }, { "datums": [ { "expr": "-v.wood", "name": "xmin", "type": "float", "uid": 0 }, { "expr": "-v.depth - v.wood", "name": "ymin", "type": "float", "uid": 1 }, { "expr": "0", "name": "zmin", "type": "float", "uid": 2 }, { "expr": "v.width", "name": "xmax", "type": "float", "uid": 3 }, { "expr": "-v.depth", "name": "ymax", "type": "float", "uid": 4 }, { "expr": "v.height / 5.", "name": "zmax", "type": "float", "uid": 5 }, { "expr": "\u0012fab.types.Shape('am__f1aa-f-0.5X-Xf17.5a-f-20.5Y-Yf-20a-f0Z-Zf5',float('-0.500000'),float('-20.500000'),float('0.000000'),float('17.500000'),float('-20.000000'),float('5.000000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 6 } ], "inspector": [ 553.19528157220748, -210.89399365525429 ], "name": "frontbottom", "script": [ "import fab", "", "title('Bottom front')", "", "input('xmin', float)", "input('ymin', float)", "input('zmin', float)", "input('xmax', float)", "input('ymax', float)", "input('zmax', float)", "", "output('shape', fab.shapes.cube(xmin, xmax, ymin, ymax, zmin, zmax))", "", "# UI", "sb.ui.wireframe([(xmin, ymin, zmin), (xmax, ymin, zmin),", " (xmax, ymax, zmin), (xmin, ymax, zmin)], close=True)", "sb.ui.wireframe([(xmin, ymin, zmax), (xmax, ymin, zmax),", " (xmax, ymax, zmax), (xmin, ymax, zmax)], close=True)", "sb.ui.wireframe([(xmin, ymin, zmin), (xmin, ymax, zmin),", " (xmin, ymax, zmax), (xmin, ymin, zmax)], close=True)", "sb.ui.wireframe([(xmax, ymin, zmin), (xmax, ymax, zmin),", " (xmax, ymax, zmax), (xmax, ymin, zmax)], close=True)", "sb.ui.point(xmin, ymin, zmin)", "sb.ui.point(xmax, ymax, zmax)", "" ], "uid": 12 }, { "datums": [ { "expr": "-v.wood", "name": "xmin", "type": "float", "uid": 0 }, { "expr": "-v.depth ", "name": "ymin", "type": "float", "uid": 1 }, { "expr": "v.height - v.wood", "name": "zmin", "type": "float", "uid": 2 }, { "expr": "v.width", "name": "xmax", "type": "float", "uid": 3 }, { "expr": "0", "name": "ymax", "type": "float", "uid": 4 }, { "expr": "v.height ", "name": "zmax", "type": "float", "uid": 5 }, { "expr": "\u0012fab.types.Shape('am__f1aa-f-0.5X-Xf17.5a-f-20Y-Yf0a-f24.5Z-Zf25',float('-0.500000'),float('-20.000000'),float('24.500000'),float('17.500000'),float('0.000000'),float('25.000000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 6 } ], "inspector": [ 1072.9671496178876, -308.8006047753808 ], "name": "top", "script": [ "import fab", "", "title('Top')", "", "input('xmin', float)", "input('ymin', float)", "input('zmin', float)", "input('xmax', float)", "input('ymax', float)", "input('zmax', float)", "", "output('shape', fab.shapes.cube(xmin, xmax, ymin, ymax, zmin, zmax))", "", "# UI", "sb.ui.wireframe([(xmin, ymin, zmin), (xmax, ymin, zmin),", " (xmax, ymax, zmin), (xmin, ymax, zmin)], close=True)", "sb.ui.wireframe([(xmin, ymin, zmax), (xmax, ymin, zmax),", " (xmax, ymax, zmax), (xmin, ymax, zmax)], close=True)", "sb.ui.wireframe([(xmin, ymin, zmin), (xmin, ymax, zmin),", " (xmin, ymax, zmax), (xmin, ymin, zmax)], close=True)", "sb.ui.wireframe([(xmax, ymin, zmin), (xmax, ymax, zmin),", " (xmax, ymax, zmax), (xmax, ymin, zmax)], close=True)", "sb.ui.point(xmin, ymin, zmin)", "sb.ui.point(xmax, ymax, zmax)", "" ], "uid": 14 }, { "datums": [ { "expr": "0", "name": "x0", "type": "float", "uid": 0 }, { "expr": "0", "name": "y0", "type": "float", "uid": 1 }, { "expr": "v.depth", "name": "x1", "type": "float", "uid": 2 }, { "expr": "v.height - v.wood", "name": "y1", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f0X-Xf20a-f0Y-Yf24.5',float('0.000000'),float('0.000000'),float('-inf'),float('20.000000'),float('24.500000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -504.98143371633887, -406.79059938260627 ], "name": "r0", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Rectangle (corner)')", "", "input('x0', float)", "input('y0', float)", "input('x1', float)", "input('y1', float)", "", "output('shape', fab.shapes.rectangle(x0, x1, y0, y1))", "", "# UI", "sb.ui.wireframe([(x0, y0, 0), (x1, y0, 0),", " (x1, y1, 0), (x0, y1, 0)], close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(x1, y1)", "", "" ], "uid": 0 }, { "datums": [ { "expr": "-v.wood/2", "name": "xmin", "type": "float", "uid": 0 }, { "expr": "0", "name": "ymin", "type": "float", "uid": 1 }, { "expr": "0", "name": "zmin", "type": "float", "uid": 2 }, { "expr": "v.width - v.wood/2", "name": "xmax", "type": "float", "uid": 3 }, { "expr": "v.wood", "name": "ymax", "type": "float", "uid": 4 }, { "expr": "v.height - (fronttop.zmax - fronttop.zmin) + v.wood", "name": "zmax", "type": "float", "uid": 5 }, { "expr": "\u0012fab.types.Shape('am__f1aa-f-0.25X-Xf17.25a-f0Y-Yf0.5a-f0Z-Zf22',float('-0.250000'),float('0.000000'),float('0.000000'),float('17.250000'),float('0.500000'),float('22.000000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 6 } ], "inspector": [ -255.45804621433555, 730.33662881954092 ], "name": "c3", "script": [ "import fab", "", "title('Back (raw)')", "", "input('xmin', float)", "input('ymin', float)", "input('zmin', float)", "input('xmax', float)", "input('ymax', float)", "input('zmax', float)", "", "output('shape', fab.shapes.cube(xmin, xmax, ymin, ymax, zmin, zmax))", "", "# UI", "sb.ui.wireframe([(xmin, ymin, zmin), (xmax, ymin, zmin),", " (xmax, ymax, zmin), (xmin, ymax, zmin)], close=True)", "sb.ui.wireframe([(xmin, ymin, zmax), (xmax, ymin, zmax),", " (xmax, ymax, zmax), (xmin, ymax, zmax)], close=True)", "sb.ui.wireframe([(xmin, ymin, zmin), (xmin, ymax, zmin),", " (xmin, ymax, zmax), (xmin, ymin, zmax)], close=True)", "sb.ui.wireframe([(xmax, ymin, zmin), (xmax, ymax, zmin),", " (xmax, ymax, zmax), (xmax, ymin, zmax)], close=True)", "sb.ui.point(xmin, ymin, zmin)", "sb.ui.point(xmax, ymax, zmax)", "" ], "uid": 15 }, { "datums": [ { "expr": "0.0", "name": "_x", "type": "float", "uid": 0 }, { "expr": "0.0", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "z", "type": "float", "uid": 2 }, { "expr": "10", "name": "a", "type": "float", "uid": 3 }, { "expr": "\u0011[__22.__5]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf0-Zf0m_+*f0.984808Y*f0.173648Z+*f-0.173648Y*f0.984808Zm-Xf0-Yf-0-Zf-0am__f1aaaa-f-0.5X-Xf17.5a-f-12Y-Yf0nm-Xf0-Yf0-Zf0im-Xf0-Yf0-Zf0-r+q-Xf4.18729q-Yf-6.6f0.565m-Xf8.62541-Yf0-Zf0-r+q-Xf4.18729q-Yf-6.6f0.565n-r+q-Xf8.5q-Yf-2.26f0.565a-f0Z-Zf0.5',float('-0.500000'),float('-11.904521'),float('-2.083776'),float('17.500000'),float('0.000000'),float('0.492404'))", "name": "rotated", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 1590.5054108477075, 327.24917120304303 ], "name": "r6", "script": [ "import fab", "import math", "", "title('Rotate (X)')", "", "input('_x', float)", "input('y', float)", "input('z', float)", "input('a', float)", "", "input('shape', fab.types.Shape)", "output('rotated', fab.shapes.rotate_x(shape, a, y, z))", "", "# UI", "rad = math.radians(a)", "sb.ui.wireframe([(_x, y + math.cos(rad), z + math.sin(rad)),", " (_x, y, z),", " (_x, y + 1, z)], color=sb.color.teal)", "", "# Draw a semi-circular arc showing the rotation", "if int(a) % 360 != 0:", " sb.ui.wireframe([", " (_x, y + math.cos(math.radians(a_)) * 0.3,", " z + math.sin(math.radians(a_)) * 0.3)", " for a_ in range(int(a) % 360)], color=sb.color.teal)", "", "sb.ui.point(_x, y, z, color=sb.color.teal)", "", "def drag_pt(this, x, y, z):", " this.a = math.degrees(math.atan2(z - this.z, y - this.y))", "sb.ui.point(_x, y + math.cos(rad), z + math.sin(rad),", " color=sb.color.teal, drag=drag_pt, relative=False)", "", "" ], "uid": 17 }, { "datums": [ { "expr": "-v.wood", "name": "x0", "type": "float", "uid": 0 }, { "expr": "-v.depth * (3/5)", "name": "y0", "type": "float", "uid": 1 }, { "expr": "v.width", "name": "x1", "type": "float", "uid": 2 }, { "expr": "0", "name": "y1", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f-0.5X-Xf17.5a-f-12Y-Yf0',float('-0.500000'),float('-12.000000'),float('-inf'),float('17.500000'),float('0.000000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 952.12953654884404, 817.27139254762972 ], "name": "panel", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Control panel (2D)')", "", "input('x0', float)", "input('y0', float)", "input('x1', float)", "input('y1', float)", "", "output('shape', fab.shapes.rectangle(x0, x1, y0, y1))", "", "# UI", "sb.ui.wireframe([(x0, y0, 0), (x1, y0, 0),", " (x1, y1, 0), (x0, y1, 0)], close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(x1, y1)", "", "" ], "uid": 18 }, { "datums": [ { "expr": "\u0011[__18.__4]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__21.__7]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aaa-f-0.5X-Xf17.5a-f-12Y-Yf0nm-Xf0-Yf0-Zf0im-Xf0-Yf0-Zf0-r+q-Xf4.18729q-Yf-6.6f0.565m-Xf8.62541-Yf0-Zf0-r+q-Xf4.18729q-Yf-6.6f0.565',float('-0.500000'),float('-12.000000'),float('-inf'),float('17.500000'),float('0.000000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 1273.1995275502918, 723.20791730756753 ], "name": "d1", "script": [ "import fab.types", "", "title('Difference')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 20 }, { "datums": [ { "expr": "\u0011[__19.__4]", "name": "shape", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "0.0", "name": "_x", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "_y", "type": "float", "uid": 2 }, { "expr": "2", "name": "i", "type": "int", "uid": 3 }, { "expr": "1", "name": "j", "type": "int", "uid": 4 }, { "expr": "(panel.x1-panel.x0) - 2 * (c5.x0 - panel.x0)", "name": "dx", "type": "float", "uid": 5 }, { "expr": "0", "name": "dy", "type": "float", "uid": 6 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf0-Zf0im-Xf0-Yf0-Zf0-r+q-Xf4.18729q-Yf-6.6f0.565m-Xf8.62541-Yf0-Zf0-r+q-Xf4.18729q-Yf-6.6f0.565',float('3.622295'),float('-7.165000'),float('-inf'),float('13.377705'),float('-6.035000'),float('inf'))", "name": "array", "type": "_fabtypes.Shape", "uid": 7 } ], "inspector": [ 1261.4662792203849, 924.09963828325522 ], "name": "a1", "script": [ "import fab", "", "title('Array (2D)')", "", "input('shape', fab.types.Shape)", "input('_x', float)", "input('_y', float)", "input('i', int)", "input('j', int)", "input('dx', float)", "input('dy', float)", "", "output('array', fab.shapes.iterate2d(shape, i, j, dx, dy))", "", "# UI", "sb.ui.wireframe([", " (_x + dx, _y, 0), (_x, _y, 0), (_x, _y + dy, 0)], color=sb.color.teal)", "sb.ui.wireframe([", " (_x + dx, _y - 0.3, 0), (_x + dx, _y + 0.3, 0)], color=sb.color.teal)", "sb.ui.wireframe([", " (_x + 0.3, _y + dy, 0), (_x - 0.3, _y + dy, 0)], color=sb.color.teal)", "", "sb.ui.point(_x, _y, 0, color=sb.color.teal)", "sb.ui.point(_x + dx, _y, 0, color=sb.color.teal, drag=(dx, None, None))", "sb.ui.point(_x, _y + dy, 0, color=sb.color.teal, drag=(None, dy, None))", "" ], "uid": 21 }, { "datums": [ { "expr": "4.187294960021973", "name": "x0", "type": "float", "uid": 0 }, { "expr": "panel.y0 + 9 *(panel.y1 - panel.y0)/20", "name": "y0", "type": "float", "uid": 1 }, { "expr": "v.buttonDiameter / 2", "name": "r", "type": "float", "uid": 2 }, { "expr": "-0.49019436699459895", "name": "_a", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('-r+q-Xf4.18729q-Yf-6.6f0.565',float('3.622295'),float('-7.165000'),float('-inf'),float('4.752295'),float('-6.035000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 956.28072581806055, 1049.1203641801415 ], "name": "c5", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/18", "", "import fab", "import math", "", "title('Player button')", "", "input('x0',float)", "input('y0',float)", "input('r',float)", "input('_a',float)", "", "output('shape', fab.shapes.circle(x0, y0, r))", "", "def drag_r(this,x,y,z):", " dx = x - this.x0", " dy = y - this.y0", " this.r = math.sqrt(dx**2 + dy**2)", " this._a = math.atan2(dy, dx)", "", "# UI", "sb.ui.wireframe([", " (math.cos(i/36. * 2*math.pi) * r + x0,", " math.sin(i/36. * 2*math.pi) * r + y0, 0)", " for i in range(36)], close=True)", "sb.ui.point(x0,y0)", "sb.ui.point(x0 + r*math.cos(_a),", " y0 + r*math.sin(_a),", " drag=drag_r, relative=False)", "", "" ], "uid": 19 }, { "datums": [ { "expr": "0.0", "name": "_x", "type": "float", "uid": 0 }, { "expr": "0.0", "name": "_y", "type": "float", "uid": 1 }, { "expr": "0", "name": "zmin", "type": "float", "uid": 2 }, { "expr": "v.wood", "name": "zmax", "type": "float", "uid": 3 }, { "expr": "\u0011[__24.__2]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('am__f1aaaa-f-0.5X-Xf17.5a-f-12Y-Yf0nm-Xf0-Yf0-Zf0im-Xf0-Yf0-Zf0-r+q-Xf4.18729q-Yf-6.6f0.565m-Xf8.62541-Yf0-Zf0-r+q-Xf4.18729q-Yf-6.6f0.565n-r+q-Xf8.5q-Yf-2.26f0.565a-f0Z-Zf0.5',float('-0.500000'),float('-12.000000'),float('0.000000'),float('17.500000'),float('0.000000'),float('0.500000'))", "name": "out", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 1601.72102482165, 771.24558914123122 ], "name": "e1", "script": [ "import fab", "", "title('Control Panel (final)')", "", "input('_x', float)", "input('_y', float)", "input('zmin', float)", "input('zmax', float)", "", "input('shape', fab.types.Shape)", "output('out', fab.shapes.extrude_z(shape, zmin, zmax))", "", "# UI", "sb.ui.wireframe([(_x, _y, zmin), (_x, _y, zmax)], color=sb.color.green)", "sb.ui.point(_x, _y, zmin, color=sb.color.green)", "sb.ui.point(_x, _y, zmax, color=sb.color.green)", "", "" ], "uid": 22 }, { "datums": [ { "expr": "panel.x0 + (panel.x1 - panel.x0)/2", "name": "x0", "type": "float", "uid": 0 }, { "expr": "panel.y1 - v.buttonDiameter * 2", "name": "y0", "type": "float", "uid": 1 }, { "expr": "v.buttonDiameter/2", "name": "r", "type": "float", "uid": 2 }, { "expr": "0", "name": "_a", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('-r+q-Xf8.5q-Yf-2.26f0.565',float('7.935000'),float('-2.825000'),float('-inf'),float('9.065000'),float('-1.695000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 951.31185124165563, 1254.0764876330979 ], "name": "c6", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/18", "", "import fab", "import math", "", "title('Reset button')", "", "input('x0',float)", "input('y0',float)", "input('r',float)", "input('_a',float)", "", "output('shape', fab.shapes.circle(x0, y0, r))", "", "def drag_r(this,x,y,z):", " dx = x - this.x0", " dy = y - this.y0", " this.r = math.sqrt(dx**2 + dy**2)", " this._a = math.atan2(dy, dx)", "", "# UI", "sb.ui.wireframe([", " (math.cos(i/36. * 2*math.pi) * r + x0,", " math.sin(i/36. * 2*math.pi) * r + y0, 0)", " for i in range(36)], close=True)", "sb.ui.point(x0,y0)", "sb.ui.point(x0 + r*math.cos(_a),", " y0 + r*math.sin(_a),", " drag=drag_r, relative=False)", "", "" ], "uid": 23 }, { "datums": [ { "expr": "\u0011[__20.__2]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__23.__4]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aaaa-f-0.5X-Xf17.5a-f-12Y-Yf0nm-Xf0-Yf0-Zf0im-Xf0-Yf0-Zf0-r+q-Xf4.18729q-Yf-6.6f0.565m-Xf8.62541-Yf0-Zf0-r+q-Xf4.18729q-Yf-6.6f0.565n-r+q-Xf8.5q-Yf-2.26f0.565',float('-0.500000'),float('-12.000000'),float('-inf'),float('17.500000'),float('0.000000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 1303.0406172300793, 1273.0131585593172 ], "name": "d2", "script": [ "import fab.types", "", "title('Difference')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 24 }, { "datums": [ { "expr": "0.0", "name": "_x", "type": "float", "uid": 0 }, { "expr": "0.0", "name": "_y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "_z", "type": "float", "uid": 2 }, { "expr": "0", "name": "dx", "type": "float", "uid": 3 }, { "expr": "-9.5", "name": "dy", "type": "float", "uid": 4 }, { "expr": "7", "name": "dz", "type": "float", "uid": 5 }, { "expr": "\u0011[__17.__5]", "name": "shape", "type": "_fabtypes.Shape", "uid": 6 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf-9.5-Zf7m-Xf0-Yf0-Zf0m_+*f0.984808Y*f0.173648Z+*f-0.173648Y*f0.984808Zm-Xf0-Yf-0-Zf-0am__f1aaaa-f-0.5X-Xf17.5a-f-12Y-Yf0nm-Xf0-Yf0-Zf0im-Xf0-Yf0-Zf0-r+q-Xf4.18729q-Yf-6.6f0.565m-Xf8.62541-Yf0-Zf0-r+q-Xf4.18729q-Yf-6.6f0.565n-r+q-Xf8.5q-Yf-2.26f0.565a-f0Z-Zf0.5',float('-0.500000'),float('-21.404522'),float('4.916224'),float('17.500000'),float('-9.500000'),float('7.492404'))", "name": "out", "type": "_fabtypes.Shape", "uid": 7 } ], "inspector": [ 1926.3647378883657, 378.55119464361303 ], "name": "controller", "script": [ "import fab", "", "title('Panel')", "", "input('_x', float)", "input('_y', float)", "input('_z', float)", "input('dx', float)", "input('dy', float)", "input('dz', float)", "", "input('shape', fab.types.Shape)", "output('out', fab.shapes.translate(shape, dx, dy, dz))", "", "# UI", "sb.ui.wireframe([(_x, _y, _z),", " (_x + dx, _y + dy, _z + dz)], color=sb.color.teal)", "sb.ui.wireframe([(_x, _y - 0.3, _z),", " (_x, _y + 0.3, _z)], color=sb.color.teal)", "sb.ui.wireframe([(_x - 0.3, _y, _z),", " (_x + 0.3, _y, _z)], color=sb.color.teal)", "sb.ui.wireframe([(_x, _y, _z - 0.3),", " (_x, _y, _z + 0.3)], color=sb.color.teal)", "", "sb.ui.point(_x, _y, _z, color=sb.color.teal)", "sb.ui.point(_x + dx, _y + dy, _z + dz, color=sb.color.teal, drag=(dx, dy, dz))", "" ], "uid": 16 }, { "datums": [ { "expr": "v.width/2", "name": "x", "type": "float", "uid": 0 }, { "expr": "0", "name": "ymin", "type": "float", "uid": 1 }, { "expr": "v.wood", "name": "ymax", "type": "float", "uid": 2 }, { "expr": "v.height / 5", "name": "z", "type": "float", "uid": 3 }, { "expr": "1.5", "name": "r", "type": "float", "uid": 4 }, { "expr": "\u0012fab.types.Shape('a-r+q-Xf8.75q-Zf5f1.5a-f0Y-Yf0.5',float('7.250000'),float('0.000000'),float('3.500000'),float('10.250000'),float('0.500000'),float('6.500000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ -299.49274361719245, 1016.9825538655748 ], "name": "c4", "script": [ "import fab", "import math", "", "title('Power hole')", "", "input('x', float)", "input('ymin', float)", "input('ymax', float)", "input('z', float)", "input('r', float)", "", "output('shape', fab.shapes.cylinder_y(x, ymin, ymax, z, r))", "", "# UI", "sb.ui.wireframe([(x, ymin, z), (x, ymax, z)])", "sb.ui.wireframe([(x, ymin, z), (x+r, ymin, z)])", "", "sb.ui.wireframe([", " (math.cos(i/36. * 2*math.pi) * r + x, ymin,", " math.sin(i/36. * 2*math.pi) * r + z)", " for i in range(36)], close=True)", "", "sb.ui.wireframe([", " (math.cos(i/36. * 2*math.pi) * r + x, ymax,", " math.sin(i/36. * 2*math.pi) * r + z)", " for i in range(36)], close=True)", "", "sb.ui.point(x, ymin, z)", "sb.ui.point(x, ymax, z)", "sb.ui.point(x+r, ymin, z, drag=(r, None, None))", "" ], "uid": 25 }, { "datums": [ { "expr": "\u0011[__28.__2]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__25.__5]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aaam__f1aa-f-0.25X-Xf17.25a-f0Y-Yf0.5a-f0Z-Zf22na-r+q-Xf2.565q-Zf2.565f0.565a-f0Y-Yf0.5na-r+q-Xf8.75q-Zf5f1.5a-f0Y-Yf0.5',float('-0.250000'),float('0.000000'),float('0.000000'),float('17.250000'),float('0.500000'),float('22.000000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 307.41162792474711, 697.13850159445451 ], "name": "back", "script": [ "import fab.types", "", "title('Back')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 26 }, { "datums": [ { "expr": "2 + v.buttonDiameter/2", "name": "x", "type": "float", "uid": 0 }, { "expr": "0", "name": "ymin", "type": "float", "uid": 1 }, { "expr": "v.wood", "name": "ymax", "type": "float", "uid": 2 }, { "expr": "2 + v.buttonDiameter/2", "name": "z", "type": "float", "uid": 3 }, { "expr": "v.buttonDiameter / 2", "name": "r", "type": "float", "uid": 4 }, { "expr": "\u0012fab.types.Shape('a-r+q-Xf2.565q-Zf2.565f0.565a-f0Y-Yf0.5',float('2.000000'),float('0.000000'),float('2.000000'),float('3.130000'),float('0.500000'),float('3.130000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ -333.96672849399158, 1269.0735682771681 ], "name": "c7", "script": [ "import fab", "import math", "", "title('Reset button')", "", "input('x', float)", "input('ymin', float)", "input('ymax', float)", "input('z', float)", "input('r', float)", "", "output('shape', fab.shapes.cylinder_y(x, ymin, ymax, z, r))", "", "# UI", "sb.ui.wireframe([(x, ymin, z), (x, ymax, z)])", "sb.ui.wireframe([(x, ymin, z), (x+r, ymin, z)])", "", "sb.ui.wireframe([", " (math.cos(i/36. * 2*math.pi) * r + x, ymin,", " math.sin(i/36. * 2*math.pi) * r + z)", " for i in range(36)], close=True)", "", "sb.ui.wireframe([", " (math.cos(i/36. * 2*math.pi) * r + x, ymax,", " math.sin(i/36. * 2*math.pi) * r + z)", " for i in range(36)], close=True)", "", "sb.ui.point(x, ymin, z)", "sb.ui.point(x, ymax, z)", "sb.ui.point(x+r, ymin, z, drag=(r, None, None))", "" ], "uid": 27 }, { "datums": [ { "expr": "\u0011[__15.__6]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__27.__5]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aam__f1aa-f-0.25X-Xf17.25a-f0Y-Yf0.5a-f0Z-Zf22na-r+q-Xf2.565q-Zf2.565f0.565a-f0Y-Yf0.5',float('-0.250000'),float('0.000000'),float('0.000000'),float('17.250000'),float('0.500000'),float('22.000000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ -168.06067627439577, 1575.0301840587606 ], "name": "d4", "script": [ "import fab.types", "", "title('Difference')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 28 }, { "datums": [ { "expr": "-v.wood/2", "name": "xmin", "type": "float", "uid": 0 }, { "expr": "0", "name": "ymin", "type": "float", "uid": 1 }, { "expr": "0", "name": "zmin", "type": "float", "uid": 2 }, { "expr": "v.width - v.wood/2", "name": "xmax", "type": "float", "uid": 3 }, { "expr": "14.5", "name": "ymax", "type": "float", "uid": 4 }, { "expr": "v.wood", "name": "zmax", "type": "float", "uid": 5 }, { "expr": "\u0012fab.types.Shape('am__f1aa-f-0.25X-Xf17.25a-f0Y-Yf14.5a-f0Z-Zf0.5',float('-0.250000'),float('0.000000'),float('0.000000'),float('17.250000'),float('14.500000'),float('0.500000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 6 } ], "inspector": [ 120.3034023141654, 1036.4276618684389 ], "name": "c8", "script": [ "import fab", "", "title('Monitor back plate (raw)')", "", "input('xmin', float)", "input('ymin', float)", "input('zmin', float)", "input('xmax', float)", "input('ymax', float)", "input('zmax', float)", "", "output('shape', fab.shapes.cube(xmin, xmax, ymin, ymax, zmin, zmax))", "", "# UI", "sb.ui.wireframe([(xmin, ymin, zmin), (xmax, ymin, zmin),", " (xmax, ymax, zmin), (xmin, ymax, zmin)], close=True)", "sb.ui.wireframe([(xmin, ymin, zmax), (xmax, ymin, zmax),", " (xmax, ymax, zmax), (xmin, ymax, zmax)], close=True)", "sb.ui.wireframe([(xmin, ymin, zmin), (xmin, ymax, zmin),", " (xmin, ymax, zmax), (xmin, ymin, zmax)], close=True)", "sb.ui.wireframe([(xmax, ymin, zmin), (xmax, ymax, zmin),", " (xmax, ymax, zmax), (xmax, ymin, zmax)], close=True)", "sb.ui.point(xmin, ymin, zmin)", "sb.ui.point(xmax, ymax, zmax)", "" ], "uid": 29 }, { "datums": [ { "expr": "0.0", "name": "_x", "type": "float", "uid": 0 }, { "expr": "0.0", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "z", "type": "float", "uid": 2 }, { "expr": "82", "name": "a", "type": "float", "uid": 3 }, { "expr": "\u0011[__29.__6]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf0-Zf0m_+*f0.139173Y*f0.990268Z+*f-0.990268Y*f0.139173Zm-Xf0-Yf-0-Zf-0am__f1aa-f-0.25X-Xf17.25a-f0Y-Yf14.5a-f0Z-Zf0.5',float('-0.250000'),float('-0.495134'),float('0.000000'),float('17.250000'),float('2.018008'),float('14.428473'))", "name": "rotated", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 386.83113433774474, 1014.3648153723259 ], "name": "r7", "script": [ "import fab", "import math", "", "title('Rotate (X)')", "", "input('_x', float)", "input('y', float)", "input('z', float)", "input('a', float)", "", "input('shape', fab.types.Shape)", "output('rotated', fab.shapes.rotate_x(shape, a, y, z))", "", "# UI", "rad = math.radians(a)", "sb.ui.wireframe([(_x, y + math.cos(rad), z + math.sin(rad)),", " (_x, y, z),", " (_x, y + 1, z)], color=sb.color.teal)", "", "# Draw a semi-circular arc showing the rotation", "if int(a) % 360 != 0:", " sb.ui.wireframe([", " (_x, y + math.cos(math.radians(a_)) * 0.3,", " z + math.sin(math.radians(a_)) * 0.3)", " for a_ in range(int(a) % 360)], color=sb.color.teal)", "", "sb.ui.point(_x, y, z, color=sb.color.teal)", "", "def drag_pt(this, x, y, z):", " this.a = math.degrees(math.atan2(z - this.z, y - this.y))", "sb.ui.point(_x, y + math.cos(rad), z + math.sin(rad),", " color=sb.color.teal, drag=drag_pt, relative=False)", "", "" ], "uid": 30 }, { "datums": [ { "expr": "0.0", "name": "_x", "type": "float", "uid": 0 }, { "expr": "0.0", "name": "_y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "_z", "type": "float", "uid": 2 }, { "expr": "0", "name": "dx", "type": "float", "uid": 3 }, { "expr": "-v.depth/2 + v.wood*2 + 2.25", "name": "dy", "type": "float", "uid": 4 }, { "expr": "v.height/6 + 1", "name": "dz", "type": "float", "uid": 5 }, { "expr": "\u0011[__30.__5]", "name": "shape", "type": "_fabtypes.Shape", "uid": 6 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf-6.75-Zf5.16667m-Xf0-Yf0-Zf0m_+*f0.139173Y*f0.990268Z+*f-0.990268Y*f0.139173Zm-Xf0-Yf-0-Zf-0am__f1aa-f-0.25X-Xf17.25a-f0Y-Yf14.5a-f0Z-Zf0.5',float('-0.250000'),float('-7.245134'),float('5.166670'),float('17.250000'),float('-4.731992'),float('19.595142'))", "name": "out", "type": "_fabtypes.Shape", "uid": 7 } ], "inspector": [ 443.48135942881436, 1337.8524401359186 ], "name": "t1", "script": [ "import fab", "", "title('Monitor back plate')", "", "input('_x', float)", "input('_y', float)", "input('_z', float)", "input('dx', float)", "input('dy', float)", "input('dz', float)", "", "input('shape', fab.types.Shape)", "output('out', fab.shapes.translate(shape, dx, dy, dz))", "", "# UI", "sb.ui.wireframe([(_x, _y, _z),", " (_x + dx, _y + dy, _z + dz)], color=sb.color.teal)", "sb.ui.wireframe([(_x, _y - 0.3, _z),", " (_x, _y + 0.3, _z)], color=sb.color.teal)", "sb.ui.wireframe([(_x - 0.3, _y, _z),", " (_x + 0.3, _y, _z)], color=sb.color.teal)", "sb.ui.wireframe([(_x, _y, _z - 0.3),", " (_x, _y, _z + 0.3)], color=sb.color.teal)", "", "sb.ui.point(_x, _y, _z, color=sb.color.teal)", "sb.ui.point(_x + dx, _y + dy, _z + dz, color=sb.color.teal, drag=(dx, dy, dz))", "" ], "uid": 31 }, { "datums": [ { "expr": "\u0011[__11.__7]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__31.__7]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('am-Xf0-Yf0-Zf0im-Xf0-Yf0-Zf0m-Xf0-Yf0-Zf0m_+*f6.12323e-17Y*f1Z+*f-1Y*f6.12323e-17Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f6.12323e-17X*f1ZY+*f-1X*f6.12323e-17Zm-Xf-0-Yf0-Zf-0am__f1iaaa-f0X-Xf20a-f0Y-Yf24.5nm-Xf0-Yf0-Zf0m_+*f1Y*f0Z+*f-0Y*f1Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f0.984808X*f-0.173648Y+*f0.173648X*f0.984808Y_m-Xf-0-Yf-0-Zf0m-Xf13.9286-Yf16.6667-Zf0aaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f0.951057Y+*f-0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f0.587785Y+*f-0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f-0.587785Y+*f0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f-0.951057Y+*f0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Yaa-f0X-Xf20a-f21.7222Y-Yf24.5a-f0Z-Zf0.5m-Xf17.5-Yf0-Zf0m-Xf0-Yf0-Zf0m_+*f6.12323e-17Y*f1Z+*f-1Y*f6.12323e-17Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f6.12323e-17X*f1ZY+*f-1X*f6.12323e-17Zm-Xf-0-Yf0-Zf-0am__f1iaaa-f0X-Xf20a-f0Y-Yf24.5nm-Xf0-Yf0-Zf0m_+*f1Y*f0Z+*f-0Y*f1Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f0.984808X*f-0.173648Y+*f0.173648X*f0.984808Y_m-Xf-0-Yf-0-Zf0m-Xf13.9286-Yf16.6667-Zf0aaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f0.951057Y+*f-0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f0.587785Y+*f-0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f-0.587785Y+*f0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f-0.951057Y+*f0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Yaa-f0X-Xf20a-f21.7222Y-Yf24.5a-f0Z-Zf0.5nm-Xf0-Yf-6.75-Zf5.16667m-Xf0-Yf0-Zf0m_+*f0.139173Y*f0.990268Z+*f-0.990268Y*f0.139173Zm-Xf0-Yf-0-Zf-0am__f1aa-f-0.25X-Xf17.25a-f0Y-Yf14.5a-f0Z-Zf0.5',float('-0.500000'),float('-20.000000'),float('0.000000'),float('17.500000'),float('0.000000'),float('24.500000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 925.74878792121103, 334.33857446682612 ], "name": "d5", "script": [ "import fab.types", "", "title('Difference')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 32 }, { "datums": [ { "expr": "-v.wood/2", "name": "xmin", "type": "float", "uid": 0 }, { "expr": "-v.depth", "name": "ymin", "type": "float", "uid": 1 }, { "expr": "fronttop.zmin", "name": "zmin", "type": "float", "uid": 2 }, { "expr": "v.width - v.wood/2", "name": "xmax", "type": "float", "uid": 3 }, { "expr": "-v.depth * 1/3", "name": "ymax", "type": "float", "uid": 4 }, { "expr": "fronttop.zmin + v.wood", "name": "zmax", "type": "float", "uid": 5 }, { "expr": "\u0012fab.types.Shape('am__f1aa-f-0.25X-Xf17.25a-f-20Y-Yf-6.66667a-f21.5Z-Zf22',float('-0.250000'),float('-20.000000'),float('21.500000'),float('17.250000'),float('-6.666667'),float('22.000000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 6 } ], "inspector": [ 1659.322170575582, -303.83330247794208 ], "name": "c10", "script": [ "import fab", "", "title('Top shelf')", "", "input('xmin', float)", "input('ymin', float)", "input('zmin', float)", "input('xmax', float)", "input('ymax', float)", "input('zmax', float)", "", "output('shape', fab.shapes.cube(xmin, xmax, ymin, ymax, zmin, zmax))", "", "# UI", "sb.ui.wireframe([(xmin, ymin, zmin), (xmax, ymin, zmin),", " (xmax, ymax, zmin), (xmin, ymax, zmin)], close=True)", "sb.ui.wireframe([(xmin, ymin, zmax), (xmax, ymin, zmax),", " (xmax, ymax, zmax), (xmin, ymax, zmax)], close=True)", "sb.ui.wireframe([(xmin, ymin, zmin), (xmin, ymax, zmin),", " (xmin, ymax, zmax), (xmin, ymin, zmax)], close=True)", "sb.ui.wireframe([(xmax, ymin, zmin), (xmax, ymax, zmin),", " (xmax, ymax, zmax), (xmax, ymin, zmax)], close=True)", "sb.ui.point(xmin, ymin, zmin)", "sb.ui.point(xmax, ymax, zmax)", "" ], "uid": 34 }, { "datums": [ { "expr": "\u0011[__34.__6]", "name": "shape", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0012fab.types.Shape('am__f1aa-f-0.25X-Xf17.25a-f-20Y-Yf-6.66667a-f21.5Z-Zf22',float('-0.250000'),float('-20.000000'),float('21.500000'),float('17.250000'),float('-6.666667'),float('22.000000'))", "name": "copy", "type": "_fabtypes.Shape", "uid": 1 } ], "inspector": [ 1622.8273477391572, 51.41753685935754 ], "name": "shelf", "script": [ "# Neil Gershenfeld 2/14/15", "# Matt Keeter 6/12/15", "", "import fab", "", "title('Copy')", "", "input('shape', fab.types.Shape)", "output('copy', shape)", "", "" ], "uid": 35 }, { "datums": [ { "expr": "\u0011[__32.__2]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__34.__6]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aam-Xf0-Yf0-Zf0im-Xf0-Yf0-Zf0m-Xf0-Yf0-Zf0m_+*f6.12323e-17Y*f1Z+*f-1Y*f6.12323e-17Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f6.12323e-17X*f1ZY+*f-1X*f6.12323e-17Zm-Xf-0-Yf0-Zf-0am__f1iaaa-f0X-Xf20a-f0Y-Yf24.5nm-Xf0-Yf0-Zf0m_+*f1Y*f0Z+*f-0Y*f1Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f0.984808X*f-0.173648Y+*f0.173648X*f0.984808Y_m-Xf-0-Yf-0-Zf0m-Xf13.9286-Yf16.6667-Zf0aaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f0.951057Y+*f-0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f0.587785Y+*f-0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f-0.587785Y+*f0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f-0.951057Y+*f0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Yaa-f0X-Xf20a-f21.7222Y-Yf24.5a-f0Z-Zf0.5m-Xf17.5-Yf0-Zf0m-Xf0-Yf0-Zf0m_+*f6.12323e-17Y*f1Z+*f-1Y*f6.12323e-17Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f6.12323e-17X*f1ZY+*f-1X*f6.12323e-17Zm-Xf-0-Yf0-Zf-0am__f1iaaa-f0X-Xf20a-f0Y-Yf24.5nm-Xf0-Yf0-Zf0m_+*f1Y*f0Z+*f-0Y*f1Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f0.984808X*f-0.173648Y+*f0.173648X*f0.984808Y_m-Xf-0-Yf-0-Zf0m-Xf13.9286-Yf16.6667-Zf0aaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f0.951057Y+*f-0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f0.587785Y+*f-0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f-0.587785Y+*f0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f-0.951057Y+*f0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Yaa-f0X-Xf20a-f21.7222Y-Yf24.5a-f0Z-Zf0.5nm-Xf0-Yf-6.75-Zf5.16667m-Xf0-Yf0-Zf0m_+*f0.139173Y*f0.990268Z+*f-0.990268Y*f0.139173Zm-Xf0-Yf-0-Zf-0am__f1aa-f-0.25X-Xf17.25a-f0Y-Yf14.5a-f0Z-Zf0.5nam__f1aa-f-0.25X-Xf17.25a-f-20Y-Yf-6.66667a-f21.5Z-Zf22',float('-0.500000'),float('-20.000000'),float('0.000000'),float('17.500000'),float('0.000000'),float('24.500000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 1225.0116985362376, 342.08595013726449 ], "name": "d6", "script": [ "import fab.types", "", "title('Difference')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 36 }, { "datums": [ { "expr": "c8.xmin", "name": "xmin", "type": "float", "uid": 0 }, { "expr": "0", "name": "ymin", "type": "float", "uid": 1 }, { "expr": "0", "name": "zmin", "type": "float", "uid": 2 }, { "expr": "c8.xmax", "name": "xmax", "type": "float", "uid": 3 }, { "expr": "2.25", "name": "ymax", "type": "float", "uid": 4 }, { "expr": "v.wood", "name": "zmax", "type": "float", "uid": 5 }, { "expr": "\u0012fab.types.Shape('am__f1aa-f-0.25X-Xf17.25a-f0Y-Yf2.25a-f0Z-Zf0.5',float('-0.250000'),float('0.000000'),float('0.000000'),float('17.250000'),float('2.250000'),float('0.500000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 6 } ], "inspector": [ 234.18784599477488, 1577.9049773229219 ], "name": "c9", "script": [ "import fab", "", "title('Cube (corner)')", "", "input('xmin', float)", "input('ymin', float)", "input('zmin', float)", "input('xmax', float)", "input('ymax', float)", "input('zmax', float)", "", "output('shape', fab.shapes.cube(xmin, xmax, ymin, ymax, zmin, zmax))", "", "# UI", "sb.ui.wireframe([(xmin, ymin, zmin), (xmax, ymin, zmin),", " (xmax, ymax, zmin), (xmin, ymax, zmin)], close=True)", "sb.ui.wireframe([(xmin, ymin, zmax), (xmax, ymin, zmax),", " (xmax, ymax, zmax), (xmin, ymax, zmax)], close=True)", "sb.ui.wireframe([(xmin, ymin, zmin), (xmin, ymax, zmin),", " (xmin, ymax, zmax), (xmin, ymin, zmax)], close=True)", "sb.ui.wireframe([(xmax, ymin, zmin), (xmax, ymax, zmin),", " (xmax, ymax, zmax), (xmax, ymin, zmax)], close=True)", "sb.ui.point(xmin, ymin, zmin)", "sb.ui.point(xmax, ymax, zmax)", "" ], "uid": 33 }, { "datums": [ { "expr": "0.0", "name": "_x", "type": "float", "uid": 0 }, { "expr": "0.0", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "z", "type": "float", "uid": 2 }, { "expr": "-10", "name": "a", "type": "float", "uid": 3 }, { "expr": "\u0011[__43.__2]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf0-Zf0m_+*f0.984808Y*f-0.173648Z+*f0.173648Y*f0.984808Zm-Xf0-Yf-0-Zf-0aam__f1aa-f-0.25X-Xf17.25a-f0Y-Yf2.25a-f0Z-Zf0.5nam__f1aa-f1.75X-Xf15.25a-f0.5Y-Yf1.75a-f0Z-Zf0.5',float('-0.250000'),float('0.000000'),float('-0.390708'),float('17.250000'),float('2.302642'),float('0.492404'))", "name": "rotated", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 613.89256613987754, 1593.2818624092774 ], "name": "r8", "script": [ "import fab", "import math", "", "title('Rotate (X)')", "", "input('_x', float)", "input('y', float)", "input('z', float)", "input('a', float)", "", "input('shape', fab.types.Shape)", "output('rotated', fab.shapes.rotate_x(shape, a, y, z))", "", "# UI", "rad = math.radians(a)", "sb.ui.wireframe([(_x, y + math.cos(rad), z + math.sin(rad)),", " (_x, y, z),", " (_x, y + 1, z)], color=sb.color.teal)", "", "# Draw a semi-circular arc showing the rotation", "if int(a) % 360 != 0:", " sb.ui.wireframe([", " (_x, y + math.cos(math.radians(a_)) * 0.3,", " z + math.sin(math.radians(a_)) * 0.3)", " for a_ in range(int(a) % 360)], color=sb.color.teal)", "", "sb.ui.point(_x, y, z, color=sb.color.teal)", "", "def drag_pt(this, x, y, z):", " this.a = math.degrees(math.atan2(z - this.z, y - this.y))", "sb.ui.point(_x, y + math.cos(rad), z + math.sin(rad),", " color=sb.color.teal, drag=drag_pt, relative=False)", "", "" ], "uid": 37 }, { "datums": [ { "expr": "0.0", "name": "_x", "type": "float", "uid": 0 }, { "expr": "0.0", "name": "_y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "_z", "type": "float", "uid": 2 }, { "expr": "0", "name": "dx", "type": "float", "uid": 3 }, { "expr": "-v.depth/2 + v.wood ", "name": "dy", "type": "float", "uid": 4 }, { "expr": "t1.dz + v.wood", "name": "dz", "type": "float", "uid": 5 }, { "expr": "\u0011[__37.__5]", "name": "shape", "type": "_fabtypes.Shape", "uid": 6 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf-9.5-Zf5.66667m-Xf0-Yf0-Zf0m_+*f0.984808Y*f-0.173648Z+*f0.173648Y*f0.984808Zm-Xf0-Yf-0-Zf-0aam__f1aa-f-0.25X-Xf17.25a-f0Y-Yf2.25a-f0Z-Zf0.5nam__f1aa-f1.75X-Xf15.25a-f0.5Y-Yf1.75a-f0Z-Zf0.5',float('-0.250000'),float('-9.500000'),float('5.275962'),float('17.250000'),float('-7.197358'),float('6.159074'))", "name": "out", "type": "_fabtypes.Shape", "uid": 7 } ], "inspector": [ 544.92148240247218, 1863.3630398524972 ], "name": "t2", "script": [ "import fab", "", "title('Monitor rest')", "", "input('_x', float)", "input('_y', float)", "input('_z', float)", "input('dx', float)", "input('dy', float)", "input('dz', float)", "", "input('shape', fab.types.Shape)", "output('out', fab.shapes.translate(shape, dx, dy, dz))", "", "# UI", "sb.ui.wireframe([(_x, _y, _z),", " (_x + dx, _y + dy, _z + dz)], color=sb.color.teal)", "sb.ui.wireframe([(_x, _y - 0.3, _z),", " (_x, _y + 0.3, _z)], color=sb.color.teal)", "sb.ui.wireframe([(_x - 0.3, _y, _z),", " (_x + 0.3, _y, _z)], color=sb.color.teal)", "sb.ui.wireframe([(_x, _y, _z - 0.3),", " (_x, _y, _z + 0.3)], color=sb.color.teal)", "", "sb.ui.point(_x, _y, _z, color=sb.color.teal)", "sb.ui.point(_x + dx, _y + dy, _z + dz, color=sb.color.teal, drag=(dx, dy, dz))", "" ], "uid": 38 }, { "datums": [ { "expr": "\u0011[__31.__7]", "name": "shape", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf-6.75-Zf5.16667m-Xf0-Yf0-Zf0m_+*f0.139173Y*f0.990268Z+*f-0.990268Y*f0.139173Zm-Xf0-Yf-0-Zf-0am__f1aa-f-0.25X-Xf17.25a-f0Y-Yf14.5a-f0Z-Zf0.5',float('-0.250000'),float('-7.245134'),float('5.166670'),float('17.250000'),float('-4.731992'),float('19.595142'))", "name": "copy", "type": "_fabtypes.Shape", "uid": 1 } ], "inspector": [ 753.46736923140952, 1472.6324563471035 ], "name": "monitor", "script": [ "# Neil Gershenfeld 2/14/15", "# Matt Keeter 6/12/15", "", "import fab", "", "title('Copy')", "", "input('shape', fab.types.Shape)", "output('copy', shape)", "", "" ], "uid": 40 }, { "datums": [ { "expr": "\u0011[__38.__7]", "name": "shape", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf-9.5-Zf5.66667m-Xf0-Yf0-Zf0m_+*f0.984808Y*f-0.173648Z+*f0.173648Y*f0.984808Zm-Xf0-Yf-0-Zf-0aam__f1aa-f-0.25X-Xf17.25a-f0Y-Yf2.25a-f0Z-Zf0.5nam__f1aa-f1.75X-Xf15.25a-f0.5Y-Yf1.75a-f0Z-Zf0.5',float('-0.250000'),float('-9.500000'),float('5.275962'),float('17.250000'),float('-7.197358'),float('6.159074'))", "name": "copy", "type": "_fabtypes.Shape", "uid": 1 } ], "inspector": [ 1196.8769393460025, 1765.3119964497816 ], "name": "monitorrest", "script": [ "# Neil Gershenfeld 2/14/15", "# Matt Keeter 6/12/15", "", "import fab", "", "title('Copy')", "", "input('shape', fab.types.Shape)", "output('copy', shape)", "", "" ], "uid": 42 }, { "datums": [ { "expr": "\u0011[__36.__2]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__38.__7]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aaam-Xf0-Yf0-Zf0im-Xf0-Yf0-Zf0m-Xf0-Yf0-Zf0m_+*f6.12323e-17Y*f1Z+*f-1Y*f6.12323e-17Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f6.12323e-17X*f1ZY+*f-1X*f6.12323e-17Zm-Xf-0-Yf0-Zf-0am__f1iaaa-f0X-Xf20a-f0Y-Yf24.5nm-Xf0-Yf0-Zf0m_+*f1Y*f0Z+*f-0Y*f1Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f0.984808X*f-0.173648Y+*f0.173648X*f0.984808Y_m-Xf-0-Yf-0-Zf0m-Xf13.9286-Yf16.6667-Zf0aaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f0.951057Y+*f-0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f0.587785Y+*f-0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f-0.587785Y+*f0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f-0.951057Y+*f0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Yaa-f0X-Xf20a-f21.7222Y-Yf24.5a-f0Z-Zf0.5m-Xf17.5-Yf0-Zf0m-Xf0-Yf0-Zf0m_+*f6.12323e-17Y*f1Z+*f-1Y*f6.12323e-17Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f6.12323e-17X*f1ZY+*f-1X*f6.12323e-17Zm-Xf-0-Yf0-Zf-0am__f1iaaa-f0X-Xf20a-f0Y-Yf24.5nm-Xf0-Yf0-Zf0m_+*f1Y*f0Z+*f-0Y*f1Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f0.984808X*f-0.173648Y+*f0.173648X*f0.984808Y_m-Xf-0-Yf-0-Zf0m-Xf13.9286-Yf16.6667-Zf0aaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f0.951057Y+*f-0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f0.587785Y+*f-0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f-0.587785Y+*f0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f-0.951057Y+*f0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Yaa-f0X-Xf20a-f21.7222Y-Yf24.5a-f0Z-Zf0.5nm-Xf0-Yf-6.75-Zf5.16667m-Xf0-Yf0-Zf0m_+*f0.139173Y*f0.990268Z+*f-0.990268Y*f0.139173Zm-Xf0-Yf-0-Zf-0am__f1aa-f-0.25X-Xf17.25a-f0Y-Yf14.5a-f0Z-Zf0.5nam__f1aa-f-0.25X-Xf17.25a-f-20Y-Yf-6.66667a-f21.5Z-Zf22nm-Xf0-Yf-9.5-Zf5.66667m-Xf0-Yf0-Zf0m_+*f0.984808Y*f-0.173648Z+*f0.173648Y*f0.984808Zm-Xf0-Yf-0-Zf-0aam__f1aa-f-0.25X-Xf17.25a-f0Y-Yf2.25a-f0Z-Zf0.5nam__f1aa-f1.75X-Xf15.25a-f0.5Y-Yf1.75a-f0Z-Zf0.5',float('-0.500000'),float('-20.000000'),float('0.000000'),float('17.500000'),float('0.000000'),float('24.500000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 1295.2669443288557, 501.52275569596679 ], "name": "sides", "script": [ "import fab.types", "", "title('Difference')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 44 }, { "datums": [ { "expr": "\u0011[__13.__6]", "name": "fronttop", "type": "_fabtypes.Shape", "uid": 10 }, { "expr": "\u0011[__12.__6]", "name": "frontbottom", "type": "_fabtypes.Shape", "uid": 19 }, { "expr": "\u0011[__26.__2]", "name": "back", "type": "_fabtypes.Shape", "uid": 25 }, { "expr": "\u0011[__14.__6]", "name": "top", "type": "_fabtypes.Shape", "uid": 22 }, { "expr": "\u0011[__35.__1]", "name": "shelf", "type": "_fabtypes.Shape", "uid": 35 }, { "expr": "\u0011[__40.__1]", "name": "monitor", "type": "_fabtypes.Shape", "uid": 42 }, { "expr": "\u0011[__42.__1]", "name": "monitorrest", "type": "_fabtypes.Shape", "uid": 46 }, { "expr": "\u0011[__16.__7]", "name": "panel", "type": "_fabtypes.Shape", "uid": 51 }, { "expr": "\u0011[__44.__2]", "name": "sides", "type": "_fabtypes.Shape", "uid": 55 }, { "expr": "\u0012fab.types.Shape('iiiiiiiiam__f1aa-f-0.5X-Xf17.5a-f-20.5Y-Yf-20a-f21.5Z-Zf25am__f1aa-f-0.5X-Xf17.5a-f-20.5Y-Yf-20a-f0Z-Zf5aaam__f1aa-f-0.25X-Xf17.25a-f0Y-Yf0.5a-f0Z-Zf22na-r+q-Xf2.565q-Zf2.565f0.565a-f0Y-Yf0.5na-r+q-Xf8.75q-Zf5f1.5a-f0Y-Yf0.5am__f1aa-f-0.5X-Xf17.5a-f-20Y-Yf0a-f24.5Z-Zf25am__f1aa-f-0.25X-Xf17.25a-f-20Y-Yf-6.66667a-f21.5Z-Zf22m-Xf0-Yf-6.75-Zf5.16667m-Xf0-Yf0-Zf0m_+*f0.139173Y*f0.990268Z+*f-0.990268Y*f0.139173Zm-Xf0-Yf-0-Zf-0am__f1aa-f-0.25X-Xf17.25a-f0Y-Yf14.5a-f0Z-Zf0.5m-Xf0-Yf-9.5-Zf5.66667m-Xf0-Yf0-Zf0m_+*f0.984808Y*f-0.173648Z+*f0.173648Y*f0.984808Zm-Xf0-Yf-0-Zf-0aam__f1aa-f-0.25X-Xf17.25a-f0Y-Yf2.25a-f0Z-Zf0.5nam__f1aa-f1.75X-Xf15.25a-f0.5Y-Yf1.75a-f0Z-Zf0.5m-Xf0-Yf-9.5-Zf7m-Xf0-Yf0-Zf0m_+*f0.984808Y*f0.173648Z+*f-0.173648Y*f0.984808Zm-Xf0-Yf-0-Zf-0am__f1aaaa-f-0.5X-Xf17.5a-f-12Y-Yf0nm-Xf0-Yf0-Zf0im-Xf0-Yf0-Zf0-r+q-Xf4.18729q-Yf-6.6f0.565m-Xf8.62541-Yf0-Zf0-r+q-Xf4.18729q-Yf-6.6f0.565n-r+q-Xf8.5q-Yf-2.26f0.565a-f0Z-Zf0.5aaam-Xf0-Yf0-Zf0im-Xf0-Yf0-Zf0m-Xf0-Yf0-Zf0m_+*f6.12323e-17Y*f1Z+*f-1Y*f6.12323e-17Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f6.12323e-17X*f1ZY+*f-1X*f6.12323e-17Zm-Xf-0-Yf0-Zf-0am__f1iaaa-f0X-Xf20a-f0Y-Yf24.5nm-Xf0-Yf0-Zf0m_+*f1Y*f0Z+*f-0Y*f1Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f0.984808X*f-0.173648Y+*f0.173648X*f0.984808Y_m-Xf-0-Yf-0-Zf0m-Xf13.9286-Yf16.6667-Zf0aaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f0.951057Y+*f-0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f0.587785Y+*f-0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f-0.587785Y+*f0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f-0.951057Y+*f0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Yaa-f0X-Xf20a-f21.7222Y-Yf24.5a-f0Z-Zf0.5m-Xf17.5-Yf0-Zf0m-Xf0-Yf0-Zf0m_+*f6.12323e-17Y*f1Z+*f-1Y*f6.12323e-17Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f6.12323e-17X*f1ZY+*f-1X*f6.12323e-17Zm-Xf-0-Yf0-Zf-0am__f1iaaa-f0X-Xf20a-f0Y-Yf24.5nm-Xf0-Yf0-Zf0m_+*f1Y*f0Z+*f-0Y*f1Zm-Xf0-Yf-0-Zf-0m-Xf0-Yf0-Zf0m+*f0.984808X*f-0.173648Y+*f0.173648X*f0.984808Y_m-Xf-0-Yf-0-Zf0m-Xf13.9286-Yf16.6667-Zf0aaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f0.951057Y+*f-0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f0.587785Y+*f-0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f-0.809017X*f-0.587785Y+*f0.587785X*f-0.809017Y_m-Xf0-Yf0-Zf0-f-8.09017Ym-Xf0-Yf0-Zf0m+*f0.309017X*f-0.951057Y+*f0.951057X*f0.309017Y_m-Xf0-Yf0-Zf0-f-8.09017Yaa-f0X-Xf20a-f21.7222Y-Yf24.5a-f0Z-Zf0.5nm-Xf0-Yf-6.75-Zf5.16667m-Xf0-Yf0-Zf0m_+*f0.139173Y*f0.990268Z+*f-0.990268Y*f0.139173Zm-Xf0-Yf-0-Zf-0am__f1aa-f-0.25X-Xf17.25a-f0Y-Yf14.5a-f0Z-Zf0.5nam__f1aa-f-0.25X-Xf17.25a-f-20Y-Yf-6.66667a-f21.5Z-Zf22nm-Xf0-Yf-9.5-Zf5.66667m-Xf0-Yf0-Zf0m_+*f0.984808Y*f-0.173648Z+*f0.173648Y*f0.984808Zm-Xf0-Yf-0-Zf-0aam__f1aa-f-0.25X-Xf17.25a-f0Y-Yf2.25a-f0Z-Zf0.5nam__f1aa-f1.75X-Xf15.25a-f0.5Y-Yf1.75a-f0Z-Zf0.5',float('-0.500000'),float('-21.404522'),float('0.000000'),float('17.500000'),float('0.500000'),float('25.000000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 2363.9458175841214, 493.29698296652907 ], "name": "u0", "script": [ "import fab.types", "", "title('Union')", "input('fronttop', fab.types.Shape)", "input('frontbottom', fab.types.Shape)", "input('back', fab.types.Shape)", "input('top', fab.types.Shape)", "input('shelf', fab.types.Shape)", "input('monitor', fab.types.Shape)", "input('monitorrest', fab.types.Shape)", "input('panel', fab.types.Shape)", "input('sides', fab.types.Shape)", "", "output('shape', fronttop | frontbottom | back | top | shelf | monitor | monitorrest | panel | sides )", "", "sb.export.stl(sides)", "" ], "uid": 39 }, { "datums": [ { "expr": "\u0011[__33.__6]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__45.__6]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aam__f1aa-f-0.25X-Xf17.25a-f0Y-Yf2.25a-f0Z-Zf0.5nam__f1aa-f1.75X-Xf15.25a-f0.5Y-Yf1.75a-f0Z-Zf0.5',float('-0.250000'),float('0.000000'),float('0.000000'),float('17.250000'),float('2.250000'),float('0.500000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 366.93018115281927, 2146.1593408052922 ], "name": "d8", "script": [ "import fab.types", "", "title('Difference')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 43 }, { "datums": [ { "expr": "c9.xmin + 2", "name": "xmin", "type": "float", "uid": 0 }, { "expr": "c9.ymin + 0.5", "name": "ymin", "type": "float", "uid": 1 }, { "expr": "c9.zmin", "name": "zmin", "type": "float", "uid": 2 }, { "expr": "c9.xmax - 2", "name": "xmax", "type": "float", "uid": 3 }, { "expr": "c9.ymax - 0.5", "name": "ymax", "type": "float", "uid": 4 }, { "expr": "c9.zmax", "name": "zmax", "type": "float", "uid": 5 }, { "expr": "\u0012fab.types.Shape('am__f1aa-f1.75X-Xf15.25a-f0.5Y-Yf1.75a-f0Z-Zf0.5',float('1.750000'),float('0.500000'),float('0.000000'),float('15.250000'),float('1.750000'),float('0.500000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 6 } ], "inspector": [ 370.75237053982784, 2299.0469162856334 ], "name": "c13", "script": [ "import fab", "", "title('Cube (corner)')", "", "input('xmin', float)", "input('ymin', float)", "input('zmin', float)", "input('xmax', float)", "input('ymax', float)", "input('zmax', float)", "", "output('shape', fab.shapes.cube(xmin, xmax, ymin, ymax, zmin, zmax))", "", "# UI", "sb.ui.wireframe([(xmin, ymin, zmin), (xmax, ymin, zmin),", " (xmax, ymax, zmin), (xmin, ymax, zmin)], close=True)", "sb.ui.wireframe([(xmin, ymin, zmax), (xmax, ymin, zmax),", " (xmax, ymax, zmax), (xmin, ymax, zmax)], close=True)", "sb.ui.wireframe([(xmin, ymin, zmin), (xmin, ymax, zmin),", " (xmin, ymax, zmax), (xmin, ymin, zmax)], close=True)", "sb.ui.wireframe([(xmax, ymin, zmin), (xmax, ymax, zmin),", " (xmax, ymax, zmax), (xmax, ymin, zmax)], close=True)", "sb.ui.point(xmin, ymin, zmin)", "sb.ui.point(xmax, ymax, zmax)", "" ], "uid": 45 }, { "datums": [ { "expr": "fab.types.Shape('=1;')", "name": "shape", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0012fab.types.Shape('=1;')", "name": "out", "type": "_fabtypes.Shape", "uid": 1 } ], "inspector": [ 2449.5185995500833, 1028.5499684451445 ], "name": "m0", "script": [ "import fab", "", "title('Mesh (.stl)')", "", "input('shape', fab.types.Shape)", "output('out', shape)", "", "sb.export.stl(shape)", "" ], "uid": 41 }, { "datums": [ { "expr": "fab.types.Shape('=1;')", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "0", "name": "x0", "type": "float", "uid": 1 }, { "expr": "0", "name": "y0", "type": "float", "uid": 2 }, { "expr": "0", "name": "z0", "type": "float", "uid": 3 }, { "expr": "1", "name": "x1", "type": "float", "uid": 4 }, { "expr": "1", "name": "y1", "type": "float", "uid": 5 }, { "expr": "1", "name": "z1", "type": "float", "uid": 6 }, { "expr": "\u0012fab.types.Shape('m-Xf1-Yf1-Zf1=1;')", "name": "out", "type": "_fabtypes.Shape", "uid": 7 } ], "inspector": [ 1435.5322739811495, -564.76591608700448 ], "name": "s0", "script": [ "# Neil Gershenfeld 1/25/15", "# Matt Keeter 6/13/15", "", "import fab", "", "title('Set origin (XYZ)')", "", "input('a',fab.types.Shape)", "", "input('x0', float)", "input('y0', float)", "input('z0', float)", "input('x1', float)", "input('y1', float)", "input('z1', float)", "", "output('out', fab.shapes.origin_xyz(a, x0, y0, z0, x1, y1, z1))", "", "# UI", "sb.ui.wireframe([(x0, y0, z0), (x1, y1, z1)], color=sb.color.green)", "sb.ui.point(x0, y0, z0, color=sb.color.green)", "sb.ui.point(x1, y1, z1, color=sb.color.green)", "", "" ], "uid": 47 } ], "protocol": 6, "type": "sb" }