{
    "nodes": [
        {
            "datums": [
                {
                    "expr": "0",
                    "name": "x0",
                    "type": "float",
                    "uid": 0
                },
                {
                    "expr": "0",
                    "name": "y0",
                    "type": "float",
                    "uid": 1
                },
                {
                    "expr": "1.4324340846122783",
                    "name": "r",
                    "type": "float",
                    "uid": 2
                },
                {
                    "expr": "0.022693616842108435",
                    "name": "_a",
                    "type": "float",
                    "uid": 3
                },
                {
                    "expr": "\u0012fab.types.Shape('-r+qXqYf1.43243',float('-1.432434'),float('-1.432434'),float('-inf'),float('1.432434'),float('1.432434'),float('inf'))",
                    "name": "shape",
                    "type": "_fabtypes.Shape",
                    "uid": 4
                }
            ],
            "inspector": [
                -411.36492098205986,
                54.704642550978406
            ],
            "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",
                    "name": "x0",
                    "type": "float",
                    "uid": 0
                },
                {
                    "expr": "0",
                    "name": "y0",
                    "type": "float",
                    "uid": 1
                },
                {
                    "expr": "1.2521260722966543",
                    "name": "r",
                    "type": "float",
                    "uid": 2
                },
                {
                    "expr": "-0.2823177455492471",
                    "name": "_a",
                    "type": "float",
                    "uid": 3
                },
                {
                    "expr": "\u0012fab.types.Shape('-r+qXqYf1.25213',float('-1.252126'),float('-1.252126'),float('-inf'),float('1.252126'),float('1.252126'),float('inf'))",
                    "name": "shape",
                    "type": "_fabtypes.Shape",
                    "uid": 4
                }
            ],
            "inspector": [
                -398.3276222634922,
                292.6008125988928
            ],
            "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": 1
        },
        {
            "datums": [
                {
                    "expr": "\u0011[__0.__4]",
                    "name": "a",
                    "type": "_fabtypes.Shape",
                    "uid": 0
                },
                {
                    "expr": "\u0011[__1.__4]",
                    "name": "b",
                    "type": "_fabtypes.Shape",
                    "uid": 1
                },
                {
                    "expr": "\u0012fab.types.Shape('a-r+qXqYf1.43243n-r+qXqYf1.25213',float('-1.432434'),float('-1.432434'),float('-inf'),float('1.432434'),float('1.432434'),float('inf'))",
                    "name": "shape",
                    "type": "_fabtypes.Shape",
                    "uid": 2
                }
            ],
            "inspector": [
                -81.18649359283873,
                208.06956353303826
            ],
            "name": "d0",
            "script": [
                "import fab.types",
                "",
                "title('Difference')",
                "input('a', fab.types.Shape)",
                "input('b', fab.types.Shape)",
                "",
                "output('shape', a & ~b)",
                ""
            ],
            "uid": 2
        },
        {
            "datums": [
                {
                    "expr": "0.010917901992797852",
                    "name": "_x",
                    "type": "float",
                    "uid": 0
                },
                {
                    "expr": "0.026500701904296875",
                    "name": "_y",
                    "type": "float",
                    "uid": 1
                },
                {
                    "expr": "0.0",
                    "name": "zmin",
                    "type": "float",
                    "uid": 2
                },
                {
                    "expr": "1",
                    "name": "zmax",
                    "type": "float",
                    "uid": 3
                },
                {
                    "expr": "\u0011[__2.__2]",
                    "name": "shape",
                    "type": "_fabtypes.Shape",
                    "uid": 4
                },
                {
                    "expr": "\u0012fab.types.Shape('am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1',float('-1.432434'),float('-1.432434'),float('0.000000'),float('1.432434'),float('1.432434'),float('1.000000'))",
                    "name": "out",
                    "type": "_fabtypes.Shape",
                    "uid": 5
                }
            ],
            "inspector": [
                243.3024228503508,
                182.33972156891855
            ],
            "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": "\u0011[__3.__5]",
                    "name": "shape",
                    "type": "_fabtypes.Shape",
                    "uid": 0
                },
                {
                    "expr": "-2.108782172203064",
                    "name": "x",
                    "type": "float",
                    "uid": 1
                },
                {
                    "expr": "-1.4097110033035278",
                    "name": "y",
                    "type": "float",
                    "uid": 2
                },
                {
                    "expr": "21",
                    "name": "n",
                    "type": "int",
                    "uid": 3
                },
                {
                    "expr": "\u0012fab.types.Shape('iiiiiiiiiiiiiiiiiiiim-Xf-2.10878-Yf-1.40971-Zf0m+*f1X*f0Y+*f-0X*f1Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1m-Xf-2.10878-Yf-1.40971-Zf0m+*f0.955573X*f0.294755Y+*f-0.294755X*f0.955573Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1m-Xf-2.10878-Yf-1.40971-Zf0m+*f0.826239X*f0.56332Y+*f-0.56332X*f0.826239Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1m-Xf-2.10878-Yf-1.40971-Zf0m+*f0.62349X*f0.781831Y+*f-0.781831X*f0.62349Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1m-Xf-2.10878-Yf-1.40971-Zf0m+*f0.365341X*f0.930874Y+*f-0.930874X*f0.365341Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1m-Xf-2.10878-Yf-1.40971-Zf0m+*f0.0747301X*f0.997204Y+*f-0.997204X*f0.0747301Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1m-Xf-2.10878-Yf-1.40971-Zf0m+*f-0.222521X*f0.974928Y+*f-0.974928X*f-0.222521Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1m-Xf-2.10878-Yf-1.40971-Zf0m+*f-0.5X*f0.866025Y+*f-0.866025X*f-0.5Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1m-Xf-2.10878-Yf-1.40971-Zf0m+*f-0.733052X*f0.680173Y+*f-0.680173X*f-0.733052Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1m-Xf-2.10878-Yf-1.40971-Zf0m+*f-0.900969X*f0.433884Y+*f-0.433884X*f-0.900969Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1m-Xf-2.10878-Yf-1.40971-Zf0m+*f-0.988831X*f0.149042Y+*f-0.149042X*f-0.988831Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1m-Xf-2.10878-Yf-1.40971-Zf0m+*f-0.988831X*f-0.149042Y+*f0.149042X*f-0.988831Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1m-Xf-2.10878-Yf-1.40971-Zf0m+*f-0.900969X*f-0.433884Y+*f0.433884X*f-0.900969Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1m-Xf-2.10878-Yf-1.40971-Zf0m+*f-0.733052X*f-0.680173Y+*f0.680173X*f-0.733052Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1m-Xf-2.10878-Yf-1.40971-Zf0m+*f-0.5X*f-0.866025Y+*f0.866025X*f-0.5Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1m-Xf-2.10878-Yf-1.40971-Zf0m+*f-0.222521X*f-0.974928Y+*f0.974928X*f-0.222521Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1m-Xf-2.10878-Yf-1.40971-Zf0m+*f0.0747301X*f-0.997204Y+*f0.997204X*f0.0747301Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1m-Xf-2.10878-Yf-1.40971-Zf0m+*f0.365341X*f-0.930874Y+*f0.930874X*f0.365341Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1m-Xf-2.10878-Yf-1.40971-Zf0m+*f0.62349X*f-0.781831Y+*f0.781831X*f0.62349Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1m-Xf-2.10878-Yf-1.40971-Zf0m+*f0.826239X*f-0.56332Y+*f0.56332X*f0.826239Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1m-Xf-2.10878-Yf-1.40971-Zf0m+*f0.955573X*f-0.294755Y+*f0.294755X*f0.955573Y_m-Xf2.10878-Yf1.40971-Zf0am__f1a-r+qXqYf1.43243n-r+qXqYf1.25213a-f0Z-Zf1',float('-6.637824'),float('-5.901787'),float('0.000000'),float('2.418146'),float('3.130970'),float('1.000000'))",
                    "name": "array",
                    "type": "_fabtypes.Shape",
                    "uid": 4
                }
            ],
            "inspector": [
                258.95294735176003,
                393.4945755158049
            ],
            "name": "a2",
            "script": [
                "import fab",
                "import math",
                "",
                "title('Array (polar)')",
                "",
                "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": 6
        }
    ],
    "protocol": 6,
    "type": "sb"
}
