{ "nodes": [ { "datums": [ { "expr": "0", "name": "x0", "type": "float", "uid": 0 }, { "expr": "0", "name": "y0", "type": "float", "uid": 1 }, { "expr": "cb.w", "name": "width", "type": "float", "uid": 2 }, { "expr": ".004+cb.c", "name": "height", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f-0.25X-Xf0.25a-f-0.075Y-Yf0.075',float('-0.250000'),float('-0.075000'),float('-inf'),float('0.250000'),float('0.075000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -755.41914925375613, -495.7971961979141 ], "name": "r0", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Rectangle (center)')", "", "input('x0', float)", "input('y0', float)", "input('width', float)", "input('height', float)", "", "xmin, xmax = x0 - width/2, x0 + width/2", "ymin, ymax = y0 - height/2, y0 + height/2", "", "output('shape', fab.shapes.rectangle(xmin, xmax, ymin, ymax))", "", "def drag_hw(this, x, y, z):", " this.width = abs(2 * (x - this.x0))", " this.height = abs(2 * (y - this.y0))", "", "# UI", "sb.ui.wireframe(", " [(xmin, ymin, 0), (xmax, ymin, 0), (xmax, ymax, 0), (xmin, ymax, 0)],", " close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(xmax, ymax, drag=drag_hw, relative=False)", "" ], "uid": 0 }, { "datums": [ { "expr": ".146", "name": "c", "type": "float", "uid": 1 }, { "expr": "0.5", "name": "w", "type": "float", "uid": 0 } ], "inspector": [ -737.80043652629865, -733.48270679683162 ], "name": "cb", "script": [ "import fab", "", "title('script')", "input('c', float)", "input('w', float)", "" ], "uid": 1 }, { "datums": [ { "expr": "0", "name": "x0", "type": "float", "uid": 0 }, { "expr": ".5", "name": "y0", "type": "float", "uid": 1 }, { "expr": "cb.w", "name": "width", "type": "float", "uid": 2 }, { "expr": ".005+cb.c", "name": "height", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f-0.25X-Xf0.25a-f0.4245Y-Yf0.5755',float('-0.250000'),float('0.424500'),float('-inf'),float('0.250000'),float('0.575500'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -754.57270413396645, -307.19165544329189 ], "name": "r1", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Rectangle (center)')", "", "input('x0', float)", "input('y0', float)", "input('width', float)", "input('height', float)", "", "xmin, xmax = x0 - width/2, x0 + width/2", "ymin, ymax = y0 - height/2, y0 + height/2", "", "output('shape', fab.shapes.rectangle(xmin, xmax, ymin, ymax))", "", "def drag_hw(this, x, y, z):", " this.width = abs(2 * (x - this.x0))", " this.height = abs(2 * (y - this.y0))", "", "# UI", "sb.ui.wireframe(", " [(xmin, ymin, 0), (xmax, ymin, 0), (xmax, ymax, 0), (xmin, ymax, 0)],", " close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(xmax, ymax, drag=drag_hw, relative=False)", "" ], "uid": 2 }, { "datums": [ { "expr": "0", "name": "x0", "type": "float", "uid": 0 }, { "expr": "1", "name": "y0", "type": "float", "uid": 1 }, { "expr": "cb.w", "name": "width", "type": "float", "uid": 2 }, { "expr": ".006+cb.c", "name": "height", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f-0.25X-Xf0.25a-f0.924Y-Yf1.076',float('-0.250000'),float('0.924000'),float('-inf'),float('0.250000'),float('1.076000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -758.63050433154172, -120.31371762733312 ], "name": "r2", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Rectangle (center)')", "", "input('x0', float)", "input('y0', float)", "input('width', float)", "input('height', float)", "", "xmin, xmax = x0 - width/2, x0 + width/2", "ymin, ymax = y0 - height/2, y0 + height/2", "", "output('shape', fab.shapes.rectangle(xmin, xmax, ymin, ymax))", "", "def drag_hw(this, x, y, z):", " this.width = abs(2 * (x - this.x0))", " this.height = abs(2 * (y - this.y0))", "", "# UI", "sb.ui.wireframe(", " [(xmin, ymin, 0), (xmax, ymin, 0), (xmax, ymax, 0), (xmin, ymax, 0)],", " close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(xmax, ymax, drag=drag_hw, relative=False)", "" ], "uid": 3 }, { "datums": [ { "expr": "1", "name": "x0", "type": "float", "uid": 0 }, { "expr": "0", "name": "y0", "type": "float", "uid": 1 }, { "expr": "2", "name": "width", "type": "float", "uid": 2 }, { "expr": "5", "name": "height", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f0X-Xf2a-f-2.5Y-Yf2.5',float('0.000000'),float('-2.500000'),float('-inf'),float('2.000000'),float('2.500000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -452.59269832988855, -799.41618228539221 ], "name": "r3", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Rectangle (center)')", "", "input('x0', float)", "input('y0', float)", "input('width', float)", "input('height', float)", "", "xmin, xmax = x0 - width/2, x0 + width/2", "ymin, ymax = y0 - height/2, y0 + height/2", "", "output('shape', fab.shapes.rectangle(xmin, xmax, ymin, ymax))", "", "def drag_hw(this, x, y, z):", " this.width = abs(2 * (x - this.x0))", " this.height = abs(2 * (y - this.y0))", "", "# UI", "sb.ui.wireframe(", " [(xmin, ymin, 0), (xmax, ymin, 0), (xmax, ymax, 0), (xmin, ymax, 0)],", " close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(xmax, ymax, drag=drag_hw, relative=False)", "" ], "uid": 4 }, { "datums": [ { "expr": "0", "name": "x0", "type": "float", "uid": 0 }, { "expr": "1.5", "name": "y0", "type": "float", "uid": 1 }, { "expr": "cb.w", "name": "width", "type": "float", "uid": 2 }, { "expr": ".007+cb.c", "name": "height", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f-0.25X-Xf0.25a-f1.4235Y-Yf1.5765',float('-0.250000'),float('1.423500'),float('-inf'),float('0.250000'),float('1.576500'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -758.11322568737341, 74.648545688040912 ], "name": "r4", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Rectangle (center)')", "", "input('x0', float)", "input('y0', float)", "input('width', float)", "input('height', float)", "", "xmin, xmax = x0 - width/2, x0 + width/2", "ymin, ymax = y0 - height/2, y0 + height/2", "", "output('shape', fab.shapes.rectangle(xmin, xmax, ymin, ymax))", "", "def drag_hw(this, x, y, z):", " this.width = abs(2 * (x - this.x0))", " this.height = abs(2 * (y - this.y0))", "", "# UI", "sb.ui.wireframe(", " [(xmin, ymin, 0), (xmax, ymin, 0), (xmax, ymax, 0), (xmin, ymax, 0)],", " close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(xmax, ymax, drag=drag_hw, relative=False)", "" ], "uid": 5 }, { "datums": [ { "expr": "0", "name": "x0", "type": "float", "uid": 0 }, { "expr": "2", "name": "y0", "type": "float", "uid": 1 }, { "expr": "cb.w", "name": "width", "type": "float", "uid": 2 }, { "expr": ".008+cb.c", "name": "height", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f-0.25X-Xf0.25a-f1.923Y-Yf2.077',float('-0.250000'),float('1.923000'),float('-inf'),float('0.250000'),float('2.077000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -757.23768653628406, 265.83967803094987 ], "name": "r5", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Rectangle (center)')", "", "input('x0', float)", "input('y0', float)", "input('width', float)", "input('height', float)", "", "xmin, xmax = x0 - width/2, x0 + width/2", "ymin, ymax = y0 - height/2, y0 + height/2", "", "output('shape', fab.shapes.rectangle(xmin, xmax, ymin, ymax))", "", "def drag_hw(this, x, y, z):", " this.width = abs(2 * (x - this.x0))", " this.height = abs(2 * (y - this.y0))", "", "# UI", "sb.ui.wireframe(", " [(xmin, ymin, 0), (xmax, ymin, 0), (xmax, ymax, 0), (xmin, ymax, 0)],", " close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(xmax, ymax, drag=drag_hw, relative=False)", "" ], "uid": 6 }, { "datums": [ { "expr": "0", "name": "x0", "type": "float", "uid": 0 }, { "expr": "-1.5", "name": "y0", "type": "float", "uid": 1 }, { "expr": "cb.w", "name": "width", "type": "float", "uid": 2 }, { "expr": ".001+cb.c", "name": "height", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f-0.25X-Xf0.25a-f-1.5735Y-Yf-1.4265',float('-0.250000'),float('-1.573500'),float('-inf'),float('0.250000'),float('-1.426500'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -426.34973523095999, -123.03988568318306 ], "name": "r6", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Rectangle (center)')", "", "input('x0', float)", "input('y0', float)", "input('width', float)", "input('height', float)", "", "xmin, xmax = x0 - width/2, x0 + width/2", "ymin, ymax = y0 - height/2, y0 + height/2", "", "output('shape', fab.shapes.rectangle(xmin, xmax, ymin, ymax))", "", "def drag_hw(this, x, y, z):", " this.width = abs(2 * (x - this.x0))", " this.height = abs(2 * (y - this.y0))", "", "# UI", "sb.ui.wireframe(", " [(xmin, ymin, 0), (xmax, ymin, 0), (xmax, ymax, 0), (xmin, ymax, 0)],", " close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(xmax, ymax, drag=drag_hw, relative=False)", "" ], "uid": 7 }, { "datums": [ { "expr": "\u0011[__4.__4]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__0.__4,__2.__4,__3.__4,__5.__4,__6.__4,__7.__4,__10.__4,__12.__4,__13.__4]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aaa-f0X-Xf2a-f-2.5Y-Yf2.5niiiiiiiiaa-f-0.25X-Xf0.25a-f-0.075Y-Yf0.075aa-f-0.25X-Xf0.25a-f0.4245Y-Yf0.5755aa-f-0.25X-Xf0.25a-f0.924Y-Yf1.076aa-f-0.25X-Xf0.25a-f1.4235Y-Yf1.5765aa-f-0.25X-Xf0.25a-f1.923Y-Yf2.077aa-f-0.25X-Xf0.25a-f-1.5735Y-Yf-1.4265aa-f-0.25X-Xf0.25a-f-1.074Y-Yf-0.926aa-f-0.25X-Xf0.25a-f-0.5745Y-Yf-0.4255aa-f-0.25X-Xf0.25a-f-2.073Y-Yf-1.927',float('0.000000'),float('-2.500000'),float('-inf'),float('2.000000'),float('2.500000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ -79.711732533439132, -743.16573462328813 ], "name": "d0", "script": [ "import fab.types", "", "title('Difference')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 8 }, { "datums": [ { "expr": "\u0011[__8.__2]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__18.__4,__17.__4,__16.__4,__19.__4,__15.__4,__20.__4,__11.__4,__14.__4]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aaaa-f0X-Xf2a-f-2.5Y-Yf2.5niiiiiiiiaa-f-0.25X-Xf0.25a-f-0.075Y-Yf0.075aa-f-0.25X-Xf0.25a-f0.4245Y-Yf0.5755aa-f-0.25X-Xf0.25a-f0.924Y-Yf1.076aa-f-0.25X-Xf0.25a-f1.4235Y-Yf1.5765aa-f-0.25X-Xf0.25a-f1.923Y-Yf2.077aa-f-0.25X-Xf0.25a-f-1.5735Y-Yf-1.4265aa-f-0.25X-Xf0.25a-f-1.074Y-Yf-0.926aa-f-0.25X-Xf0.25a-f-0.5745Y-Yf-0.4255aa-f-0.25X-Xf0.25a-f-2.073Y-Yf-1.927niiiiiiiaa-f1.75X-Xf2.25a-f-1.5725Y-Yf-1.4275aa-f1.75X-Xf2.25a-f1.931Y-Yf2.069aa-f1.75X-Xf2.25a-f-0.071Y-Yf0.071aa-f1.75X-Xf2.25a-f0.93Y-Yf1.07aa-f1.75X-Xf2.25a-f-0.5715Y-Yf-0.4285aa-f1.75X-Xf2.25a-f0.4295Y-Yf0.5705aa-f1.75X-Xf2.25a-f-1.072Y-Yf-0.928aa-f1.75X-Xf2.25a-f1.4305Y-Yf1.5695',float('0.000000'),float('-2.500000'),float('-inf'),float('2.000000'),float('2.500000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 537.41887059581063, -567.19733414180246 ], "name": "d1", "script": [ "import fab.types", "", "title('Difference')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 9 }, { "datums": [ { "expr": "0", "name": "x0", "type": "float", "uid": 0 }, { "expr": "-1", "name": "y0", "type": "float", "uid": 1 }, { "expr": "cb.w", "name": "width", "type": "float", "uid": 2 }, { "expr": ".002+cb.c", "name": "height", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f-0.25X-Xf0.25a-f-1.074Y-Yf-0.926',float('-0.250000'),float('-1.074000'),float('-inf'),float('0.250000'),float('-0.926000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -428.05678104603538, 79.809163117782987 ], "name": "r7", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Rectangle (center)')", "", "input('x0', float)", "input('y0', float)", "input('width', float)", "input('height', float)", "", "xmin, xmax = x0 - width/2, x0 + width/2", "ymin, ymax = y0 - height/2, y0 + height/2", "", "output('shape', fab.shapes.rectangle(xmin, xmax, ymin, ymax))", "", "def drag_hw(this, x, y, z):", " this.width = abs(2 * (x - this.x0))", " this.height = abs(2 * (y - this.y0))", "", "# UI", "sb.ui.wireframe(", " [(xmin, ymin, 0), (xmax, ymin, 0), (xmax, ymax, 0), (xmin, ymax, 0)],", " close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(xmax, ymax, drag=drag_hw, relative=False)", "" ], "uid": 10 }, { "datums": [ { "expr": "0", "name": "x0", "type": "float", "uid": 0 }, { "expr": "-.5", "name": "y0", "type": "float", "uid": 1 }, { "expr": "cb.w", "name": "width", "type": "float", "uid": 2 }, { "expr": ".003+cb.c", "name": "height", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f-0.25X-Xf0.25a-f-0.5745Y-Yf-0.4255',float('-0.250000'),float('-0.574500'),float('-inf'),float('0.250000'),float('-0.425500'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -446.87204682901597, 274.62638147329267 ], "name": "r9", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Rectangle (center)')", "", "input('x0', float)", "input('y0', float)", "input('width', float)", "input('height', float)", "", "xmin, xmax = x0 - width/2, x0 + width/2", "ymin, ymax = y0 - height/2, y0 + height/2", "", "output('shape', fab.shapes.rectangle(xmin, xmax, ymin, ymax))", "", "def drag_hw(this, x, y, z):", " this.width = abs(2 * (x - this.x0))", " this.height = abs(2 * (y - this.y0))", "", "# UI", "sb.ui.wireframe(", " [(xmin, ymin, 0), (xmax, ymin, 0), (xmax, ymax, 0), (xmin, ymax, 0)],", " close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(xmax, ymax, drag=drag_hw, relative=False)", "" ], "uid": 12 }, { "datums": [ { "expr": "0", "name": "x0", "type": "float", "uid": 0 }, { "expr": "-2", "name": "y0", "type": "float", "uid": 1 }, { "expr": "cb.w", "name": "width", "type": "float", "uid": 2 }, { "expr": "cb.c", "name": "height", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f-0.25X-Xf0.25a-f-2.073Y-Yf-1.927',float('-0.250000'),float('-2.073000'),float('-inf'),float('0.250000'),float('-1.927000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -432.24243734695779, -312.74369282917189 ], "name": "r10", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Rectangle (center)')", "", "input('x0', float)", "input('y0', float)", "input('width', float)", "input('height', float)", "", "xmin, xmax = x0 - width/2, x0 + width/2", "ymin, ymax = y0 - height/2, y0 + height/2", "", "output('shape', fab.shapes.rectangle(xmin, xmax, ymin, ymax))", "", "def drag_hw(this, x, y, z):", " this.width = abs(2 * (x - this.x0))", " this.height = abs(2 * (y - this.y0))", "", "# UI", "sb.ui.wireframe(", " [(xmin, ymin, 0), (xmax, ymin, 0), (xmax, ymax, 0), (xmin, ymax, 0)],", " close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(xmax, ymax, drag=drag_hw, relative=False)", "" ], "uid": 13 }, { "datums": [ { "expr": "2", "name": "x0", "type": "float", "uid": 0 }, { "expr": "1.5", "name": "y0", "type": "float", "uid": 1 }, { "expr": "cb.w", "name": "width", "type": "float", "uid": 2 }, { "expr": "-.007+cb.c", "name": "height", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f1.75X-Xf2.25a-f1.4305Y-Yf1.5695',float('1.750000'),float('1.430500'),float('-inf'),float('2.250000'),float('1.569500'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -69.38008483660883, -315.56507462578827 ], "name": "r11", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Rectangle (center)')", "", "input('x0', float)", "input('y0', float)", "input('width', float)", "input('height', float)", "", "xmin, xmax = x0 - width/2, x0 + width/2", "ymin, ymax = y0 - height/2, y0 + height/2", "", "output('shape', fab.shapes.rectangle(xmin, xmax, ymin, ymax))", "", "def drag_hw(this, x, y, z):", " this.width = abs(2 * (x - this.x0))", " this.height = abs(2 * (y - this.y0))", "", "# UI", "sb.ui.wireframe(", " [(xmin, ymin, 0), (xmax, ymin, 0), (xmax, ymax, 0), (xmin, ymax, 0)],", " close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(xmax, ymax, drag=drag_hw, relative=False)", "" ], "uid": 14 }, { "datums": [ { "expr": "2", "name": "x0", "type": "float", "uid": 0 }, { "expr": "0", "name": "y0", "type": "float", "uid": 1 }, { "expr": "cb.w", "name": "width", "type": "float", "uid": 2 }, { "expr": "-.004+cb.c", "name": "height", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f1.75X-Xf2.25a-f-0.071Y-Yf0.071',float('1.750000'),float('-0.071000'),float('-inf'),float('2.250000'),float('0.071000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -70.751118723810578, 258.13960301399845 ], "name": "r13", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Rectangle (center)')", "", "input('x0', float)", "input('y0', float)", "input('width', float)", "input('height', float)", "", "xmin, xmax = x0 - width/2, x0 + width/2", "ymin, ymax = y0 - height/2, y0 + height/2", "", "output('shape', fab.shapes.rectangle(xmin, xmax, ymin, ymax))", "", "def drag_hw(this, x, y, z):", " this.width = abs(2 * (x - this.x0))", " this.height = abs(2 * (y - this.y0))", "", "# UI", "sb.ui.wireframe(", " [(xmin, ymin, 0), (xmax, ymin, 0), (xmax, ymax, 0), (xmin, ymax, 0)],", " close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(xmax, ymax, drag=drag_hw, relative=False)", "" ], "uid": 16 }, { "datums": [ { "expr": "2", "name": "x0", "type": "float", "uid": 0 }, { "expr": "2", "name": "y0", "type": "float", "uid": 1 }, { "expr": "cb.w", "name": "width", "type": "float", "uid": 2 }, { "expr": "-.008+cb.c", "name": "height", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f1.75X-Xf2.25a-f1.931Y-Yf2.069',float('1.750000'),float('1.931000'),float('-inf'),float('2.250000'),float('2.069000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -77.933803551171394, -502.75961263322887 ], "name": "r14", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Rectangle (center)')", "", "input('x0', float)", "input('y0', float)", "input('width', float)", "input('height', float)", "", "xmin, xmax = x0 - width/2, x0 + width/2", "ymin, ymax = y0 - height/2, y0 + height/2", "", "output('shape', fab.shapes.rectangle(xmin, xmax, ymin, ymax))", "", "def drag_hw(this, x, y, z):", " this.width = abs(2 * (x - this.x0))", " this.height = abs(2 * (y - this.y0))", "", "# UI", "sb.ui.wireframe(", " [(xmin, ymin, 0), (xmax, ymin, 0), (xmax, ymax, 0), (xmin, ymax, 0)],", " close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(xmax, ymax, drag=drag_hw, relative=False)", "" ], "uid": 17 }, { "datums": [ { "expr": "2", "name": "x0", "type": "float", "uid": 0 }, { "expr": "-1.5", "name": "y0", "type": "float", "uid": 1 }, { "expr": "cb.w", "name": "width", "type": "float", "uid": 2 }, { "expr": "-.001+cb.c", "name": "height", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f1.75X-Xf2.25a-f-1.5725Y-Yf-1.4275',float('1.750000'),float('-1.572500'),float('-inf'),float('2.250000'),float('-1.427500'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 227.61466177981993, -129.57271526708297 ], "name": "r15", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Rectangle (center)')", "", "input('x0', float)", "input('y0', float)", "input('width', float)", "input('height', float)", "", "xmin, xmax = x0 - width/2, x0 + width/2", "ymin, ymax = y0 - height/2, y0 + height/2", "", "output('shape', fab.shapes.rectangle(xmin, xmax, ymin, ymax))", "", "def drag_hw(this, x, y, z):", " this.width = abs(2 * (x - this.x0))", " this.height = abs(2 * (y - this.y0))", "", "# UI", "sb.ui.wireframe(", " [(xmin, ymin, 0), (xmax, ymin, 0), (xmax, ymax, 0), (xmin, ymax, 0)],", " close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(xmax, ymax, drag=drag_hw, relative=False)", "" ], "uid": 18 }, { "datums": [ { "expr": "2", "name": "x0", "type": "float", "uid": 0 }, { "expr": "1", "name": "y0", "type": "float", "uid": 1 }, { "expr": "cb.w", "name": "width", "type": "float", "uid": 2 }, { "expr": "-.006+cb.c", "name": "height", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f1.75X-Xf2.25a-f0.93Y-Yf1.07',float('1.750000'),float('0.930000'),float('-inf'),float('2.250000'),float('1.070000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -73.958837927073603, -128.9667191687293 ], "name": "r16", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Rectangle (center)')", "", "input('x0', float)", "input('y0', float)", "input('width', float)", "input('height', float)", "", "xmin, xmax = x0 - width/2, x0 + width/2", "ymin, ymax = y0 - height/2, y0 + height/2", "", "output('shape', fab.shapes.rectangle(xmin, xmax, ymin, ymax))", "", "def drag_hw(this, x, y, z):", " this.width = abs(2 * (x - this.x0))", " this.height = abs(2 * (y - this.y0))", "", "# UI", "sb.ui.wireframe(", " [(xmin, ymin, 0), (xmax, ymin, 0), (xmax, ymax, 0), (xmin, ymax, 0)],", " close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(xmax, ymax, drag=drag_hw, relative=False)", "" ], "uid": 19 }, { "datums": [ { "expr": "2", "name": "x0", "type": "float", "uid": 0 }, { "expr": "-.5", "name": "y0", "type": "float", "uid": 1 }, { "expr": "cb.w", "name": "width", "type": "float", "uid": 2 }, { "expr": "-.003+cb.c", "name": "height", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f1.75X-Xf2.25a-f-0.5715Y-Yf-0.4285',float('1.750000'),float('-0.571500'),float('-inf'),float('2.250000'),float('-0.428500'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 226.56805310634354, 252.34269935238513 ], "name": "r17", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Rectangle (center)')", "", "input('x0', float)", "input('y0', float)", "input('width', float)", "input('height', float)", "", "xmin, xmax = x0 - width/2, x0 + width/2", "ymin, ymax = y0 - height/2, y0 + height/2", "", "output('shape', fab.shapes.rectangle(xmin, xmax, ymin, ymax))", "", "def drag_hw(this, x, y, z):", " this.width = abs(2 * (x - this.x0))", " this.height = abs(2 * (y - this.y0))", "", "# UI", "sb.ui.wireframe(", " [(xmin, ymin, 0), (xmax, ymin, 0), (xmax, ymax, 0), (xmin, ymax, 0)],", " close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(xmax, ymax, drag=drag_hw, relative=False)", "" ], "uid": 15 }, { "datums": [ { "expr": "2", "name": "x0", "type": "float", "uid": 0 }, { "expr": "0.5", "name": "y0", "type": "float", "uid": 1 }, { "expr": "cb.w", "name": "width", "type": "float", "uid": 2 }, { "expr": "-.005+cb.c", "name": "height", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f1.75X-Xf2.25a-f0.4295Y-Yf0.5705',float('1.750000'),float('0.429500'),float('-inf'),float('2.250000'),float('0.570500'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -80.014697172235628, 63.004061354297463 ], "name": "r18", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Rectangle (center)')", "", "input('x0', float)", "input('y0', float)", "input('width', float)", "input('height', float)", "", "xmin, xmax = x0 - width/2, x0 + width/2", "ymin, ymax = y0 - height/2, y0 + height/2", "", "output('shape', fab.shapes.rectangle(xmin, xmax, ymin, ymax))", "", "def drag_hw(this, x, y, z):", " this.width = abs(2 * (x - this.x0))", " this.height = abs(2 * (y - this.y0))", "", "# UI", "sb.ui.wireframe(", " [(xmin, ymin, 0), (xmax, ymin, 0), (xmax, ymax, 0), (xmin, ymax, 0)],", " close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(xmax, ymax, drag=drag_hw, relative=False)", "" ], "uid": 20 }, { "datums": [ { "expr": "2", "name": "x0", "type": "float", "uid": 0 }, { "expr": "-1.0", "name": "y0", "type": "float", "uid": 1 }, { "expr": "cb.w", "name": "width", "type": "float", "uid": 2 }, { "expr": "-.002+cb.c", "name": "height", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f1.75X-Xf2.25a-f-1.072Y-Yf-0.928',float('1.750000'),float('-1.072000'),float('-inf'),float('2.250000'),float('-0.928000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 223.64529947606786, 57.202186934972019 ], "name": "r8", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/15", "", "import fab", "", "title('Rectangle (center)')", "", "input('x0', float)", "input('y0', float)", "input('width', float)", "input('height', float)", "", "xmin, xmax = x0 - width/2, x0 + width/2", "ymin, ymax = y0 - height/2, y0 + height/2", "", "output('shape', fab.shapes.rectangle(xmin, xmax, ymin, ymax))", "", "def drag_hw(this, x, y, z):", " this.width = abs(2 * (x - this.x0))", " this.height = abs(2 * (y - this.y0))", "", "# UI", "sb.ui.wireframe(", " [(xmin, ymin, 0), (xmax, ymin, 0), (xmax, ymax, 0), (xmin, ymax, 0)],", " close=True)", "sb.ui.point(x0, y0)", "sb.ui.point(xmax, ymax, drag=drag_hw, relative=False)", "" ], "uid": 11 }, { "datums": [ { "expr": "\u0011[__9.__2]", "name": "shape", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0012fab.types.Shape('aaaa-f0X-Xf2a-f-2.5Y-Yf2.5niiiiiiiiaa-f-0.25X-Xf0.25a-f-0.075Y-Yf0.075aa-f-0.25X-Xf0.25a-f0.4245Y-Yf0.5755aa-f-0.25X-Xf0.25a-f0.924Y-Yf1.076aa-f-0.25X-Xf0.25a-f1.4235Y-Yf1.5765aa-f-0.25X-Xf0.25a-f1.923Y-Yf2.077aa-f-0.25X-Xf0.25a-f-1.5735Y-Yf-1.4265aa-f-0.25X-Xf0.25a-f-1.074Y-Yf-0.926aa-f-0.25X-Xf0.25a-f-0.5745Y-Yf-0.4255aa-f-0.25X-Xf0.25a-f-2.073Y-Yf-1.927niiiiiiiaa-f1.75X-Xf2.25a-f-1.5725Y-Yf-1.4275aa-f1.75X-Xf2.25a-f1.931Y-Yf2.069aa-f1.75X-Xf2.25a-f-0.071Y-Yf0.071aa-f1.75X-Xf2.25a-f0.93Y-Yf1.07aa-f1.75X-Xf2.25a-f-0.5715Y-Yf-0.4285aa-f1.75X-Xf2.25a-f0.4295Y-Yf0.5705aa-f1.75X-Xf2.25a-f-1.072Y-Yf-0.928aa-f1.75X-Xf2.25a-f1.4305Y-Yf1.5695',float('0.000000'),float('-2.500000'),float('-inf'),float('2.000000'),float('2.500000'),float('inf'))", "name": "out", "type": "_fabtypes.Shape", "uid": 1 } ], "inspector": [ 861.05413305578861, -512.26218381301351 ], "name": "h0", "script": [ "import fab", "", "title('Heightmap (.png)')", "", "input('shape', fab.types.Shape)", "output('out', shape)", "", "sb.export.heightmap(shape)", "" ], "uid": 24 } ], "protocol": 6, "type": "sb" }