{ "nodes": [ { "datums": [ { "expr": "0", "name": "x0", "type": "float", "uid": 0 }, { "expr": "0", "name": "y0", "type": "float", "uid": 1 }, { "expr": "60", "name": "r", "type": "float", "uid": 2 }, { "expr": "0", "name": "_a", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('-r+qXqYf60',float('-60.000000'),float('-60.000000'),float('-inf'),float('60.000000'),float('60.000000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -719.86580725304452, -730.64702819615286 ], "name": "c0", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/18", "", "import fab", "import math", "", "title('Circle (center)')", "", "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": 0 }, { "datums": [ { "expr": "\u0011[__0.__0]", "name": "x0", "type": "float", "uid": 0 }, { "expr": "0", "name": "y0", "type": "float", "uid": 1 }, { "expr": "50", "name": "r", "type": "float", "uid": 2 }, { "expr": "0", "name": "_a", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('-r+qXqYf50',float('-50.000000'),float('-50.000000'),float('-inf'),float('50.000000'),float('50.000000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -675.78964389470548, -517.90000950723038 ], "name": "c1", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/18", "", "import fab", "import math", "", "title('Circle (center)')", "", "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": 2 }, { "datums": [ { "expr": "\u0011[__0.__4]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__2.__4]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('a-r+qXqYf60n-r+qXqYf50',float('-60.000000'),float('-60.000000'),float('-inf'),float('60.000000'),float('60.000000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ -397.98949826798412, -610.0312898458842 ], "name": "d0", "script": [ "import fab.types", "", "title('Difference')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 1 }, { "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": "45", "name": "zmax", "type": "float", "uid": 3 }, { "expr": "\u0011[__1.__2]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('am__f1a-r+qXqYf60n-r+qXqYf50a-f0Z-Zf45',float('-60.000000'),float('-60.000000'),float('0.000000'),float('60.000000'),float('60.000000'),float('45.000000'))", "name": "out", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ -79.482901803172453, -666.74377807219514 ], "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": 3 }, { "datums": [ { "expr": "0", "name": "x0", "type": "float", "uid": 0 }, { "expr": "85.0", "name": "y0", "type": "float", "uid": 1 }, { "expr": "25", "name": "r", "type": "float", "uid": 2 }, { "expr": "0", "name": "_a", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('-r+qXq-Yf85f25',float('-25.000000'),float('60.000000'),float('-inf'),float('25.000000'),float('110.000000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -750.20742423260083, -338.87222187187518 ], "name": "c2", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/18", "", "import fab", "import math", "", "title('Circle (center)')", "", "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": 4 }, { "datums": [ { "expr": "0", "name": "x0", "type": "float", "uid": 0 }, { "expr": "\u0011[__9.__1]", "name": "y0", "type": "float", "uid": 1 }, { "expr": "25.0", "name": "r", "type": "float", "uid": 2 }, { "expr": "0", "name": "_a", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('-r+qXq-Yf85f25',float('-25.000000'),float('60.000000'),float('-inf'),float('25.000000'),float('110.000000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -152.43681769614653, -432.06439790321707 ], "name": "c3", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/18", "", "import fab", "import math", "", "title('Circle (center)')", "", "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": 6 }, { "datums": [ { "expr": "0.0", "name": "_x", "type": "float", "uid": 0 }, { "expr": "0.0", "name": "_y", "type": "float", "uid": 1 }, { "expr": "10", "name": "zmin", "type": "float", "uid": 2 }, { "expr": "25", "name": "zmax", "type": "float", "uid": 3 }, { "expr": "\u0011[__6.__4]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('am__f1-r+qXq-Yf85f25a-f10Z-Zf25',float('-25.000000'),float('60.000000'),float('10.000000'),float('25.000000'),float('110.000000'),float('25.000000'))", "name": "out", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 176.55364303803429, -456.43709063352333 ], "name": "e2", "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": 7 }, { "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": "35", "name": "zmax", "type": "float", "uid": 3 }, { "expr": "\u0011[__10.__2]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('am__f1a-r+qXq-Yf85f25n-r+qXq-Yf85f4a-f0Z-Zf35',float('-25.000000'),float('60.000000'),float('0.000000'),float('25.000000'),float('110.000000'),float('35.000000'))", "name": "out", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 218.6901507363059, -228.23115672653819 ], "name": "e1", "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": 5 }, { "datums": [ { "expr": "\u0011[__5.__5]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__7.__5]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aam__f1a-r+qXq-Yf85f25n-r+qXq-Yf85f4a-f0Z-Zf35nam__f1-r+qXq-Yf85f25a-f10Z-Zf25',float('-25.000000'),float('60.000000'),float('0.000000'),float('25.000000'),float('110.000000'),float('35.000000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 523.29074782165969, -437.37066428171102 ], "name": "d1", "script": [ "import fab.types", "", "title('Difference')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 8 }, { "datums": [ { "expr": "0", "name": "x0", "type": "float", "uid": 0 }, { "expr": "\u0011[__4.__1]", "name": "y0", "type": "float", "uid": 1 }, { "expr": "4", "name": "r", "type": "float", "uid": 2 }, { "expr": "0", "name": "_a", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('-r+qXq-Yf85f4',float('-4.000000'),float('81.000000'),float('-inf'),float('4.000000'),float('89.000000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -462.47915730531685, -360.21132239944069 ], "name": "c4", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/18", "", "import fab", "import math", "", "title('Circle (center)')", "", "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": 9 }, { "datums": [ { "expr": "\u0011[__4.__4]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__9.__4]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('a-r+qXq-Yf85f25n-r+qXq-Yf85f4',float('-25.000000'),float('60.000000'),float('-inf'),float('25.000000'),float('110.000000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ -156.48910993186558, -216.5558544121721 ], "name": "d2", "script": [ "import fab.types", "", "title('Difference')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 10 } ], "protocol": 6, "type": "sb" }