{ "nodes": [ { "datums": [ { "expr": "0", "name": "x", "type": "float", "uid": 0 }, { "expr": "0", "name": "y", "type": "float", "uid": 1 }, { "expr": "0", "name": "z", "type": "float", "uid": 2 }, { "expr": "3.3", "name": "width", "type": "float", "uid": 3 }, { "expr": "7.9", "name": "height", "type": "float", "uid": 4 }, { "expr": "3.66", "name": "depth", "type": "float", "uid": 5 }, { "expr": "\u0012fab.types.Shape('am__f1aa-f-1.65X-Xf1.65a-f-3.95Y-Yf3.95a-f-1.83Z-Zf1.83',float('-1.650000'),float('-3.950000'),float('-1.830000'),float('1.650000'),float('3.950000'),float('1.830000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 6 } ], "inspector": [ 3021.8935258080314, -78.378940730307761 ], "name": "c0", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 5/22/15", "", "import fab", "", "title('Cube (center)')", "", "input('x', float)", "input('y', float)", "input('z', float)", "input('width', float)", "input('height', float)", "input('depth', float)", "", "xmin, xmax = x - width/2, x + width/2", "ymin, ymax = y - height/2, y + height/2", "zmin, zmax = z - depth/2, z + depth/2", "", "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)", "", "def drag_hwd(this, dx,dy,dz):", " this.width += 2*dx", " this.height += 2*dy", " this.depth += 2*dz", "", "sb.ui.point(x, y, z)", "sb.ui.point(x + width/2.0, y + height/2.0, z + depth/2.0,", " drag=drag_hwd)", "", "" ], "uid": 0 }, { "datums": [ { "expr": "0", "name": "x", "type": "float", "uid": 0 }, { "expr": "0", "name": "y", "type": "float", "uid": 1 }, { "expr": "-1.66", "name": "z", "type": "float", "uid": 2 }, { "expr": "4", "name": "width", "type": "float", "uid": 3 }, { "expr": "5.50", "name": "height", "type": "float", "uid": 4 }, { "expr": "\u0011[__0.__5]", "name": "depth", "type": "float", "uid": 5 }, { "expr": "\u0012fab.types.Shape('am__f1aa-f-2X-Xf2a-f-2.75Y-Yf2.75a-f-3.49Z-Zf0.17',float('-2.000000'),float('-2.750000'),float('-3.490000'),float('2.000000'),float('2.750000'),float('0.170000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 6 } ], "inspector": [ 3033.1520800730182, 283.9522702554948 ], "name": "c1", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 5/22/15", "", "import fab", "", "title('Cube (center)')", "", "input('x', float)", "input('y', float)", "input('z', float)", "input('width', float)", "input('height', float)", "input('depth', float)", "", "xmin, xmax = x - width/2, x + width/2", "ymin, ymax = y - height/2, y + height/2", "zmin, zmax = z - depth/2, z + depth/2", "", "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)", "", "def drag_hwd(this, dx,dy,dz):", " this.width += 2*dx", " this.height += 2*dy", " this.depth += 2*dz", "", "sb.ui.point(x, y, z)", "sb.ui.point(x + width/2.0, y + height/2.0, z + depth/2.0,", " drag=drag_hwd)", "", "" ], "uid": 1 }, { "datums": [ { "expr": "\u0011[__0.__6]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__1.__6]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aam__f1aa-f-1.65X-Xf1.65a-f-3.95Y-Yf3.95a-f-1.83Z-Zf1.83nam__f1aa-f-2X-Xf2a-f-2.75Y-Yf2.75a-f-3.49Z-Zf0.17',float('-1.650000'),float('-3.950000'),float('-1.830000'),float('1.650000'),float('3.950000'),float('1.830000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 3331.4729095366606, 215.53458919526318 ], "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": "0.0", "name": "x", "type": "float", "uid": 0 }, { "expr": "4.4832", "name": "y", "type": "float", "uid": 1 }, { "expr": "-1.36683", "name": "z", "type": "float", "uid": 2 }, { "expr": "4.135540008544922", "name": "width", "type": "float", "uid": 3 }, { "expr": "1.9373283386230469", "name": "height", "type": "float", "uid": 4 }, { "expr": "2.780721664428711", "name": "depth", "type": "float", "uid": 5 }, { "expr": "\u0012fab.types.Shape('am__f1aa-f-2.06777X-Xf2.06777a-f3.51454Y-Yf5.45186a-f-2.75719Z-Zf0.0235308',float('-2.067770'),float('3.514536'),float('-2.757191'),float('2.067770'),float('5.451864'),float('0.023531'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 6 } ], "inspector": [ 2780.253910402143, 609.72265485010882 ], "name": "c2", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 5/22/15", "", "import fab", "", "title('Cube (center)')", "", "input('x', float)", "input('y', float)", "input('z', float)", "input('width', float)", "input('height', float)", "input('depth', float)", "", "xmin, xmax = x - width/2, x + width/2", "ymin, ymax = y - height/2, y + height/2", "zmin, zmax = z - depth/2, z + depth/2", "", "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)", "", "def drag_hwd(this, dx,dy,dz):", " this.width += 2*dx", " this.height += 2*dy", " this.depth += 2*dz", "", "sb.ui.point(x, y, z)", "sb.ui.point(x + width/2.0, y + height/2.0, z + depth/2.0,", " drag=drag_hwd)", "", "" ], "uid": 4 }, { "datums": [ { "expr": "0.0", "name": "_x", "type": "float", "uid": 0 }, { "expr": "0.0", "name": "y0", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "_z", "type": "float", "uid": 2 }, { "expr": "\u0011[__4.__6]", "name": "shape", "type": "_fabtypes.Shape", "uid": 3 }, { "expr": "\u0012fab.types.Shape('m_-*f2f0Y_am__f1aa-f-2.06777X-Xf2.06777a-f3.51454Y-Yf5.45186a-f-2.75719Z-Zf0.0235308',float('-2.067770'),float('-5.451864'),float('-2.757191'),float('2.067770'),float('-3.514536'),float('0.023531'))", "name": "reflected", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 2808.5740801120455, 1000.2506204521054 ], "name": "r0", "script": [ "import fab", "", "title('Reflect (Y)')", "", "input('_x', float)", "input('y0', float)", "input('_z', float)", "", "input('shape', fab.types.Shape)", "output('reflected', fab.shapes.reflect_y(shape, y0))", "", "# UI", "sb.ui.wireframe([", " (_x - 1, y0, _z + 1),", " (_x + 1, y0, _z + 1),", " (_x + 1, y0, _z - 1),", " (_x - 1, y0, _z - 1)], color=sb.color.teal, close=True)", "", "sb.ui.point(_x, y0, _z, color=sb.color.teal)", "", "" ], "uid": 5 }, { "datums": [ { "expr": "\u0011[__2.__2]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__7.__2]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aaam__f1aa-f-1.65X-Xf1.65a-f-3.95Y-Yf3.95a-f-1.83Z-Zf1.83nam__f1aa-f-2X-Xf2a-f-2.75Y-Yf2.75a-f-3.49Z-Zf0.17niam__f1aa-f-2.06777X-Xf2.06777a-f3.51454Y-Yf5.45186a-f-2.75719Z-Zf0.0235308m_-*f2f0Y_am__f1aa-f-2.06777X-Xf2.06777a-f3.51454Y-Yf5.45186a-f-2.75719Z-Zf0.0235308',float('-1.650000'),float('-3.950000'),float('-1.830000'),float('1.650000'),float('3.950000'),float('1.830000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 3632.7748610528242, 551.01953550354483 ], "name": "d1", "script": [ "import fab.types", "", "title('Difference')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 6 }, { "datums": [ { "expr": "\u0011[__5.__3]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__5.__4]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('iam__f1aa-f-2.06777X-Xf2.06777a-f3.51454Y-Yf5.45186a-f-2.75719Z-Zf0.0235308m_-*f2f0Y_am__f1aa-f-2.06777X-Xf2.06777a-f3.51454Y-Yf5.45186a-f-2.75719Z-Zf0.0235308',float('-2.067770'),float('-5.451864'),float('-2.757191'),float('2.067770'),float('5.451864'),float('0.023531'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 3166.7793874833405, 765.93420180077828 ], "name": "u0", "script": [ "import fab.types", "", "title('Union')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a | b)", "" ], "uid": 7 }, { "datums": [ { "expr": "\u0011[__6.__2]", "name": "shape", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0012fab.types.Shape('aaam__f1aa-f-1.65X-Xf1.65a-f-3.95Y-Yf3.95a-f-1.83Z-Zf1.83nam__f1aa-f-2X-Xf2a-f-2.75Y-Yf2.75a-f-3.49Z-Zf0.17niam__f1aa-f-2.06777X-Xf2.06777a-f3.51454Y-Yf5.45186a-f-2.75719Z-Zf0.0235308m_-*f2f0Y_am__f1aa-f-2.06777X-Xf2.06777a-f3.51454Y-Yf5.45186a-f-2.75719Z-Zf0.0235308',float('-1.650000'),float('-3.950000'),float('-1.830000'),float('1.650000'),float('3.950000'),float('1.830000'))", "name": "out", "type": "_fabtypes.Shape", "uid": 1 } ], "inspector": [ 4006.757462857257, 552.44375064510621 ], "name": "m0", "script": [ "import fab", "", "title('Mesh (.stl)')", "", "input('shape', fab.types.Shape)", "output('out', shape)", "", "sb.export.stl(shape)", "" ], "uid": 3 } ], "protocol": 6, "type": "sb" }