Demos#

Reflection Knots#

These are curves made by reflecting a “unit cell” to generate the complete knot

def knot1():
    return path_from_pts(
        [
            (Pt(0, 0.8), np.rad2deg(np.pi)),
            (Pt(-0.7, 0.15), np.rad2deg(-np.pi / 10)),
            (Pt(-0.7, 0.7), 0),
            (Pt(0.5, -0.75), np.rad2deg(-np.pi / 2)),
            (Pt(-0.8, 0), np.rad2deg(-np.pi / 2)),
        ],
    )

(Source code)

_images/demos_demo_knot1_00.png

(png, svg, pdf)#

_images/demos_demo_knot1_01.png

(png, svg, pdf)#

Bands#

Running linear bands inspired by page boarders. In principle these should be tiled from one unit, but are currently just fixed length (and bigger than the view)

def band1():
    return path_from_pts(
        [
            (Pt(x, y), 0)
            for (x, y) in zip(
                np.arange(-2, 2, 0.1),
                cycle([-0.55, 0.55]),
            )
        ],
        scale=0.7,
        closed=False,
    )

(Source code, png, svg, pdf)

_images/demos_demo_band1.png
def band2():
    return path_from_pts(
        [
            (Pt(x, y), np.rad2deg(angle))
            for (x, y, angle) in zip(
                np.arange(-2, 2, 0.2),
                cycle([-0.55, 0.55]),
                cycle([0, np.pi]),
            )
        ],
        scale=0.7,
        closed=False,
    )

(Source code, png, svg, pdf)

_images/demos_demo_band2.png

Rings#

def ring1():
    r = 0.5

    return path_from_pts(
        [
            (
                Pt(np.cos(th) * (r + dr), np.sin(th) * (r - dr)),
                np.rad2deg(th - np.pi / 2),
            )
            for (th, dr) in zip(np.linspace(0, 2 * np.pi, 13), cycle([-0.4, 0.4]))
        ],
        scale=1,
        closed=True,
    )

(Source code)

_images/demos_demo_ring1_00.png

(png, svg, pdf)#

_images/demos_demo_ring1_01.png

(png, svg, pdf)#

def ring2():
    r = 0.5

    return path_from_pts(
        [
            (
                Pt(np.cos(th) * (r + dr), np.sin(th) * (r + dr)),
                np.rad2deg(th + phi),
            )
            for (th, dr, phi) in zip(
                np.linspace(0, 2 * np.pi, 13),
                cycle([-0.3, 0.3]),
                cycle([-np.pi / 2, np.pi / 2]),
            )
        ],
        scale=1,
        closed=True,
    )

(Source code)

_images/demos_demo_ring2_00.png

(png, svg, pdf)#

_images/demos_demo_ring2_01.png

(png, svg, pdf)#