def projection(): d = (height / 2.) - magic_1 panel = spu.forward(d)(plate.projection(size=(width, height), radius=10, center=True)) mounting_holes = place_at_centres([mounting_hole_centres, 0], drilled_hole.projection(8)) rear_light_holes = spu.forward(light_y_offset)([ place_at_centres([x, 0], lights.small.holes()) for x in light_centres ]) return panel - mounting_holes - rear_light_holes
def volume(): base = spu.up(base_height / 2.)( sp.cube([width, base_length, base_height], center=True) ) mounting_holes = spu.down(1)( place_at_centres( [0, mounting_hole_centres], sp.cylinder(d=mounting_hole_diameter, h=base_height + 2) ) ) base -= mounting_holes bearing = spu.up(shaft_height)( sp.rotate([0, 90, 0])( sp.cylinder(d=60, h=width, center=True) - sp.cylinder(d=shaft_diameter, h=width + 1, center=True) ) ) return sp.union()( base, bearing, )
def assembly(): small_lights = spu.forward(small_light_y_offset)( place_at_centres([small_light_centres, 0], lights.small.volume()) ) large_lights = spu.forward(large_light_y_offset)( place_at_centres([large_light_centres, 0], lights.large.assembly()) ) return sp.union()( sp.color('red')(bumper.volume()), spu.up(bumper.thickness)( sp.color('green')(small_lights), sp.color('blue')(large_lights), ), )
def assembly(): rear_lights = spu.forward(light_y_offset)([ place_at_centres([x, 0], lights.small.volume()) for x in light_centres ]) return sp.union()( sp.color('red')(bumper.volume()), spu.up(bumper.thickness)(sp.color('green')(rear_lights), ), )
def volume(): body = spu.up(2.)(sp.cylinder(d=diameter, h=thickness)) mount = spu.up(4.)(spu.back(diameter / 2.)(sp.rotate( (-60., 0., 0.))(sp.rotate((0., 90., 0.))(sp.hull()(place_at_centres( (20., 0.), sp.cylinder(d=mount_thickness, h=mount_width, center=True) )) - spu.right(10.)(sp.cylinder( d=mount_diameter, h=mount_width + 1., center=True)))))) return body + mount
def projection(): d = (height / 2.) - below_frame panel = spu.forward(d)( plate.projection(size=(width, height), radius=10, center=True) ) mounting_holes = place_at_centres( [mounting_hole_centres, 0], drilled_hole.projection(8) ) small_light_holes = spu.forward(small_light_y_offset)( place_at_centres([small_light_centres, 0], lights.small.holes()) ) large_light_holes = spu.forward(large_light_y_offset)( place_at_centres([large_light_centres, 0], lights.large.holes()) ) return panel - mounting_holes - small_light_holes - large_light_holes
def projection(): d = motor.body_diameter + 10. outer = sp.hull()( sp.square((plate_width, d), center=True), spu.back(lower_extent - 5.)(sp.square((plate_width, 10.), center=True)), ) mounting_holes = spu.back(mount_holes_offset)(place_at_centres( (mount_holes_distance, 0.), mounting_slot())) return outer - motor.mountable_face() - mounting_holes
def projection(): panel = sp.square(tray_dimensions, center=True) frame_mounting_holes = place_at_centres( mounting_hole_centres, sp.circle(d=mounting_hole_diameter, segments=32)) return panel - frame_mounting_holes - placements.vesc( vesc.holes()) - placements.lighting_control_board( lighting_control_board.holes()) - placements.relay_board( relay_board.holes()) - placements.bec_module( bec_module.holes()) - placements.logic_board( logic_board.holes()) - placements.vesc_fan( shroud.mounting_holes(32))
def projection(): from . import arm_mount magic_1 = (arm_mount.face_diameter / 2.) bar = sp.translate( (0., -magic_1, 0.))(plate.projection(size=(width, length + magic_1))) mounting_holes = place_mounting_holes( drilled_hole.projection(mounting_hole_diameter)) tie_rod_holes = spu.back(tie_rod_hole_offset)(place_at_centres( (tie_rod_hole_centres, 0.), drilled_hole.projection(tie_rod_hole_diameter))) return bar - mounting_holes - tie_rod_holes
def mountable_face(): outer = sp.circle(d=body_diameter) shaft_cutout = sp.circle(d=shaft_surround_diam) mounting_holes = place_at_centres([mounting_hole_centres, 0], sp.circle(d=mounting_hole_diameter)) vent_holes = place_n_at_x_around(8, vent_holes_centres / 2., sp.circle(d=vent_holes_diameter)) return sp.union()( shaft_cutout, mounting_holes, vent_holes, )
def volume(): mounting_holes = spu.down(1)(place_at_centres([mounting_hole_centres, 0], sp.cylinder( d=mounting_hole_diameter, h=body_length + 2))) body = sp.color('orange')(sp.rotate([0, 180, 0])( sp.cylinder(d=body_diameter, h=body_length) - mounting_holes, )) shaft = sp.color('black')(sp.cylinder(d=shaft_diameter, h=shaft_length), ) sprocket = sp.color('cyan')(spu.up(sprocket_pos)(sp.cylinder( d=sprocket_diameter, h=5, center=True), )) return sp.union()( body, shaft, sprocket, )
def outer_projection(mount_hole_diameter, segments=32): p = sp.hull()(place_at_centres([d - (2. * corner_radius) for d in size], sp.circle(r=corner_radius, segments=32))) return p - place_mounting_holes( sp.circle(d=mount_hole_diameter, segments=segments))
def mounting_holes(): return place_at_centres((51., 51.), sp.circle(d=4.))
def holes(): # TODO: check dimensions return place_at_centres([20, 0], drilled_hole.projection(3))
def place_mounting_holes(obj): return place_at_centres((mounting_hole_centres, 0), obj)
def place_mounting_holes(obj): return place_at_centres( [d - (mounting_hole_corner_offset * 2.) for d in size], obj)
def mounting_holes(s): return spu.forward(length / 2.)(place_at_centres( (fan.size[0] + 6., length - 10.), sp.circle(d=3.1, segments=s)))
def holes(): return place_at_centres( mounting_hole_centres, sp.circle(d=mounting_hole_diameter, segments=16) )
def mounting_slot(): return sp.hull()(place_at_centres((mount_slots_size[0] / 2., 0.), sp.circle(d=mount_slots_size[1])))