Ejemplo n.º 1
0
def print_generic(xs, ys, zs, period, step_length):

    harmonograph = Harmonograph(xs, ys, zs)

    steps = int(period / step_length) + 1

    ts = [e * step_length * math.pi for e in range(steps)]
    points = [harmonograph.get_position(t) for t in ts]

    return rs.AddInterpCurve(points)
Ejemplo n.º 2
0
def augmented_chord2():

    s1 = Simple(1, 1, 0, 0)
    s2 = Simple(1.25, 1.25, 0, 0)
    s3 = Simple(25/16.0, 25/16.0, 0, 0)
    hg1 = Harmonograph([s1], [s2], [s3])

    pts = []
    for e in range(10000):
        t = .01 * e
        pts.append(hg1.get_position(t))
Ejemplo n.º 3
0
def print_generic(xs, ys, zs, period, step_length):

    harmonograph = Harmonograph(xs, ys, zs)

    steps = int(period / step_length)

    ts = [e * step_length * math.pi for e in range(steps)]
    points = [harmonograph.get_position(t) for t in ts]

    return rs.AddInterpCurve(points)

    numbered_points = [(i, x, y, z) for (i, (x, y, z)) in enumerate(points)]
    sorted_numbered_points = sorted(numbered_points, key=lambda e: e[1])

    pairs = []

    flag = True

    for j, (i, x, y, z) in enumerate(sorted_numbered_points):
        frame_points = sorted_numbered_points[j+1:j+20]
        for pt in frame_points:
            ib, xb, yb, zb = pt
            
            idiff = abs(i - ib)
            if idiff > 100:
                xdiff = abs(x - xb)
                if xdiff < .05:
                    p1 = (x, y, z)
                    p2 = (xb, yb, zb)
                    distance = point_distance_raw(p1, p2)
                    if distance < .1:
                        import pdb; pdb.set_trace()

                        pairs.append((p1, p2))
                        #print(p1)
                        #print(distance)
    
    #print(len(pairs))

    #print(pairs[0])
    print(point_distance_raw(pairs[0][0], pairs[0][1]))

    for a, b in pairs[:1]:
        rs.AddPoint(a)

    #return pairs
                
    #import pdb; pdb.set_trace()

    
    #return rs.AddPolyline(points)
    return rs.AddInterpCurve(points)
Ejemplo n.º 4
0
def new():

    s1 = Simple(1, 1, 0, 0)
    s2 = Simple(1, 2, 0, 0)
    s3 = Simple(1, 3, 0, 0)
    hg1 = Harmonograph([s1], [s2], [s3])

    pts = []
    for e in range(10000):
        t = .01 * e
        pts.append(hg1.get_position(t))

    return rs.AddPolyline(pts)
Ejemplo n.º 5
0
def diminished_chord():

    s1 = Simple(1, 1, 0, 0)
    s2 = Simple(1, 1.2, 0, 0)
    s3 = Simple(1, 36/25.0, 0, 0)
    hg1 = Harmonograph([s1], [s2], [s3])

    pts = []
    for e in range(10000):
        t = .01 * e
        pts.append(hg1.get_position(t))

    return rs.AddInterpCurve(pts)
Ejemplo n.º 6
0
def major_chord():

    s1 = Simple(1, 1, 0, 0)
    s2 = Simple(1, 1.25, 0, 0)
    s3 = Simple(1, 1.5, 0, 0)
    hg1 = Harmonograph([s1], [s2], [s3])

    pts = []
    for e in range(3000):
        t = .01 * e
        pts.append(hg1.get_position(t))

    return rs.AddInterpCurve(pts)
Ejemplo n.º 7
0
def new6():
    # Too big.

    s1 = Simple(.3, .32, 0, 0)
    s2 = Simple(.7, .67, 0, 0)
    s3 = Simple(1.25, 1.25, 0, 0)
    hg1 = Harmonograph([s1], [s2], [s3])

    pts = []
    for e in range(1000000):
        t = .01 * e
        pts.append(hg1.get_position(t))

    return rs.AddPolyline(pts)
Ejemplo n.º 8
0
def new5():
    # Gorgeous.


    s1 = Simple(.5, 1, 0, 0)
    s2 = Simple(1, .48, 0, 0)
    s3 = Simple(1, 1.2, 0, 0)
    hg1 = Harmonograph([s1], [s2], [s3])

    pts = []
    for e in range(100000):
        t = .01 * e
        pts.append(hg1.get_position(t))

    return rs.AddPolyline(pts)
Ejemplo n.º 9
0
def new3():

    # PRINT THIS ONE!

    s1 = Simple(1, 3, 0, 0)
    s2 = Simple(1, .75, 0, 0)
    s3 = Simple(1, 3.1, 0, 0)
    hg1 = Harmonograph([s1], [s2], [s3])

    pts = []
    for e in range(10000):
        t = .01 * e
        pts.append(hg1.get_position(t))

    return rs.AddPolyline(pts)