Example #1
0
def main():
    
    

    
    f_index = 0

    #for f in range(10):
    #    points= []
    #    faces = []
    #    line_p , line_f = line((0,0,50-f*5), (0,0,50-f*5-5))
    #    points, faces  = append_shapes(points,faces,line_p,line_f)
    #    model_to_gcode.save_as_gcode(points, faces, create_filename(f_index))
    #    f_index += 1

    d = FallingDrop(start_tick = 0, duration = 10)
    c1 = ExpandingCircle(start_tick = 10, duration = 10)
    c2 = ExpandingCircle(start_tick = 15, duration = 5)



    for tick in range(30):
        points= []
        faces = []
        points,faces = append_shapes((points, faces), c1.get(tick))
        points,faces = append_shapes((points, faces), c2.get(tick))
        print points
        points,faces = append_shapes((points, faces), d.get(tick))
        model_to_gcode.save_as_gcode(points, faces, create_filename(f_index))
        f_index += 1


    
    #points = model_manipulation.center_points(points)
    maxmin = model_manipulation.max_min_values(points)
    print maxmin
    #faces = model_manipulation.order_faces(points, faces)
    
    return
Example #2
0
def main():
    points = []
    faces = []

    #c = ExpandingCircleAnimation((0.0,0.0,10.0),0,10,tween.ease_out_quad, 0.0,10.0, 10.0)
    #for tick in range(1, 10):
    #    points, faces = add_shape((points, faces),c.get(tick))

    #points, faces = add_shape((points, faces),c.get(9))
    
    #r = FallingLineAnimation((0.0,0.0,0.0), 0.0, 20.0, tween.ease_in_quad, 90, 0, length = 5.0)
    #for tick in range(20):
    #    points, faces = add_shape((points, faces),r.get(tick))
    #points, faces = add_shape((points, faces),r.get(1))

    d1 = RainDropAnimation((20.0,20.0,0.0), 0.0, 30.0, 80.0, 20.0, loop=True)
    d2 = RainDropAnimation((0.0,20.0,0.0), 0.0, 30.0, 80.0, 20.0, loop=True)
    d3 = RainDropAnimation((-20.0,20.0,0.0), 0.0, 30.0, 80.0, 20.0, loop=True)
    
    d4 = RainDropAnimation((20.0,0.0,0.0), 0.0, 30.0, 80.0, 20.0, loop=True)
    d5 = RainDropAnimation((0.0,0.0,0.0), 0.0, 30.0, 80.0, 20.0, loop=True)
    d6 = RainDropAnimation((-20.0,0.0,0.0), 0.0, 30.0, 80.0, 20.0, loop=True)
    
    d7 = RainDropAnimation((20.0,-20.0,0.0), 0.0, 30.0, 80.0, 20.0, loop=True)
    d8 = RainDropAnimation((0.0,-20.0,0.0), 0.0, 30.0, 80.0, 20.0, loop=True)
    d9 = RainDropAnimation((-20.0,-20.0,0.0), 0.0, 30.0, 80.0, 20.0, loop=True)


    points = []
    faces = []
    duration = 60

    o1 = randint(0,30)
    o2 = randint(0,30)
    o3 = randint(0,30)
    o4 = randint(0,30)
    o5 = randint(0,30)
    o6 = randint(0,30)
    o7 = randint(0,30)
    o8 = randint(0,30)
    o9 = randint(0,30)

    for tick in range(30):
        points = []
        faces = []
        #   points, faces = add_shape((points, faces),d.get(tick))
        points, faces = add_object((points, faces),d1.get(tick+o1))
        points, faces = add_object((points, faces),d2.get(tick+o2))
        points, faces = add_object((points, faces),d3.get(tick+o3))
        points, faces = add_object((points, faces),d4.get(tick+o4))
        points, faces = add_object((points, faces),d5.get(tick+o5))
        points, faces = add_object((points, faces),d6.get(tick+o6))
        points, faces = add_object((points, faces),d7.get(tick+o7))
        points, faces = add_object((points, faces),d8.get(tick+o8))
        points, faces = add_object((points, faces),d9.get(tick+o9))
        #print points
        #print faces

        filename = str(tick).zfill(3)+".gcode"
        model_to_gcode.save_as_gcode(points, faces, filename)


    print points
    print faces