Swervy Curvey

Swervy Curvey

thingiverse

import bpy import math import time import datetime from random import uniform sqr_bool = False def make_square(): sqrObj = bpy.ops.object.add(type='CURVE', enter_editmode=True) bpy.context.active_object.name = 'bev_sqr' bpy.ops.curve.select_linked() bpy.ops.curve.delete() bpy.ops.curve.vertex_add(location=(0.0, 0.0, 0.0)) bpy.ops.curve.vertex_add(location=(0.1, 0.0, 0.0)) bpy.ops.curve.vertex_add(location=(0.9, 0.0, 0.0)) bpy.ops.curve.vertex_add(location=(1.0, 0.0, 0.0)) bpy.ops.curve.vertex_add(location=(1.0, -0.1, 0.0)) bpy.ops.curve.vertex_add(location=(1.0, -0.9, 0.0)) bpy.ops.curve.vertex_add(location=(1.0, -1.0, 0.0)) bpy.ops.curve.vertex_add(location=(0.9, -1.0, 0.0)) bpy.ops.curve.vertex_add(location=(0.1, -1.0, 0.0)) bpy.ops.curve.vertex_add(location=(0.0, -1.0, 0.0)) bpy.ops.curve.vertex_add(location=(0.0, -0.9, 0.0)) bpy.ops.curve.vertex_add(location=(0.0, -0.1, 0.0)) bpy.ops.curve.cyclic_toggle() bpy.ops.curve.select_linked() bpy.ops.transform.resize(value=(50.0, 50.0, 50.0)) bpy.ops.object.mode_set(mode='OBJECT') print("Object bev_sqr created") if sqr_bool: make_square() def angle_generator(length=3, circ = 3): angle_id = 0 ts = time.time() st = datetime.datetime.fromtimestamp(ts).strftime('%A, %d. %B %Y %I:%M:%S%p') angles = [uniform(10,100), uniform(10,100), uniform(10,100), uniform(10,100)] angle_list = [[angles[0],angles[1],angles[2]], [angles[1],angles[2],angles[3]], [angles[2],angles[3],angles[0]], [angles[3],angles[0],angles[1]]] curve_x = 0 curve_y = 0 curve_z = 0 propagate_x = 0 propagate_y = 0 propagate_z = 0 print("ANGLE GEN: ", st) bpy.ops.curve.primitive_bezier_curve_add(location=(0, 0, 0), enter_editmode=True) for index in range(length): angle_id += 1 x_angle_prop = angle_list[angle_id][0] y_angle_prop = angle_list[angle_id][1] z_angle_prop = angle_list[angle_id][2] size = 100 print("ANGLES: ", x_angle_prop, y_angle_prop, z_angle_prop) for circ_index in range(circ): propagate_x += x_angle_prop propagate_y += y_angle_prop propagate_z += z_angle_prop curve_x = math.sin(propagate_x) * size curve_y = math.cos(propagate_y) * size curve_z = math.sin(propagate_z) * size print(curve_x,curve_y,curve_z) bpy.ops.curve.vertex_add(location=(curve_x,curve_y,curve_z)) bpy.ops.curve.cyclic_toggle() bpy.ops.object.mode_set(mode='OBJECT') scale = 0.05 bpy.context.object.scale = (scale,scale,scale) angle_generator() def bev_object(): for bezier_obj in bpy.data.curves: if bezier_obj.name != 'bev_sqr' and bezier_obj.name != 'taper_sqr' and bezier_obj.name != 'cam_track_8': bezier_obj.bevel_object = bpy.data.objects['bev_sqr'] # bezier_obj.taper_object = bpy.data.objects['taper_sqr'] bezier_obj.use_fill_caps = True bev_object();

Download Model from thingiverse

With this file you will be able to print Swervy Curvey with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on Swervy Curvey.