'Movement speed in inches/sec. Careful! A helical plunge will move at ramp-speed, but large radii with move at this speed.' ) args = parser.parse_args() endmill_bit = RouterBit(args.bit_diameter, clearout_depth_inches=args.bit_clearout_depth) hole_path = toolpaths.HolePath(bit=endmill_bit, diameter=args.hole_diameter, depth=args.hole_depth, direction=c.DIRECTION_CONVENTIONAL) multiple_holes_path = toolpaths.MultipleHolesPath(hole_path) x_offsets = center_equally_spaced_points_in_range(0, args.x_length, args.x_spacing, args.x_min_edge) y_offsets = center_equally_spaced_points_in_range(0, args.y_length, args.y_spacing, args.y_min_edge) print('X locations: {}'.format(x_offsets)) print('Y locations: {}'.format(y_offsets)) for x_idx, offset_x in enumerate(x_offsets): direction = 1 if x_idx % 2 == 0 else -1 for offset_y in y_offsets[::direction]: multiple_holes_path.add_location(offset_x=offset_x, offset_y=offset_y) shop_bot_file = ShopBotFile('custom_size_hole.sbp') shop_bot_file.set_ramps(small_circle_diameter=0.2, z_move_ramp_speed=args.ramp_speed,
def test_equally_spaced_points_backwards(): assert np.allclose( helpers.center_equally_spaced_points_in_range(15, 5, 3, 1.0), [13., 10., 7.])
def test_equally_spaced_points_negative(): assert np.allclose( helpers.center_equally_spaced_points_in_range(-15, -5, 3, 1.0), [-13., -10., -7.])
def test_equally_spaced_points_multi_edge(): assert np.allclose( helpers.center_equally_spaced_points_in_range(0, 10, 2, 3.5), [4.0, 6.0])
def test_equally_spaced_points_half_edge(): assert np.allclose( helpers.center_equally_spaced_points_in_range(0, 10, 2, 0.5), [1.0, 3.0, 5.0, 7.0, 9.0])
def test_equally_spaced_points_non_zero_start(): assert np.allclose(helpers.center_equally_spaced_points_in_range(2, 10, 2), [2.0, 4.0, 6.0, 8.0, 10.0])
def test_equally_spaced_points_no_edge(): assert np.allclose(helpers.center_equally_spaced_points_in_range(0, 10, 2), [0.0, 2.0, 4.0, 6.0, 8.0, 10.0])
if __name__ == '__main__': #make_dovetail_domino() dovetail_bit = RouterBit(0.5) endmill_bit = RouterBit(0.5, clearout_depth_inches=2.01) move_to_path = toolpaths.MoveToPath([12.0, 2.0, 0.0, math.pi]) shift_2d = toolpaths.Shift2D(1.0, 1.0) move_to_path.add_transform(shift_2d) hole_path = toolpaths.HolePath(bit=endmill_bit, diameter=0.75, depth=1.55, direction=c.DIRECTION_CONVENTIONAL) multiple_holes_path = toolpaths.MultipleHolesPath(hole_path) x_offsets = center_equally_spaced_points_in_range(0, 42, 2.5, 2.0) y_offsets = [0.0] #center_equally_spaced_points_in_range(0, 42, 2.5, 1.0) for x_idx, offset_x in enumerate(x_offsets): direction = 1 if x_idx % 2 == 0 else -1 for offset_y in y_offsets[::direction]: #y_offsets[::direction]: multiple_holes_path.add_location(offset_x=offset_x, offset_y=offset_y) shop_bot_file = ShopBotFile('custom_size_hole.sbp') shop_bot_file.set_ramps(small_circle_diameter=0.2, xy_move_ramp_speed=0.8) shop_bot_file.add_points(multiple_holes_path.get_points()) shop_bot_file.close() points = np.array(multiple_holes_path.get_points())