{ "nodes": [ { "datums": [ { "expr": "0", "name": "x0", "type": "float", "uid": 0 }, { "expr": "0", "name": "y0", "type": "float", "uid": 1 }, { "expr": "\u0011[__1.__0]", "name": "r", "type": "float", "uid": 2 }, { "expr": "0", "name": "_a", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('-r+qXqYf5',float('-5.000000'),float('-5.000000'),float('-inf'),float('5.000000'),float('5.000000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 1766.9240343813246, -362.72212863228054 ], "name": "c0", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 6/11/18", "", "import fab", "import math", "", "title('Outer circle')", "", "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": "5", "name": "r", "type": "float", "uid": 0 }, { "expr": "0.5", "name": "h_acryl", "type": "float", "uid": 2 }, { "expr": "0.3", "name": "h_wood", "type": "float", "uid": 4 }, { "expr": "dim.r * 0.65", "name": "r_hex", "type": "float", "uid": 1 }, { "expr": "0.2", "name": "depth_glass", "type": "float", "uid": 3 }, { "expr": "0.5", "name": "depth_cubby_hole", "type": "float", "uid": 8 }, { "expr": "0.1", "name": "thickness_acryl", "type": "float", "uid": 5 }, { "expr": "50", "name": "a_cubby", "type": "float", "uid": 6 } ], "inspector": [ 1125.8909813824296, -246.62947265207833 ], "name": "dim", "script": [ "import fab", "", "title('Dimensions')", "", "input('r', float)", "input('h_acryl', float)", "input('h_wood', float)", "input('r_hex', float)", "input('depth_glass', float)", "input('depth_cubby_hole', float)", "input('thickness_acryl', float)", "input('a_cubby', float)" ], "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": "\u0011[__1.__2]", "name": "zmax", "type": "float", "uid": 3 }, { "expr": "\u0011[__0.__4]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('am__f1-r+qXqYf5a-f0Z-Zf0.5',float('-5.000000'),float('-5.000000'),float('0.000000'),float('5.000000'),float('5.000000'),float('0.500000'))", "name": "out", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 2096, -235 ], "name": "e0", "script": [ "import fab", "", "title('Extrude - Acrylic Bottom')", "", "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": 2 }, { "datums": [ { "expr": "0.0", "name": "_x", "type": "float", "uid": 0 }, { "expr": "0.0", "name": "_y", "type": "float", "uid": 1 }, { "expr": "dim.h_acryl", "name": "zmin", "type": "float", "uid": 2 }, { "expr": "dim.h_acryl + dim.h_wood", "name": "zmax", "type": "float", "uid": 3 }, { "expr": "\u0011[__0.__4]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('am__f1-r+qXqYf5a-f0.5Z-Zf0.8',float('-5.000000'),float('-5.000000'),float('0.500000'),float('5.000000'),float('5.000000'),float('0.800000'))", "name": "out", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 2100.913064761296, -39.221591306420294 ], "name": "e1", "script": [ "import fab", "", "title('Extrude - Wooden Top')", "", "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": "x", "type": "float", "uid": 0 }, { "expr": "0", "name": "y", "type": "float", "uid": 1 }, { "expr": "6", "name": "N", "type": "int", "uid": 2 }, { "expr": "\u0011[__1.__1]", "name": "r", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf0-Zf0aaaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f0.5X*f0.866025Y+*f-0.866025X*f0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-0.5X*f0.866025Y+*f-0.866025X*f-0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-1X*f1.22465e-16Y+*f-1.22465e-16X*f-1Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-0.5X*f-0.866025Y+*f0.866025X*f-0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f0.5X*f-0.866025Y+*f0.866025X*f0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Y',float('-3.250000'),float('-3.250000'),float('-inf'),float('3.250000'),float('3.250000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 1501.0743255500659, 176.01354583095628 ], "name": "p0", "script": [ "# Neil Gershenfeld 2/14/15", "# Matt Keeter 6/12/15", "", "import fab", "import math", "", "title('Hexagon')", "", "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": 4 }, { "datums": [ { "expr": "\u0011[__27.__4]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__18.__5]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aam__f1-r+qXqYf5a-f0.5Z-Zf0.8nm-Xf0-Yf0-Zf0m+*f0.866025X*f0.5Y+*f-0.5X*f0.866025Y_m-Xf-0-Yf-0-Zf0m-Xf0-Yf0-Zf0aaaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f0.5X*f0.866025Y+*f-0.866025X*f0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-0.5X*f0.866025Y+*f-0.866025X*f-0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-1X*f1.22465e-16Y+*f-1.22465e-16X*f-1Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-0.5X*f-0.866025Y+*f0.866025X*f-0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f0.5X*f-0.866025Y+*f0.866025X*f0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Y',float('-5.000000'),float('-5.000000'),float('0.500000'),float('5.000000'),float('5.000000'),float('0.800000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 2901.7110000726066, -88.041447004809754 ], "name": "d0", "script": [ "import fab.types", "", "title('Difference - Hex Through Wood Top')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 5 }, { "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": "dim.depth_glass", "name": "zmax", "type": "float", "uid": 3 }, { "expr": "\u0011[__18.__5]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('am__f1m-Xf0-Yf0-Zf0m+*f0.866025X*f0.5Y+*f-0.5X*f0.866025Y_m-Xf-0-Yf-0-Zf0m-Xf0-Yf0-Zf0aaaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f0.5X*f0.866025Y+*f-0.866025X*f0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-0.5X*f0.866025Y+*f-0.866025X*f-0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-1X*f1.22465e-16Y+*f-1.22465e-16X*f-1Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-0.5X*f-0.866025Y+*f0.866025X*f-0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f0.5X*f-0.866025Y+*f0.866025X*f0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ya-f0Z-Zf0.2',float('-4.439581'),float('-4.439581'),float('0.000000'),float('4.439581'),float('4.439581'),float('0.200000'))", "name": "out", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 1966.4172687839878, 483.94180021377935 ], "name": "e2", "script": [ "import fab", "", "title('Extrude - Glass plate')", "", "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": 6 }, { "datums": [ { "expr": "\u0011[__2.__5]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__9.__6]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aam__f1-r+qXqYf5a-f0Z-Zf0.5nm+f0/-Xf0f1.04+f0/-Yf0f1.04_m-Xf0-Yf0-Zf0.3am__f1m-Xf0-Yf0-Zf0m+*f0.866025X*f0.5Y+*f-0.5X*f0.866025Y_m-Xf-0-Yf-0-Zf0m-Xf0-Yf0-Zf0aaaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f0.5X*f0.866025Y+*f-0.866025X*f0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-0.5X*f0.866025Y+*f-0.866025X*f-0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-1X*f1.22465e-16Y+*f-1.22465e-16X*f-1Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-0.5X*f-0.866025Y+*f0.866025X*f-0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f0.5X*f-0.866025Y+*f0.866025X*f0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ya-f0Z-Zf0.2',float('-5.000000'),float('-5.000000'),float('0.000000'),float('5.000000'),float('5.000000'),float('0.500000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 2928.0716682069565, 458.61257592453421 ], "name": "d1", "script": [ "import fab.types", "", "title('Difference - Glass from Bottom')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 7 }, { "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": "0", "name": "dy", "type": "float", "uid": 4 }, { "expr": "dim.h_acryl - dim.depth_glass", "name": "dz", "type": "float", "uid": 5 }, { "expr": "\u0011[__6.__5]", "name": "shape", "type": "_fabtypes.Shape", "uid": 6 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf0-Zf0.3am__f1m-Xf0-Yf0-Zf0m+*f0.866025X*f0.5Y+*f-0.5X*f0.866025Y_m-Xf-0-Yf-0-Zf0m-Xf0-Yf0-Zf0aaaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f0.5X*f0.866025Y+*f-0.866025X*f0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-0.5X*f0.866025Y+*f-0.866025X*f-0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-1X*f1.22465e-16Y+*f-1.22465e-16X*f-1Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-0.5X*f-0.866025Y+*f0.866025X*f-0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f0.5X*f-0.866025Y+*f0.866025X*f0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ya-f0Z-Zf0.2',float('-4.439581'),float('-4.439581'),float('0.300000'),float('4.439581'),float('4.439581'),float('0.500000'))", "name": "out", "type": "_fabtypes.Shape", "uid": 7 } ], "inspector": [ 2282.4431943924842, 484.01491047277943 ], "name": "t0", "script": [ "import fab", "", "title('Translate - Move up')", "", "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": 8 }, { "datums": [ { "expr": "0", "name": "x0", "type": "float", "uid": 0 }, { "expr": "0", "name": "y0", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "_z", "type": "float", "uid": 2 }, { "expr": "1.04", "name": "sx", "type": "float", "uid": 3 }, { "expr": "1.04", "name": "sy", "type": "float", "uid": 4 }, { "expr": "\u0011[__8.__7]", "name": "shape", "type": "_fabtypes.Shape", "uid": 5 }, { "expr": "\u0012fab.types.Shape('m+f0/-Xf0f1.04+f0/-Yf0f1.04_m-Xf0-Yf0-Zf0.3am__f1m-Xf0-Yf0-Zf0m+*f0.866025X*f0.5Y+*f-0.5X*f0.866025Y_m-Xf-0-Yf-0-Zf0m-Xf0-Yf0-Zf0aaaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f0.5X*f0.866025Y+*f-0.866025X*f0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-0.5X*f0.866025Y+*f-0.866025X*f-0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-1X*f1.22465e-16Y+*f-1.22465e-16X*f-1Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-0.5X*f-0.866025Y+*f0.866025X*f-0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f0.5X*f-0.866025Y+*f0.866025X*f0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ya-f0Z-Zf0.2',float('-4.617164'),float('-4.617164'),float('0.300000'),float('4.617164'),float('4.617164'),float('0.500000'))", "name": "scaled", "type": "_fabtypes.Shape", "uid": 6 } ], "inspector": [ 2586.3181451643104, 476.3714269994598 ], "name": "s0", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 5/31/15", "", "import fab", "", "title('Scale (2D) - Make bigger in XY')", "", "input('x0', float)", "input('y0', float)", "input('_z', float)", "input('sx', float)", "input('sy', float)", "", "input('shape', fab.types.Shape)", "output('scaled', fab.shapes.scale_xy(shape, x0, y0, sx, sy))", "", "# UI", "sb.ui.wireframe([(x0 + sx, y0, _z), (x0, y0, _z), (x0, y0 + sy, _z)],", " color=sb.color.teal)", "sb.ui.wireframe([(x0 + sx, y0 + sx/10, _z), (x0 + sx, y0 - sx/10, _z)],", " color=sb.color.teal)", "sb.ui.wireframe([(x0 + sy/10, y0 + sy, _z), (x0 - sy/10, y0 + sy, _z)],", " color=sb.color.teal)", "sb.ui.point(x0, y0, _z, color=sb.color.teal)", "sb.ui.point(x0 + sx, y0, _z, color=sb.color.teal, drag=(sx, None, None))", "sb.ui.point(x0, y0 + sy, _z, color=sb.color.teal, drag=(None, sy, None))", "" ], "uid": 9 }, { "datums": [ { "expr": "0", "name": "x0", "type": "float", "uid": 0 }, { "expr": "0", "name": "y0", "type": "float", "uid": 1 }, { "expr": "dim.r * 0.95", "name": "r", "type": "float", "uid": 2 }, { "expr": "0", "name": "_a", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('-r+qXqYf4.75',float('-4.750000'),float('-4.750000'),float('-inf'),float('4.750000'),float('4.750000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 1359.7080013824161, 650.42309157037619 ], "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": 13 }, { "datums": [ { "expr": "\u0011[__13.__4]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__16.__4]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('a-r+qXqYf4.75aa-f0X-Xf5a-f0Y-Yf5',float('0.000000'),float('0.000000'),float('-inf'),float('4.750000'),float('4.750000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 1812.9440018432206, 956.50454642702402 ], "name": "i0", "script": [ "import fab.types", "", "title('Intersection - Remove one square')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & b)", "" ], "uid": 15 }, { "datums": [ { "expr": "0", "name": "x0", "type": "float", "uid": 0 }, { "expr": "0", "name": "y0", "type": "float", "uid": 1 }, { "expr": "dim.r", "name": "x1", "type": "float", "uid": 2 }, { "expr": "dim.r", "name": "y1", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f0X-Xf5a-f0Y-Yf5',float('0.000000'),float('0.000000'),float('-inf'),float('5.000000'),float('5.000000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 1359.7080013824157, 835.83781903161457 ], "name": "r1", "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": 16 }, { "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": "dim.a_cubby - 90", "name": "a", "type": "float", "uid": 3 }, { "expr": "\u0011[__16.__4]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf0-Zf0m+*f0.766044X*f-0.642788Y+*f0.642788X*f0.766044Y_m-Xf-0-Yf-0-Zf0aa-f0X-Xf5a-f0Y-Yf5',float('0.000000'),float('-3.213940'),float('-inf'),float('7.044160'),float('3.830220'),float('inf'))", "name": "rotated", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 1662.8273094016411, 1155.6961249851365 ], "name": "r0", "script": [ "import fab", "import math", "", "title('Rotate (Z) - Second square')", "", "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": 14 }, { "datums": [ { "expr": "\u0011[__15.__2]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__14.__5]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aa-r+qXqYf4.75aa-f0X-Xf5a-f0Y-Yf5m-Xf0-Yf0-Zf0m+*f0.766044X*f-0.642788Y+*f0.642788X*f0.766044Y_m-Xf-0-Yf-0-Zf0aa-f0X-Xf5a-f0Y-Yf5',float('0.000000'),float('0.000000'),float('-inf'),float('4.750000'),float('3.830220'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 2122.0164188238664, 1117.4612995259911 ], "name": "i1", "script": [ "import fab.types", "", "title('Intersection - Remove 2nd square')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & b)", "" ], "uid": 17 }, { "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": "30", "name": "a", "type": "float", "uid": 3 }, { "expr": "\u0011[__4.__4]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf0-Zf0m+*f0.866025X*f0.5Y+*f-0.5X*f0.866025Y_m-Xf-0-Yf-0-Zf0m-Xf0-Yf0-Zf0aaaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f0.5X*f0.866025Y+*f-0.866025X*f0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-0.5X*f0.866025Y+*f-0.866025X*f-0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-1X*f1.22465e-16Y+*f-1.22465e-16X*f-1Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-0.5X*f-0.866025Y+*f0.866025X*f-0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f0.5X*f-0.866025Y+*f0.866025X*f0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Y',float('-4.439581'),float('-4.439581'),float('-inf'),float('4.439581'),float('4.439581'),float('inf'))", "name": "rotated", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 1827.8370706876103, 91.518963205499176 ], "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": 18 }, { "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": "-dim.a_cubby/2", "name": "a", "type": "float", "uid": 3 }, { "expr": "\u0011[__17.__2]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf0-Zf0m+*f0.906308X*f-0.422618Y+*f0.422618X*f0.906308Y_m-Xf-0-Yf-0-Zf0aa-r+qXqYf4.75aa-f0X-Xf5a-f0Y-Yf5m-Xf0-Yf0-Zf0m+*f0.766044X*f-0.642788Y+*f0.642788X*f0.766044Y_m-Xf-0-Yf-0-Zf0aa-f0X-Xf5a-f0Y-Yf5',float('0.000000'),float('-2.007436'),float('-inf'),float('5.923683'),float('3.471359'),float('inf'))", "name": "rotated", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 2480.5120713182223, 1125.7949855919619 ], "name": "r3", "script": [ "import fab", "import math", "", "title('Rotate (Z) - Center Pie')", "", "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": 19 }, { "datums": [ { "expr": "\u0011[__16.__4]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "0", "name": "x0", "type": "float", "uid": 1 }, { "expr": "0", "name": "y0", "type": "float", "uid": 2 }, { "expr": "-dim.r/2", "name": "x1", "type": "float", "uid": 3 }, { "expr": "-dim.r/2", "name": "y1", "type": "float", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf-2.5-Yf-2.5-Zf0aa-f0X-Xf5a-f0Y-Yf5',float('-2.500000'),float('-2.500000'),float('-inf'),float('2.500000'),float('2.500000'),float('inf'))", "name": "out", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 2061.7677663775999, 1443.8096199332506 ], "name": "s3", "script": [ "# Neil Gershenfeld 1/25/15", "# Matt Keeter 6/13/15", "", "import fab", "", "title('Set origin (XY)')", "", "input('a',fab.types.Shape)", "", "input('x0', float)", "input('y0', float)", "input('x1', float)", "input('y1', float)", "", "output('out', fab.shapes.origin_xy(a, x0, y0, x1, y1))", "", "# UI", "sb.ui.wireframe([(x0, y0, 0), (x1, y1, 0)], color=sb.color.green)", "sb.ui.point(x0, y0, color=sb.color.green)", "sb.ui.point(x1, y1, color=sb.color.green)", "", "" ], "uid": 20 }, { "datums": [ { "expr": "0", "name": "x0", "type": "float", "uid": 0 }, { "expr": "0", "name": "y0", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "_z", "type": "float", "uid": 2 }, { "expr": "1.3", "name": "sx", "type": "float", "uid": 3 }, { "expr": "1.3", "name": "sy", "type": "float", "uid": 4 }, { "expr": "\u0011[__20.__5]", "name": "shape", "type": "_fabtypes.Shape", "uid": 5 }, { "expr": "\u0012fab.types.Shape('m+f0/-Xf0f1.3+f0/-Yf0f1.3_m-Xf-2.5-Yf-2.5-Zf0aa-f0X-Xf5a-f0Y-Yf5',float('-3.250000'),float('-3.250000'),float('-inf'),float('3.250000'),float('3.250000'),float('inf'))", "name": "scaled", "type": "_fabtypes.Shape", "uid": 6 } ], "inspector": [ 2443.2234123309031, 1445.7168981630168 ], "name": "s4", "script": [ "# Neil Gershenfeld 1/24/15", "# Matt Keeter 5/31/15", "", "import fab", "", "title('Scale (2D)')", "", "input('x0', float)", "input('y0', float)", "input('_z', float)", "input('sx', float)", "input('sy', float)", "", "input('shape', fab.types.Shape)", "output('scaled', fab.shapes.scale_xy(shape, x0, y0, sx, sy))", "", "# UI", "sb.ui.wireframe([(x0 + sx, y0, _z), (x0, y0, _z), (x0, y0 + sy, _z)],", " color=sb.color.teal)", "sb.ui.wireframe([(x0 + sx, y0 + sx/10, _z), (x0 + sx, y0 - sx/10, _z)],", " color=sb.color.teal)", "sb.ui.wireframe([(x0 + sy/10, y0 + sy, _z), (x0 - sy/10, y0 + sy, _z)],", " color=sb.color.teal)", "sb.ui.point(x0, y0, _z, color=sb.color.teal)", "sb.ui.point(x0 + sx, y0, _z, color=sb.color.teal, drag=(sx, None, None))", "sb.ui.point(x0, y0 + sy, _z, color=sb.color.teal, drag=(None, sy, None))", "" ], "uid": 21 }, { "datums": [ { "expr": "\u0011[__19.__5]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__21.__6]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('am-Xf0-Yf0-Zf0m+*f0.906308X*f-0.422618Y+*f0.422618X*f0.906308Y_m-Xf-0-Yf-0-Zf0aa-r+qXqYf4.75aa-f0X-Xf5a-f0Y-Yf5m-Xf0-Yf0-Zf0m+*f0.766044X*f-0.642788Y+*f0.642788X*f0.766044Y_m-Xf-0-Yf-0-Zf0aa-f0X-Xf5a-f0Y-Yf5nm+f0/-Xf0f1.3+f0/-Yf0f1.3_m-Xf-2.5-Yf-2.5-Zf0aa-f0X-Xf5a-f0Y-Yf5',float('0.000000'),float('-2.007436'),float('-inf'),float('5.923683'),float('3.471359'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 2900.9701874748662, 1302.6710309305283 ], "name": "d3", "script": [ "import fab.types", "", "title('Difference - Final hole 2D')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 22 }, { "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": "dim.depth_cubby_hole", "name": "zmax", "type": "float", "uid": 3 }, { "expr": "\u0011[__22.__2]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('am__f1am-Xf0-Yf0-Zf0m+*f0.906308X*f-0.422618Y+*f0.422618X*f0.906308Y_m-Xf-0-Yf-0-Zf0aa-r+qXqYf4.75aa-f0X-Xf5a-f0Y-Yf5m-Xf0-Yf0-Zf0m+*f0.766044X*f-0.642788Y+*f0.642788X*f0.766044Y_m-Xf-0-Yf-0-Zf0aa-f0X-Xf5a-f0Y-Yf5nm+f0/-Xf0f1.3+f0/-Yf0f1.3_m-Xf-2.5-Yf-2.5-Zf0aa-f0X-Xf5a-f0Y-Yf5a-f0Z-Zf0.5',float('0.000000'),float('-2.007436'),float('0.000000'),float('5.923683'),float('3.471359'),float('0.500000'))", "name": "out", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 3250.1451121022083, 1297.3783311145971 ], "name": "e3", "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": 23 }, { "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": "0", "name": "dy", "type": "float", "uid": 4 }, { "expr": "dim.h_acryl + dim.h_wood - dim.depth_cubby_hole", "name": "dz", "type": "float", "uid": 5 }, { "expr": "\u0011[__23.__5]", "name": "shape", "type": "_fabtypes.Shape", "uid": 6 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf0-Zf0.3am__f1am-Xf0-Yf0-Zf0m+*f0.906308X*f-0.422618Y+*f0.422618X*f0.906308Y_m-Xf-0-Yf-0-Zf0aa-r+qXqYf4.75aa-f0X-Xf5a-f0Y-Yf5m-Xf0-Yf0-Zf0m+*f0.766044X*f-0.642788Y+*f0.642788X*f0.766044Y_m-Xf-0-Yf-0-Zf0aa-f0X-Xf5a-f0Y-Yf5nm+f0/-Xf0f1.3+f0/-Yf0f1.3_m-Xf-2.5-Yf-2.5-Zf0aa-f0X-Xf5a-f0Y-Yf5a-f0Z-Zf0.5',float('0.000000'),float('-2.007436'),float('0.300000'),float('5.923683'),float('3.471359'),float('0.800000'))", "name": "out", "type": "_fabtypes.Shape", "uid": 7 } ], "inspector": [ 3572.9979285735913, 1297.2352861568079 ], "name": "t1", "script": [ "import fab", "", "title('Translate - Upward')", "", "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": 24 }, { "datums": [ { "expr": "\u0011[__5.__2,__7.__2]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__26.__4]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aiaam__f1-r+qXqYf5a-f0.5Z-Zf0.8nm-Xf0-Yf0-Zf0m+*f0.866025X*f0.5Y+*f-0.5X*f0.866025Y_m-Xf-0-Yf-0-Zf0m-Xf0-Yf0-Zf0aaaaam-Xf0-Yf0-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f0.5X*f0.866025Y+*f-0.866025X*f0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-0.5X*f0.866025Y+*f-0.866025X*f-0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-1X*f1.22465e-16Y+*f-1.22465e-16X*f-1Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f-0.5X*f-0.866025Y+*f0.866025X*f-0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Ym-Xf0-Yf0-Zf0m+*f0.5X*f-0.866025Y+*f0.866025X*f0.5Y_m-Xf0-Yf0-Zf0-f-2.81458Yaam__f1-r+qXqYf5a-f0Z-Zf0.5nm+f0/-Xf0f1.04+f0/-Yf0f1.04_m-Xf0-Yf0-Zf0.3am__f1m-Xf0-Yf0-Zf0m+*f0.866025X*f0.5Y+*f-0.5X*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f0m-Xf0-Yf0-Zf0.3am__f1am-Xf0-Yf0-Zf0m+*f0.906308X*f-0.422618Y+*f0.422618X*f0.906308Y_m-Xf-0-Yf-0-Zf0aa-r+qXqYf4.75aa-f0X-Xf5a-f0Y-Yf5m-Xf0-Yf0-Zf0m+*f0.766044X*f-0.642788Y+*f0.642788X*f0.766044Y_m-Xf-0-Yf-0-Zf0aa-f0X-Xf5a-f0Y-Yf5nm+f0/-Xf0f1.3+f0/-Yf0f1.3_m-Xf-2.5-Yf-2.5-Zf0aa-f0X-Xf5a-f0Y-Yf5a-f0Z-Zf0.5m-Xf0-Yf0-Zf0m+*f0.5X*f-0.866025Y+*f0.866025X*f0.5Y_m-Xf-0-Yf-0-Zf0m-Xf0-Yf0-Zf0.3am__f1am-Xf0-Yf0-Zf0m+*f0.906308X*f-0.422618Y+*f0.422618X*f0.906308Y_m-Xf-0-Yf-0-Zf0aa-r+qXqYf4.75aa-f0X-Xf5a-f0Y-Yf5m-Xf0-Yf0-Zf0m+*f0.766044X*f-0.642788Y+*f0.642788X*f0.766044Y_m-Xf-0-Yf-0-Zf0aa-f0X-Xf5a-f0Y-Yf5nm+f0/-Xf0f1.3+f0/-Yf0f1.3_m-Xf-2.5-Yf-2.5-Zf0aa-f0X-Xf5a-f0Y-Yf5a-f0Z-Zf0.5',float('-5.000000'),float('-5.000000'),float('0.000000'),float('5.000000'),float('5.000000'),float('0.800000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 3454.5747133489094, 431.81826744511034 ], "name": "d4", "script": [ "import fab.types", "", "title('Difference - Cubby holes')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 25 }, { "datums": [ { "expr": "\u0011[__24.__7]", "name": "shape", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "0", "name": "x", "type": "float", "uid": 1 }, { "expr": "0", "name": "y", "type": "float", "uid": 2 }, { "expr": "6", "name": "n", "type": "int", "uid": 3 },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-Xf5a-f0Y-Yf5m-Xf0-Yf0-Zf0m+*f0.766044X*f-0.642788Y+*f0.642788X*f0.766044Y_m-Xf-0-Yf-0-Zf0aa-f0X-Xf5a-f0Y-Yf5nm+f0/-Xf0f1.3+f0/-Yf0f1.3_m-Xf-2.5-Yf-2.5-Zf0aa-f0X-Xf5a-f0Y-Yf5a-f0Z-Zf0.5',float('-5.968125'),float('-6.865737'),float('0.300000'),float('5.968125'),float('6.865737'),float('0.800000'))", "name": "array", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 3895.1685094204604, 1301.2430450743968 ], "name": "a0", "script": [ "import fab", "import math", "", "title('Array (polar) - Multiple Cubby holes')", "", "input('shape', fab.types.Shape)", "input('x', float)", "input('y', float)", "input('n', int)", "", "output('array', fab.shapes.iterate_polar(shape, x, y, n))", "", "# UI", "sb.ui.wireframe([", " (math.cos(i/36. * 2*math.pi) * 0.3 + x,", " math.sin(i/36. * 2*math.pi) * 0.3 + y, 0)", " for i in range(36)], close=True, color=sb.color.teal)", "", "sb.ui.point(x, y, 0, color=sb.color.teal)", "" ], "uid": 26 }, { "datums": [ { "expr": "\u0011[__3.__5]", "name": "shape", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "100", "name": "r", "type": "int", "uid": 1 }, { "expr": "100", "name": "g", "type": "int", "uid": 2 }, { "expr": "255", "name": "b", "type": "int", "uid": 3 }, { "expr": "\u0012fab.types.Shape('am__f1-r+qXqYf5a-f0.5Z-Zf0.8',float('-5.000000'),float('-5.000000'),float('0.500000'),float('5.000000'),float('5.000000'),float('0.800000'),color=(100,100,255))", "name": "out", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 2513.61583776716, -250.52956688793728 ], "name": "s5", "script": [ "import fab", "import math", "", "title('Set color (RGB)')", "", "input(\"shape\", fab.types.Shape)", "input(\"r\", int)", "input(\"g\", int)", "input(\"b\", int)", "", "output(\"out\", fab.shapes.set_color(shape, r, g, b))", "" ], "uid": 27 }, { "datums": [ { "exp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f5a-f0Y-Yf5a-f0Z-Zf0.5m-Xf0-Yf0-Zf0m+*f0.5X*f-0.866025Y+*f0.866025X*f0.5Y_m-Xf-0-Yf-0-Zf0m-Xf0-Yf0-Zf0.3am__f1am-Xf0-Yf0-Zf0m+*f0.906308X*f-0.422618Y+*f0.422618X*f0.906308Y_m-Xf-0-Yf-0-Zf0aa-r+qXqYf4.75aa-f0X-Xf5a-f0Y-Yf5m-Xf0-Yf0-Zf0m+*f0.766044X*f-0.642788Y+*f0.642788X*f0.766044Y_m-Xf-0-Yf-0-Zf0aa-f0X-Xf5a-f0Y-Yf5nm+f0/-Xf0f1.3+f0/-Yf0f1.3_m-Xf-2.5-Yf-2.5-Zf0aa-f0X-Xf5a-f0Y-Yf5a-f0Z-Zf0.5',float('-5.000000'),float('-5.000000'),float('0.000000'),float('5.000000'),float('5.000000'),float('0.800000'))", "name": "out", "type": "_fabtypes.Shape", "uid": 1 } ], "inspector": [ 4331.5528587139024, 426.38331556535235 ], "name": "m0", "script": [ "import fab", "", "title('Mesh (.stl)')", "", "input('shape', fab.types.Shape)", "output('out', shape)", "", "sb.export.stl(shape)", "" ], "uid": 10 } ], "protocol": 6, "type": "sb" }