{ "nodes": [ { "datums": [ { "expr": "-0.79673", "name": "x0", "type": "float", "uid": 0 }, { "expr": "0.197819", "name": "y0", "type": "float", "uid": 1 }, { "expr": "0.56634", "name": "r", "type": "float", "uid": 2 }, { "expr": "0.5744354019939218", "name": "_a", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('-r+q-Xf-0.79673q-Yf0.197819f0.56634',float('-1.363070'),float('-0.368521'),float('-inf'),float('-0.230390'),float('0.764159'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -134.125, -80 ], "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": "0.0", "name": "x", "type": "float", "uid": 0 }, { "expr": "0.6", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "z", "type": "float", "uid": 2 }, { "expr": "0.69526", "name": "r", "type": "float", "uid": 3 }, { "expr": "\u0011[__0.__4]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634',float('-1.618842'),float('-0.624293'),float('-inf'),float('0.025382'),float('1.019931'),float('inf'))", "name": "repelled", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 150, -74 ], "name": "r0", "script": [ "import fab", "import math", "", "title('Repel')", "", "input('x', float)", "input('y', float)", "input('z', float)", "input('r', float)", "input('shape', fab.types.Shape)", "", "output('repelled', fab.shapes.repel(shape, x, y, z, r))", "", "# UI", "sb.ui.wireframe([", " (math.cos(i/36. * 2*math.pi) * r + x,", " math.sin(i/36. * 2*math.pi) * r + y, z)", " for i in range(36)], close=True, color=sb.color.teal)", "", "sb.ui.wireframe([(x,y,z-r), (x,y,z - 0.2*r)])", "sb.ui.wireframe([(x,y,z+r), (x,y,z + 0.2*r)], color=sb.color.teal)", "sb.ui.wireframe([(x, y + 0.2*r, z - 0.8*r), (x, y, z-r),", " (x, y - 0.2*r, z - 0.8*r)], color=sb.color.teal)", "sb.ui.wireframe([(x, y + 0.2*r, z + 0.8*r), (x, y, z+r),", " (x, y - 0.2*r, z + 0.8*r)], color=sb.color.teal)", "", "sb.ui.point(x, y, z, color=sb.color.teal)", "sb.ui.point(x, y, z + r, drag=(None, None, r), color=sb.color.teal)", "sb.ui.point(x, y, z - r, drag=(None, None, r), color=sb.color.teal)", "" ], "uid": 1 }, { "datums": [ { "expr": "-3.08375", "name": "x0", "type": "float", "uid": 0 }, { "expr": "-3.12072", "name": "y0", "type": "float", "uid": 1 }, { "expr": "6.6", "name": "width", "type": "float", "uid": 2 }, { "expr": "0.54", "name": "height", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f-6.38375X-Xf0.21625a-f-3.39072Y-Yf-2.85072',float('-6.383750'),float('-3.390720'),float('-inf'),float('0.216250'),float('-2.850720'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ -124, 150 ], "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": "\u0011[__2.__0]", "name": "x", "type": "float", "uid": 0 }, { "expr": "\u0011[__2.__1]", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "_z", "type": "float", "uid": 2 }, { "expr": "-126.545", "name": "a", "type": "float", "uid": 3 }, { "expr": "\u0011[__2.__4]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf-3.08375-Yf-3.12072-Zf0m+*f-0.595454X*f-0.803389Y+*f0.803389X*f-0.595454Y_m-Xf3.08375-Yf3.12072-Zf0aa-f-6.38375X-Xf0.21625a-f-3.39072Y-Yf-2.85072',float('-5.265663'),float('-5.932676'),float('-inf'),float('-0.901837'),float('-0.308764'),float('inf'))", "name": "rotated", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 155, 153 ], "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": 3 }, { "datums": [ { "expr": "-4.2", "name": "x", "type": "float", "uid": 0 }, { "expr": "-1.59", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "z", "type": "float", "uid": 2 }, { "expr": "1.43", "name": "r", "type": "float", "uid": 3 }, { "expr": "\u0011[__3.__5]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf-4.2-Yf-1.59-Zf0m*X-f1xn/r++qXqYqZf1.43*Y-f1xn/r++qXqYqZf1.43*Z-f1xn/r++qXqYqZf1.43m-Xf4.2-Yf1.59-Zf-0m-Xf-3.08375-Yf-3.12072-Zf0m+*f-0.595454X*f-0.803389Y+*f0.803389X*f-0.595454Y_m-Xf3.08375-Yf3.12072-Zf0aa-f-6.38375X-Xf0.21625a-f-3.39072Y-Yf-2.85072',float('-5.791731'),float('-6.458744'),float('-inf'),float('-0.375769'),float('0.217304'),float('inf'))", "name": "repelled", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 440, 158 ], "name": "r3", "script": [ "import fab", "import math", "", "title('Repel')", "", "input('x', float)", "input('y', float)", "input('z', float)", "input('r', float)", "input('shape', fab.types.Shape)", "", "output('repelled', fab.shapes.repel(shape, x, y, z, r))", "", "# UI", "sb.ui.wireframe([", " (math.cos(i/36. * 2*math.pi) * r + x,", " math.sin(i/36. * 2*math.pi) * r + y, z)", " for i in range(36)], close=True, color=sb.color.teal)", "", "sb.ui.wireframe([(x,y,z-r), (x,y,z - 0.2*r)])", "sb.ui.wireframe([(x,y,z+r), (x,y,z + 0.2*r)], color=sb.color.teal)", "sb.ui.wireframe([(x, y + 0.2*r, z - 0.8*r), (x, y, z-r),", " (x, y - 0.2*r, z - 0.8*r)], color=sb.color.teal)", "sb.ui.wireframe([(x, y + 0.2*r, z + 0.8*r), (x, y, z+r),", " (x, y - 0.2*r, z + 0.8*r)], color=sb.color.teal)", "", "sb.ui.point(x, y, z, color=sb.color.teal)", "sb.ui.point(x, y, z + r, drag=(None, None, r), color=sb.color.teal)", "sb.ui.point(x, y, z - r, drag=(None, None, r), color=sb.color.teal)", "" ], "uid": 4 }, { "datums": [ { "expr": "-1.0446", "name": "x", "type": "float", "uid": 0 }, { "expr": "-3.94837", "name": "y", "type": "float", "uid": 1 }, { "expr": "0", "name": "z", "type": "float", "uid": 2 }, { "expr": "1.94", "name": "r", "type": "float", "uid": 3 }, { "expr": "\u0011[__4.__5]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf-1.0446-Yf-3.94837-Zf0m*X-f1xn/r++qXqYqZf1.94*Y-f1xn/r++qXqYqZf1.94*Z-f1xn/r++qXqYqZf1.94m-Xf1.0446-Yf3.94837-Zf-0m-Xf-4.2-Yf-1.59-Zf0m*X-f1xn/r++qXqYqZf1.43*Y-f1xn/r++qXqYqZf1.43*Z-f1xn/r++qXqYqZf1.43m-Xf4.2-Yf1.59-Zf-0m-Xf-3.08375-Yf-3.12072-Zf0m+*f-0.595454X*f-0.803389Y+*f0.803389X*f-0.595454Y_m-Xf3.08375-Yf3.12072-Zf0aa-f-6.38375X-Xf0.21625a-f-3.39072Y-Yf-2.85072',float('-6.505417'),float('-7.172430'),float('-inf'),float('0.337917'),float('0.930990'),float('inf'))", "name": "repelled", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 440, 377 ], "name": "r4", "script": [ "import fab", "import math", "", "title('Repel')", "", "input('x', float)", "input('y', float)", "input('z', float)", "input('r', float)", "input('shape', fab.types.Shape)", "", "output('repelled', fab.shapes.repel(shape, x, y, z, r))", "", "# UI", "sb.ui.wireframe([", " (math.cos(i/36. * 2*math.pi) * r + x,", " math.sin(i/36. * 2*math.pi) * r + y, z)", " for i in range(36)], close=True, color=sb.color.teal)", "", "sb.ui.wireframe([(x,y,z-r), (x,y,z - 0.2*r)])", "sb.ui.wireframe([(x,y,z+r), (x,y,z + 0.2*r)], color=sb.color.teal)", "sb.ui.wireframe([(x, y + 0.2*r, z - 0.8*r), (x, y, z-r),", " (x, y - 0.2*r, z - 0.8*r)], color=sb.color.teal)", "sb.ui.wireframe([(x, y + 0.2*r, z + 0.8*r), (x, y, z+r),", " (x, y - 0.2*r, z + 0.8*r)], color=sb.color.teal)", "", "sb.ui.point(x, y, z, color=sb.color.teal)", "sb.ui.point(x, y, z + r, drag=(None, None, r), color=sb.color.teal)", "sb.ui.point(x, y, z - r, drag=(None, None, r), color=sb.color.teal)", "" ], "uid": 5 }, { "datums": [ { "expr": "\u0011[__1.__5]", "name": "shape", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634',float('-1.618842'),float('-0.624293'),float('-inf'),float('0.025382'),float('1.019931'),float('inf'))", "name": "copy", "type": "_fabtypes.Shape", "uid": 1 } ], "inspector": [ 459.58022465084673, -164.62049097891179 ], "name": "c1", "script": [ "# Neil Gershenfeld 2/14/15", "# Matt Keeter 6/12/15", "", "import fab", "", "title('Copy')", "", "input('shape', fab.types.Shape)", "output('copy', shape)", "", "" ], "uid": 6 }, { "datums": [ { "expr": "-5.612453460693359", "name": "x", "type": "float", "uid": 0 }, { "expr": "-5.71237003326416", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "z", "type": "float", "uid": 2 }, { "expr": "\u0011[__6.__1]", "name": "shape", "type": "_fabtypes.Shape", "uid": 3 }, { "expr": "\u0012fab.types.Shape('m-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634',float('-6.434562'),float('-6.534483'),float('-inf'),float('-4.790338'),float('-4.890259'),float('inf'))", "name": "out", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 741.50994472115303, -170.29893467280067 ], "name": "r5", "script": [ "import fab", "", "title('Recenter')", "", "input('x', float)", "input('y', float)", "input('z', float)", "", "input('shape', fab.types.Shape)", "output('out', fab.shapes.recenter(shape, x, y, z))", "", "# UI", "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)", "" ], "uid": 7 }, { "datums": [ { "expr": "\u0011[__1.__5]", "name": "shape", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634',float('-1.618842'),float('-0.624293'),float('-inf'),float('0.025382'),float('1.019931'),float('inf'))", "name": "copy", "type": "_fabtypes.Shape", "uid": 1 } ], "inspector": [ 463.88720225976419, -52.331443467162714 ], "name": "c2", "script": [ "# Neil Gershenfeld 2/14/15", "# Matt Keeter 6/12/15", "", "import fab", "", "title('Copy')", "", "input('shape', fab.types.Shape)", "output('copy', shape)", "", "" ], "uid": 8 }, { "datums": [ { "expr": "\u0011[__1.__5]", "name": "shape", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0012fab.types.Shape('m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634',float('-1.618842'),float('-0.624293'),float('-inf'),float('0.025382'),float('1.019931'),float('inf'))", "name": "copy", "type": "_fabtypes.Shape", "uid": 1 } ], "inspector": [ 464.7741758778518, 49.670522612900193 ], "name": "c3", "script": [ "# Neil Gershenfeld 2/14/15", "# Matt Keeter 6/12/15", "", "import fab", "", "title('Copy')", "", "input('shape', fab.types.Shape)", "output('copy', shape)", "", "" ], "uid": 9 }, { "datums": [ { "expr": "-4.748145580291748", "name": "x", "type": "float", "uid": 0 }, { "expr": "-5.905974941253662", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "z", "type": "float", "uid": 2 }, { "expr": "\u0011[__8.__1]", "name": "shape", "type": "_fabtypes.Shape", "uid": 3 }, { "expr": "\u0012fab.types.Shape('m-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634',float('-5.570262'),float('-6.728083'),float('-inf'),float('-3.926038'),float('-5.083859'),float('inf'))", "name": "out", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 743.28389195732791, 23.061314070275088 ], "name": "r6", "script": [ "import fab", "", "title('Recenter')", "", "input('x', float)", "input('y', float)", "input('z', float)", "", "input('shape', fab.types.Shape)", "output('out', fab.shapes.recenter(shape, x, y, z))", "", "# UI", "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)", "" ], "uid": 10 }, { "datums": [ { "expr": "\u0011[__7.__4]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__10.__4]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "0.28", "name": "q", "type": "float", "uid": 2 }, { "expr": "\u0012fab.types.Shape('iim-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634m-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634-+rbm-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634rbm-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634f0.28',float('-6.434562'),float('-6.728083'),float('-inf'),float('-3.926038'),float('-4.890259'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 3 } ], "inspector": [ 1061.5062599189132, 172.87849286350644 ], "name": "b0", "script": [ "import fab.types", "import fab.shapes", "", "title('Blend')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "input('q', float)", "", "output('shape', fab.shapes.blend(a, b, q))", "" ], "uid": 11 }, { "datums": [ { "expr": "\u0011[__11.__3]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__5.__5]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "0.87", "name": "q", "type": "float", "uid": 2 }, { "expr": "\u0012fab.types.Shape('iiiim-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634m-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634-+rbm-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634rbm-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634f0.28m-Xf-1.0446-Yf-3.94837-Zf0m*X-f1xn/r++qXqYqZf1.94*Y-f1xn/r++qXqYqZf1.94*Z-f1xn/r++qXqYqZf1.94m-Xf1.0446-Yf3.94837-Zf-0m-Xf-4.2-Yf-1.59-Zf0m*X-f1xn/r++qXqYqZf1.43*Y-f1xn/r++qXqYqZf1.43*Z-f1xn/r++qXqYqZf1.43m-Xf4.2-Yf1.59-Zf-0m-Xf-3.08375-Yf-3.12072-Zf0m+*f-0.595454X*f-0.803389Y+*f0.803389X*f-0.595454Y_m-Xf3.08375-Yf3.12072-Zf0aa-f-6.38375X-Xf0.21625a-f-3.39072Y-Yf-2.85072-+rbiim-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634m-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634-+rbm-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634rbm-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634f0.28rbm-Xf-1.0446-Yf-3.94837-Zf0m*X-f1xn/r++qXqYqZf1.94*Y-f1xn/r++qXqYqZf1.94*Z-f1xn/r++qXqYqZf1.94m-Xf1.0446-Yf3.94837-Zf-0m-Xf-4.2-Yf-1.59-Zf0m*X-f1xn/r++qXqYqZf1.43*Y-f1xn/r++qXqYqZf1.43*Z-f1xn/r++qXqYqZf1.43m-Xf4.2-Yf1.59-Zf-0m-Xf-3.08375-Yf-3.12072-Zf0m+*f-0.595454X*f-0.803389Y+*f0.803389X*f-0.595454Y_m-Xf3.08375-Yf3.12072-Zf0aa-f-6.38375X-Xf0.21625a-f-3.39072Y-Yf-2.85072f0.87',float('-6.505417'),float('-7.172430'),float('-inf'),float('0.337917'),float('0.930990'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 3 } ], "inspector": [ 1341.0200848290685, 177.72555341108136 ], "name": "b1", "script": [ "import fab.types", "import fab.shapes", "", "title('Blend')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "input('q', float)", "", "output('shape', fab.shapes.blend(a, b, q))", "" ], "uid": 12 }, { "datums": [ { "expr": "\u0011[__12.__3]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__9.__1]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "0.62", "name": "q", "type": "float", "uid": 2 }, { "expr": "\u0012fab.types.Shape('iiiiiim-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634m-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634-+rbm-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634rbm-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634f0.28m-Xf-1.0446-Yf-3.94837-Zf0m*X-f1xn/r++qXqYqZf1.94*Y-f1xn/r++qXqYqZf1.94*Z-f1xn/r++qXqYqZf1.94m-Xf1.0446-Yf3.94837-Zf-0m-Xf-4.2-Yf-1.59-Zf0m*X-f1xn/r++qXqYqZf1.43*Y-f1xn/r++qXqYqZf1.43*Z-f1xn/r++qXqYqZf1.43m-Xf4.2-Yf1.59-Zf-0m-Xf-3.08375-Yf-3.12072-Zf0m+*f-0.595454X*f-0.803389Y+*f0.803389X*f-0.595454Y_m-Xf3.08375-Yf3.12072-Zf0aa-f-6.38375X-Xf0.21625a-f-3.39072Y-Yf-2.85072-+rbiim-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634m-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634-+rbm-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634rbm-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634f0.28rbm-Xf-1.0446-Yf-3.94837-Zf0m*X-f1xn/r++qXqYqZf1.94*Y-f1xn/r++qXqYqZf1.94*Z-f1xn/r++qXqYqZf1.94m-Xf1.0446-Yf3.94837-Zf-0m-Xf-4.2-Yf-1.59-Zf0m*X-f1xn/r++qXqYqZf1.43*Y-f1xn/r++qXqYqZf1.43*Z-f1xn/r++qXqYqZf1.43m-Xf4.2-Yf1.59-Zf-0m-Xf-3.08375-Yf-3.12072-Zf0m+*f-0.595454X*f-0.803389Y+*f0.803389X*f-0.595454Y_m-Xf3.08375-Yf3.12072-Zf0aa-f-6.38375X-Xf0.21625a-f-3.39072Y-Yf-2.85072f0.87m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634-+rbiiiim-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634m-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634-+rbm-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634rbm-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634f0.28m-Xf-1.0446-Yf-3.94837-Zf0m*X-f1xn/r++qXqYqZf1.94*Y-f1xn/r++qXqYqZf1.94*Z-f1xn/r++qXqYqZf1.94m-Xf1.0446-Yf3.94837-Zf-0m-Xf-4.2-Yf-1.59-Zf0m*X-f1xn/r++qXqYqZf1.43*Y-f1xn/r++qXqYqZf1.43*Z-f1xn/r++qXqYqZf1.43m-Xf4.2-Yf1.59-Zf-0m-Xf-3.08375-Yf-3.12072-Zf0m+*f-0.595454X*f-0.803389Y+*f0.803389X*f-0.595454Y_m-Xf3.08375-Yf3.12072-Zf0aa-f-6.38375X-Xf0.21625a-f-3.39072Y-Yf-2.85072-+rbiim-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634m-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634-+rbm-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634rbm-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634f0.28rbm-Xf-1.0446-Yf-3.94837-Zf0m*X-f1xn/r++qXqYqZf1.94*Y-f1xn/r++qXqYqZf1.94*Z-f1xn/r++qXqYqZf1.94m-Xf1.0446-Yf3.94837-Zf-0m-Xf-4.2-Yf-1.59-Zf0m*X-f1xn/r++qXqYqZf1.43*Y-f1xn/r++qXqYqZf1.43*Z-f1xn/r++qXqYqZf1.43m-Xf4.2-Yf1.59-Zf-0m-Xf-3.08375-Yf-3.12072-Zf0m+*f-0.595454X*f-0.803389Y+*f0.803389X*f-0.595454Y_m-Xf3.08375-Yf3.12072-Zf0aa-f-6.38375X-Xf0.21625a-f-3.39072Y-Yf-2.85072f0.87rbm-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634f0.62',float('-6.505417'),float('-7.172430'),float('-inf'),float('0.337917'),float('1.019931'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 3 } ], "inspector": [ 2089.2746563360138, 338.47069528389733 ], "name": "b2", "script": [ "import fab.types", "import fab.shapes", "", "title('Blend')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "input('q', float)", "", "output('shape', fab.shapes.blend(a, b, q))", "" ], "uid": 13 }, { "datums": [ { "expr": "-5.91", "name": "x0", "type": "float", "uid": 0 }, { "expr": "-4.96", "name": "y0", "type": "float", "uid": 1 }, { "expr": "0.6", "name": "width", "type": "float", "uid": 2 }, { "expr": "0.19", "name": "height", "type": "float", "uid": 3 }, { "expr": "\u0012fab.types.Shape('aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865',float('-6.210000'),float('-5.055000'),float('-inf'),float('-5.610000'),float('-4.865000'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 1660.926080969012, -66.243160816857483 ], "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": 14 }, { "datums": [ { "expr": "\u0011[__14.__0]", "name": "x", "type": "float", "uid": 0 }, { "expr": "\u0011[__14.__1]", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "_z", "type": "float", "uid": 2 }, { "expr": "97.16860607600682", "name": "a", "type": "float", "uid": 3 }, { "expr": "\u0011[__14.__4]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865',float('-6.041695'),float('-5.269510'),float('-inf'),float('-5.778306'),float('-4.650490'),float('inf'))", "name": "rotated", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 1938.824219029975, -64.627473967665836 ], "name": "r8", "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": 15 }, { "datums": [ { "expr": "\u0011[__13.__3]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__15.__5,__19.__5,__21.__5,__23.__5,__25.__5,__26.__4,__28.__5,__30.__5]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aiiiiiim-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634m-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634-+rbm-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634rbm-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634f0.28m-Xf-1.0446-Yf-3.94837-Zf0m*X-f1xn/r++qXqYqZf1.94*Y-f1xn/r++qXqYqZf1.94*Z-f1xn/r++qXqYqZf1.94m-Xf1.0446-Yf3.94837-Zf-0m-Xf-4.2-Yf-1.59-Zf0m*X-f1xn/r++qXqYqZf1.43*Y-f1xn/r++qXqYqZf1.43*Z-f1xn/r++qXqYqZf1.43m-Xf4.2-Yf1.59-Zf-0m-Xf-3.08375-Yf-3.12072-Zf0m+*f-0.595454X*f-0.803389Y+*f0.803389X*f-0.595454Y_m-Xf3.08375-Yf3.12072-Zf0aa-f-6.38375X-Xf0.21625a-f-3.39072Y-Yf-2.85072-+rbiim-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634m-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634-+rbm-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634rbm-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634f0.28rbm-Xf-1.0446-Yf-3.94837-Zf0m*X-f1xn/r++qXqYqZf1.94*Y-f1xn/r++qXqYqZf1.94*Z-f1xn/r++qXqYqZf1.94m-Xf1.0446-Yf3.94837-Zf-0m-Xf-4.2-Yf-1.59-Zf0m*X-f1xn/r++qXqYqZf1.43*Y-f1xn/r++qXqYqZf1.43*Z-f1xn/r++qXqYqZf1.43m-Xf4.2-Yf1.59-Zf-0m-Xf-3.08375-Yf-3.12072-Zf0m+*f-0.595454X*f-0.803389Y+*f0.803389X*f-0.595454Y_m-Xf3.08375-Yf3.12072-Zf0aa-f-6.38375X-Xf0.21625a-f-3.39072Y-Yf-2.85072f0.87m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634-+rbiiiim-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634m-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634-+rbm-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634rbm-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634f0.28m-Xf-1.0446-Yf-3.94837-Zf0m*X-f1xn/r++qXqYqZf1.94*Y-f1xn/r++qXqYqZf1.94*Z-f1xn/r++qXqYqZf1.94m-Xf1.0446-Yf3.94837-Zf-0m-Xf-4.2-Yf-1.59-Zf0m*X-f1xn/r++qXqYqZf1.43*Y-f1xn/r++qXqYqZf1.43*Z-f1xn/r++qXqYqZf1.43m-Xf4.2-Yf1.59-Zf-0m-Xf-3.08375-Yf-3.12072-Zf0m+*f-0.595454X*f-0.803389Y+*f0.803389X*f-0.595454Y_m-Xf3.08375-Yf3.12072-Zf0aa-f-6.38375X-Xf0.21625a-f-3.39072Y-Yf-2.85072-+rbiim-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634m-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634-+rbm-Xf-4.81572-Yf-5.91019-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634rbm-Xf-3.95142-Yf-6.10379-Zf0m-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634f0.28rbm-Xf-1.0446-Yf-3.94837-Zf0m*X-f1xn/r++qXqYqZf1.94*Y-f1xn/r++qXqYqZf1.94*Z-f1xn/r++qXqYqZf1.94m-Xf1.0446-Yf3.94837-Zf-0m-Xf-4.2-Yf-1.59-Zf0m*X-f1xn/r++qXqYqZf1.43*Y-f1xn/r++qXqYqZf1.43*Z-f1xn/r++qXqYqZf1.43m-Xf4.2-Yf1.59-Zf-0m-Xf-3.08375-Yf-3.12072-Zf0m+*f-0.595454X*f-0.803389Y+*f0.803389X*f-0.595454Y_m-Xf3.08375-Yf3.12072-Zf0aa-f-6.38375X-Xf0.21625a-f-3.39072Y-Yf-2.85072f0.87rbm-Xf0-Yf0.6-Zf0m*X-f1xn/r++qXqYqZf0.69526*Y-f1xn/r++qXqYqZf0.69526*Z-f1xn/r++qXqYqZf0.69526m-Xf-0-Yf-0.6-Zf-0-r+q-Xf-0.79673q-Yf0.197819f0.56634f0.62niiiiiiim-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865m-Xf-6.66114-Yf-5.71146-Zf0m+*f0.199979X*f0.9798Y+*f-0.9798X*f0.199979Y_m-Xf6.66114-Yf5.71146-Zf0m-Xf-0.751139-Yf-0.75146-Zf0m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865m-Xf-5.97114-Yf-6.59146-Zf0m+*f0.947555X*f-0.319593Y+*f0.319593X*f0.947555Y_m-Xf5.97114-Yf6.59146-Zf0m-Xf-0.0611394-Yf-1.63146-Zf0m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865m-Xf-5.26114-Yf-6.77146-Zf0m+*f-0.587137X*f0.809487Y+*f-0.809487X*f-0.587137Y_m-Xf5.26114-Yf6.77146-Zf0m-Xf0.648861-Yf-1.81146-Zf0m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865m-Xf-4.30114-Yf-6.08146-Zf0m+*f0.0313876X*f0.999507Y+*f-0.999507X*f0.0313876Y_m-Xf4.30114-Yf6.08146-Zf0m-Xf1.60886-Yf-1.12146-Zf0m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865m-Xf5.14886-Yf4.33854-Zf0m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865m-Xf-0.47114-Yf0.41854-Zf0m+*f0.449456X*f-0.893302Y+*f0.893302X*f0.449456Y_m-Xf0.47114-Yf-0.41854-Zf0m-Xf5.43886-Yf5.37854-Zf0m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865m-Xf-1.49114-Yf0.41854-Zf0m+*f0.654741X*f0.755853Y+*f-0.755853X*f0.654741Y_m-Xf1.49114-Yf-0.41854-Zf0m-Xf4.41886-Yf5.37854-Zf0m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865',float('-6.505417'),float('-7.172430'),float('-inf'),float('0.337917'),float('1.019931'),float('inf'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 2231.2635387336627, -58.164726570899255 ], "name": "d0", "script": [ "import fab.types", "", "title('Difference')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 16 }, { "datums": [ { "expr": "\u0011[__15.__5]", "name": "shape", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0012fab.types.Shape('m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865',float('-6.041695'),float('-5.269510'),float('-inf'),float('-5.778306'),float('-4.650490'),float('inf'))", "name": "copy", "type": "_fabtypes.Shape", "uid": 1 } ], "inspector": [ 2239.341972979621, 106.63533204664863 ], "name": "c4", "script": [ "# Neil Gershenfeld 2/14/15", "# Matt Keeter 6/12/15", "", "import fab", "", "title('Copy')", "", "input('shape', fab.types.Shape)", "output('copy', shape)", "", "" ], "uid": 17 }, { "datums": [ { "expr": "-6.66114", "name": "x", "type": "float", "uid": 0 }, { "expr": "-5.71146", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "z", "type": "float", "uid": 2 }, { "expr": "\u0011[__17.__1]", "name": "shape", "type": "_fabtypes.Shape", "uid": 3 }, { "expr": "\u0012fab.types.Shape('m-Xf-0.751139-Yf-0.75146-Zf0m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865',float('-6.792834'),float('-6.020970'),float('-inf'),float('-6.529445'),float('-5.401950'),float('inf'))", "name": "out", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 2551.1695348736084, 117.94513999099019 ], "name": "r9", "script": [ "import fab", "", "title('Recenter')", "", "input('x', float)", "input('y', float)", "input('z', float)", "", "input('shape', fab.types.Shape)", "output('out', fab.shapes.recenter(shape, x, y, z))", "", "# UI", "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)", "" ], "uid": 18 }, { "datums": [ { "expr": "\u0011[__18.__0]", "name": "x", "type": "float", "uid": 0 }, { "expr": "\u0011[__18.__1]", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "_z", "type": "float", "uid": 2 }, { "expr": "78.46426042000672", "name": "a", "type": "float", "uid": 3 }, { "expr": "\u0011[__18.__4]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf-6.66114-Yf-5.71146-Zf0m+*f0.199979X*f0.9798Y+*f-0.9798X*f0.199979Y_m-Xf6.66114-Yf5.71146-Zf0m-Xf-0.751139-Yf-0.75146-Zf0m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865',float('-6.990734'),float('-5.902389'),float('-inf'),float('-6.331546'),float('-5.520530'),float('inf'))", "name": "rotated", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 2838.0101275934944, 120.22379231140604 ], "name": "r10", "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": 19 }, { "datums": [ { "expr": "-5.97114", "name": "x", "type": "float", "uid": 0 }, { "expr": "-6.59146", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "z", "type": "float", "uid": 2 }, { "expr": "\u0011[__17.__1]", "name": "shape", "type": "_fabtypes.Shape", "uid": 3 }, { "expr": "\u0012fab.types.Shape('m-Xf-0.0611394-Yf-1.63146-Zf0m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865',float('-6.102835'),float('-6.900970'),float('-inf'),float('-5.839446'),float('-6.281950'),float('inf'))", "name": "out", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 2555.7048170412713, 346.53385328445574 ], "name": "r11", "script": [ "import fab", "", "title('Recenter')", "", "input('x', float)", "input('y', float)", "input('z', float)", "", "input('shape', fab.types.Shape)", "output('out', fab.shapes.recenter(shape, x, y, z))", "", "# UI", "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)", "" ], "uid": 20 }, { "datums": [ { "expr": "\u0011[__20.__0]", "name": "x", "type": "float", "uid": 0 }, { "expr": "\u0011[__20.__1]", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "_z", "type": "float", "uid": 2 }, { "expr": "-18.638307867500682", "name": "a", "type": "float", "uid": 3 }, { "expr": "\u0011[__20.__4]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf-5.97114-Yf-6.59146-Zf0m+*f0.947555X*f-0.319593Y+*f0.319593X*f0.947555Y_m-Xf5.97114-Yf6.59146-Zf0m-Xf-0.0611394-Yf-1.63146-Zf0m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865',float('-6.194846'),float('-6.926826'),float('-inf'),float('-5.747436'),float('-6.256094'),float('inf'))", "name": "rotated", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 2849.8317002042727, 343.34778777253496 ], "name": "r12", "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": 21 }, { "datums": [ { "expr": "-5.26114", "name": "x", "type": "float", "uid": 0 }, { "expr": "-6.77146", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "z", "type": "float", "uid": 2 }, { "expr": "\u0011[__17.__1]", "name": "shape", "type": "_fabtypes.Shape", "uid": 3 }, { "expr": "\u0012fab.types.Shape('m-Xf0.648861-Yf-1.81146-Zf0m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865',float('-5.392834'),float('-7.080970'),float('-inf'),float('-5.129445'),float('-6.461950'),float('inf'))", "name": "out", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 2545.6675183227044, 560.54998569169015 ], "name": "r13", "script": [ "import fab", "", "title('Recenter')", "", "input('x', float)", "input('y', float)", "input('z', float)", "", "input('shape', fab.types.Shape)", "output('out', fab.shapes.recenter(shape, x, y, z))", "", "# UI", "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)", "" ], "uid": 22 }, { "datums": [ { "expr": "\u0011[__22.__0]", "name": "x", "type": "float", "uid": 0 }, { "expr": "\u0011[__22.__1]", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "_z", "type": "float", "uid": 2 }, { "expr": "125.9541252346711", "name": "a", "type": "float", "uid": 3 }, { "expr": "\u0011[__22.__4]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf-5.26114-Yf-6.77146-Zf0m+*f-0.587137X*f0.809487Y+*f-0.809487X*f-0.587137Y_m-Xf5.26114-Yf6.77146-Zf0m-Xf0.648861-Yf-1.81146-Zf0m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865',float('-5.589007'),float('-7.059790'),float('-inf'),float('-4.933273'),float('-6.483130'),float('inf'))", "name": "rotated", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 2848.9395632581682, 562.86593673067387 ], "name": "r14", "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": 23 }, { "datums": [ { "expr": "-4.30114", "name": "x", "type": "float", "uid": 0 }, { "expr": "-6.08146", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "z", "type": "float", "uid": 2 }, { "expr": "\u0011[__17.__1]", "name": "shape", "type": "_fabtypes.Shape", "uid": 3 }, { "expr": "\u0012fab.types.Shape('m-Xf1.60886-Yf-1.12146-Zf0m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865',float('-4.432835'),float('-6.390970'),float('-inf'),float('-4.169446'),float('-5.771950'),float('inf'))", "name": "out", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 2546.5596552688094, 776.38769070970363 ], "name": "r15", "script": [ "import fab", "", "title('Recenter')", "", "input('x', float)", "input('y', float)", "input('z', float)", "", "input('shape', fab.types.Shape)", "output('out', fab.shapes.recenter(shape, x, y, z))", "", "# UI", "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)", "" ], "uid": 24 }, { "datums": [ { "expr": "\u0011[__24.__0]", "name": "x", "type": "float", "uid": 0 }, { "expr": "\u0011[__24.__1]", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "_z", "type": "float", "uid": 2 }, { "expr": "88.20132955654962", "name": "a", "type": "float", "uid": 3 }, { "expr": "\u0011[__24.__4]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf-4.30114-Yf-6.08146-Zf0m+*f0.0313876X*f0.999507Y+*f-0.999507X*f0.0313876Y_m-Xf4.30114-Yf6.08146-Zf0m-Xf1.60886-Yf-1.12146-Zf0m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865',float('-4.614631'),float('-6.222805'),float('-inf'),float('-3.987649'),float('-5.940116'),float('inf'))", "name": "rotated", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 2850.7611358689469, 777.81150480258168 ], "name": "r16", "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": 25 }, { "datums": [ { "expr": "-0.76114", "name": "x", "type": "float", "uid": 0 }, { "expr": "-0.62146", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "z", "type": "float", "uid": 2 }, { "expr": "\u0011[__17.__1]", "name": "shape", "type": "_fabtypes.Shape", "uid": 3 }, { "expr": "\u0012fab.types.Shape('m-Xf5.14886-Yf4.33854-Zf0m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865',float('-0.892835'),float('-0.930970'),float('-inf'),float('-0.629446'),float('-0.311950'),float('inf'))", "name": "out", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 2540.132717398189, 1007.0807186995854 ], "name": "r17", "script": [ "import fab", "", "title('Recenter')", "", "input('x', float)", "input('y', float)", "input('z', float)", "", "input('shape', fab.types.Shape)", "output('out', fab.shapes.recenter(shape, x, y, z))", "", "# UI", "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)", "" ], "uid": 26 }, { "datums": [ { "expr": "-0.47114", "name": "x", "type": "float", "uid": 0 }, { "expr": "0.41854", "name": "y", "type": "float", "uid": 1 }, { "expr": "0", "name": "z", "type": "float", "uid": 2 }, { "expr": "\u0011[__17.__1]", "name": "shape", "type": "_fabtypes.Shape", "uid": 3 }, { "expr": "\u0012fab.types.Shape('m-Xf5.43886-Yf5.37854-Zf0m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865',float('-0.602835'),float('0.109030'),float('-inf'),float('-0.339446'),float('0.728050'),float('inf'))", "name": "out", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 2537.2350729052737, 1209.1123144829899 ], "name": "r18", "script": [ "import fab", "", "title('Recenter')", "", "input('x', float)", "input('y', float)", "input('z', float)", "", "input('shape', fab.types.Shape)", "output('out', fab.shapes.recenter(shape, x, y, z))", "", "# UI", "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)", "" ], "uid": 27 }, { "datums": [ { "expr": "\u0011[__27.__0]", "name": "x", "type": "float", "uid": 0 }, { "expr": "\u0011[__27.__1]", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "_z", "type": "float", "uid": 2 }, { "expr": "-63.2912", "name": "a", "type": "float", "uid": 3 }, { "expr": "\u0011[__27.__4]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf-0.47114-Yf0.41854-Zf0m+*f0.449456X*f-0.893302Y+*f0.893302X*f0.449456Y_m-Xf0.47114-Yf-0.41854-Zf0m-Xf5.43886-Yf5.37854-Zf0m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865',float('-0.806817'),float('0.161786'),float('-inf'),float('-0.135463'),float('0.675295'),float('inf'))", "name": "rotated", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 2866.8511522220451, 1215.2447255546774 ], "name": "r19", "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": 28 }, { "datums": [ { "expr": "-1.49114", "name": "x", "type": "float", "uid": 0 }, { "expr": "0.41854", "name": "y", "type": "float", "uid": 1 }, { "expr": "0", "name": "z", "type": "float", "uid": 2 }, { "expr": "\u0011[__17.__1]", "name": "shape", "type": "_fabtypes.Shape", "uid": 3 }, { "expr": "\u0012fab.types.Shape('m-Xf4.41886-Yf5.37854-Zf0m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865',float('-1.622835'),float('0.109030'),float('-inf'),float('-1.359446'),float('0.728050'),float('inf'))", "name": "out", "type": "_fabtypes.Shape", "uid": 4 } ], "inspector": [ 2522.5907420214767, 1422.4280442743109 ], "name": "r20", "script": [ "import fab", "", "title('Recenter')", "", "input('x', float)", "input('y', float)", "input('z', float)", "", "input('shape', fab.types.Shape)", "output('out', fab.shapes.recenter(shape, x, y, z))", "", "# UI", "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)", "" ], "uid": 29 }, { "datums": [ { "expr": "\u0011[__29.__0]", "name": "x", "type": "float", "uid": 0 }, { "expr": "\u0011[__29.__1]", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "_z", "type": "float", "uid": 2 }, { "expr": "49.1", "name": "a", "type": "float", "uid": 3 }, { "expr": "\u0011[__29.__4]", "name": "shape", "type": "_fabtypes.Shape", "uid": 4 }, { "expr": "\u0012fab.types.Shape('m-Xf-1.49114-Yf0.41854-Zf0m+*f0.654741X*f0.755853Y+*f-0.755853X*f0.654741Y_m-Xf1.49114-Yf-0.41854-Zf0m-Xf4.41886-Yf5.37854-Zf0m-Xf-5.91-Yf-4.96-Zf0m+*f-0.12479X*f0.992183Y+*f-0.992183X*f-0.12479Y_m-Xf5.91-Yf4.96-Zf0aa-f-6.21X-Xf-5.61a-f-5.055Y-Yf-4.865',float('-1.811310'),float('0.116349'),float('-inf'),float('-1.170970'),float('0.720730'),float('inf'))", "name": "rotated", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 2860.7960767607128, 1423.2101085392489 ], "name": "r21", "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": 30 } ], "protocol": 6, "type": "sb" }