from parts import sbr_rail, sbr16uu_vert, pillow_block # --- settings --- screw_to_plate = sbr_rail['height'] + sbr16uu_vert[ 'hole_height'] - pillow_block['hole_height'] print('screw_to_plate: ' + str(screw_to_plate)) bit = gg.inch(0.25) width = 80 height = screw_to_plate + 10 # outer outer = create_elements(type='hole_sets', spacing_x=width + bit, spacing_y=height + bit) outer = [outer[0][0], outer[2][0], outer[3][0], outer[1][0], outer[0][0]] rc = [] rc.append({ 'type': 'circle', 'depth': 11, 'center': [width / 2.0 + bit / 2.0, screw_to_plate + bit / 2.0], 'radius': 10 / 2.0 - bit / 2.0 + 0.25 }) rc.append({ 'type': 'circle', 'depth': gg.inch(0.75),
# spindle plate spindle_plate = { "width": 100, "height": 120, } # initialize spindle place list sp = [] # vertical line sp.extend( create_elements(type='even_spaced', start=1, nr=6, x_start=spindle_plate['width'] + bit_size / 2.0, y_start=0, x_end=spindle_plate['width'] + bit_size / 2.0, y_end=(spindle_plate['height'] + bit_size / 2.0))) # horizontal line sp.extend( create_elements(type='even_spaced', start=1, nr=6, x_start=0, y_start=(spindle_plate['height'] + bit_size / 2.0), x_end=spindle_plate['width'] + bit_size / 2.0, y_end=(spindle_plate['height'] + bit_size / 2.0))) # mounting holes
from parts import sbr16uu_horz, sbr_rail, vert_bearing, shaft_support # --- settings --- bit_5 = 5 bit_1_4 = gg.inch(0.25) width = 100 - vert_bearing['width'] + shaft_support[ "width"] # distance between z rods + width of support height = 230 # same as current print(width, height) # --- outline --- # outer outer = create_elements(type='hole_sets', spacing_x=width + bit_1_4, spacing_y=height + bit_1_4) outer = [outer[0][0], outer[2][0], outer[3][0], outer[1][0], outer[0][0]] rc = [] # outline rc.append({ 'type': 'line', 'points': outer[0:5], 'depth': 12, }) # preview frame = gg.preview(rc, bit_1_4)
# calculate overlap and offset overlap = (nema17['outer'] / 2) - hole_to_plate offset_y = backing - overlap offset_x = 12 # --- drill section --- # initialize request rc = [] holes = [] mounting_holes = create_elements( type='hole_sets', spacing_x=nema17['hole_spacing'], spacing_y=nema17['hole_spacing'], offset_x=nema17['offset'] + offset_x, offset_y=nema17['offset'] + offset_y, ) holes.extend(mounting_holes) holes.extend([ [[offset_x / 2, backing / 2]], [[offset_x * 1.5 + nema17['outer'], backing / 2]], ]) holes = gg.order_closest_point(holes) holes = [e[0] for e in holes] mounting_holes = gg.order_closest_point(mounting_holes) mounting_holes = [e[0] for e in mounting_holes] rc.append({