def plank_zx_middle(c): """ Create the FreeCAD Part Object plank_zx_middle """ #plank_z_side_length = c['box_height'] - 2*c['h_plank_width'] - c['fitting_height'] + 2*c['crenel_depth'] plank_z_side_length = c['plank_z_length'] plank_zx_middle_outline = [] plank_zx_middle_outline.extend( cnc25d_api.outline_shift_xy(jonction_plank_zx_with_wall_diagonal(c), 0 * plank_z_side_length, 1, 0 * c['v_plank_width'], 1)) plank_zx_middle_outline.extend( cnc25d_api.outline_shift_xy(jonction_plank_zx_with_wall_diagonal(c), 1 * plank_z_side_length, -1, 0 * c['v_plank_width'], 1)) plank_zx_middle_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_zx_with_xz(c), 1 * plank_z_side_length, -1)) plank_zx_middle_outline.extend( cnc25d_api.outline_shift_xy(jonction_plank_zx_with_wall_diagonal(c), 1 * plank_z_side_length, -1, 1 * c['v_plank_width'], -1)) plank_zx_middle_outline.extend( cnc25d_api.outline_shift_xy(jonction_plank_zx_with_wall_diagonal(c), 0 * plank_z_side_length, 1, 1 * c['v_plank_width'], -1)) plank_zx_middle_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_zx_with_xz(c), 0 * plank_z_side_length, 1)) plank_zx_middle_A = cnc25d_api.outline_close(plank_zx_middle_outline) r_fig = [plank_zx_middle_A] return (r_fig)
def plank_yz_bottom(c): """ Create the FreeCAD Part Object plank_yz_bottom """ # plank_yz_bottom_outline plank_yz_bottom_outline = [] plank_yz_bottom_outline.append([0*c['box_depth']+1*c['plank_height'], 0*(c['h_plank_width']+c['fitting_height']), 0*c['router_bit_radius']]) #0 plank_yz_bottom_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_xz_fitting(c), 0*c['box_depth'], 1)) #1-2 plank_yz_bottom_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_xz_fitting(c), 1*c['box_depth'],-1)) plank_yz_bottom_outline.append([1*c['box_depth']-1*c['plank_height'], 0*(c['h_plank_width']+c['fitting_height']), 0*c['router_bit_radius']]) plank_yz_bottom_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_bot_yz_with_xz(c), 1*c['box_depth'], -1)) plank_yz_bottom_outline.append([1*c['box_depth']-1*c['plank_height'], 1*(c['h_plank_width']+c['fitting_height']), 0*c['router_bit_radius']]) plank_yz_bottom_outline.extend(cnc25d_api.outline_shift_xy(jonction_plank_xz_with_zx(c), 1*c['box_depth']-1*c['plank_height'], -1, 1*(c['h_plank_width']+c['fitting_height']), -1)) plank_yz_bottom_outline.extend(cnc25d_api.outline_shift_xy(jonction_plank_xz_with_wall_diagonal(c), 1*c['box_depth']-1*c['plank_height'], -1, 1*(c['h_plank_width']+c['fitting_height']), -1)) plank_yz_bottom_outline.extend(cnc25d_api.outline_shift_xy(jonction_plank_xz_with_wall_diagonal(c), 0*c['box_depth']+1*c['plank_height'], 1, 1*(c['h_plank_width']+c['fitting_height']), -1)) plank_yz_bottom_outline.extend(cnc25d_api.outline_shift_xy(jonction_plank_xz_with_zx(c), 0*c['box_depth']+1*c['plank_height'], 1, 1*(c['h_plank_width']+c['fitting_height']), -1)) plank_yz_bottom_outline.append([0*c['box_depth']+1*c['plank_height'], 1*(c['h_plank_width']+c['fitting_height']), 0*c['router_bit_radius']]) plank_yz_bottom_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_bot_yz_with_xz(c), 0*c['box_depth'], 1)) plank_yz_bottom_A = cnc25d_api.outline_close(plank_yz_bottom_outline) r_fig = [plank_yz_bottom_A] r_fig.extend(plank_yz_bottom_hole(c)) return(r_fig)
def plank_xz_bottom(c): """ Create the FreeCAD Part Object plank_xz_bottom """ # plank_xz_bottom_outline plank_xz_bottom_outline = [] plank_xz_bottom_outline.append([0*c['box_width'], 0*(c['h_plank_width']+c['fitting_height']), 0*c['router_bit_radius']]) #0 for i in range(c['module_width']): plank_xz_bottom_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_xz_fitting(c), i*c['box_width'], 1)) #1-2 plank_xz_bottom_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_xz_fitting(c), (i+1)*c['box_width'],-1)) plank_xz_bottom_outline.append([c['module_width']*c['box_width'], 0*(c['h_plank_width']+c['fitting_height']), 0*c['router_bit_radius']]) plank_xz_bottom_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_bot_xz_with_yz(c), c['module_width']*c['box_width'], -1)) plank_xz_bottom_outline.append([c['module_width']*c['box_width'], 1*(c['h_plank_width']+c['fitting_height']), 0*c['router_bit_radius']]) plank_xz_bottom_outline.extend(cnc25d_api.outline_shift_xy(jonction_plank_xz_with_zx(c), c['module_width']*c['box_width'], -1, 1*(c['h_plank_width']+c['fitting_height']), -1)) plank_xz_bottom_outline.extend(cnc25d_api.outline_shift_xy(jonction_plank_xz_with_wall_diagonal(c), c['module_width']*c['box_width'], -1, 1*(c['h_plank_width']+c['fitting_height']), -1)) for i in range(c['module_width']-1): plank_xz_bottom_outline.extend(cnc25d_api.outline_shift_xy(jonction_plank_xz_with_wall_diagonal(c), (c['module_width']-i-1)*c['box_width']-1.0/2*c['v_plank_width'], 1, 1*(c['h_plank_width']+c['fitting_height']), -1)) plank_xz_bottom_outline.extend(cnc25d_api.outline_shift_xy(jonction_plank_xz_with_middle_zx(c), (c['module_width']-i-1)*c['box_width'], 1, 1*(c['h_plank_width']+c['fitting_height']), -1)) plank_xz_bottom_outline.extend(cnc25d_api.outline_shift_xy(jonction_plank_xz_with_wall_diagonal(c), (c['module_width']-i-1)*c['box_width']+1.0/2*c['v_plank_width'], -1, 1*(c['h_plank_width']+c['fitting_height']), -1)) plank_xz_bottom_outline.extend(cnc25d_api.outline_shift_xy(jonction_plank_xz_with_wall_diagonal(c), 0*c['box_width'], 1, 1*(c['h_plank_width']+c['fitting_height']), -1)) plank_xz_bottom_outline.extend(cnc25d_api.outline_shift_xy(jonction_plank_xz_with_zx(c), 0*c['box_width'], 1, 1*(c['h_plank_width']+c['fitting_height']), -1)) plank_xz_bottom_outline.append([0*c['box_width'], 1*(c['h_plank_width']+c['fitting_height']), 0*c['router_bit_radius']]) plank_xz_bottom_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_bot_xz_with_yz(c), 0*c['box_width'], 1)) plank_xz_bottom_A = cnc25d_api.outline_close(plank_xz_bottom_outline) r_fig = [plank_xz_bottom_A] r_fig.extend(plank_xz_bottom_hole(c)) return(r_fig)
def plank_xz_yz_hole(c, nai_box_size, nai_module_width): hdx = (c['d_plank_width']*math.sqrt(2)-(1+1.5)*c['tobo_diag_depth']) hdy = c['d_plank_height'] hpx = c['tobo_diagonal_size'] + c['tobo_diag_depth'] + 0*c['plank_height'] #hpy = ai_diagonal_lining_height act = (1+math.sqrt(2))*c['router_bit_radius'] plank_xz_hole_outline = [ # the y position is not set yet for an easier re-use for other planks [hpx+0*hdx-1*c['cutting_extra'], 0*hdy-act-1*c['cutting_extra'], 1*c['router_bit_radius']], [hpx+0*hdx+act-1*c['cutting_extra'], 0*hdy-1*c['cutting_extra'], 0*c['router_bit_radius']], [hpx+1*hdx-act+1*c['cutting_extra'], 0*hdy-1*c['cutting_extra'], 0*c['router_bit_radius']], [hpx+1*hdx+1*c['cutting_extra'], 0*hdy-act-1*c['cutting_extra'], 1*c['router_bit_radius']], [hpx+1*hdx+1*c['cutting_extra'], 1*hdy+act+1*c['cutting_extra'], 1*c['router_bit_radius']], [hpx+1*hdx-act+1*c['cutting_extra'], 1*hdy+1*c['cutting_extra'], 0*c['router_bit_radius']], [hpx+0*hdx+act-1*c['cutting_extra'], 1*hdy+1*c['cutting_extra'], 0*c['router_bit_radius']], [hpx+0*hdx-1*c['cutting_extra'], 1*hdy+act+1*c['cutting_extra'], 1*c['router_bit_radius']]] plank_xz_hole_A = cnc25d_api.outline_close(plank_xz_hole_outline) ## array of holes r_plank_xz_hole_fig = [] ## place the holes r_plank_xz_hole_fig.append(cnc25d_api.outline_shift_x(plank_xz_hole_A, 0*nai_box_size+c['plank_height'], 1)) for i in range(nai_module_width-1): r_plank_xz_hole_fig.append(cnc25d_api.outline_shift_x(plank_xz_hole_A, (i+1)*nai_box_size-1.0/2*c['plank_height']-hdx-2*hpx, 1)) r_plank_xz_hole_fig.append(cnc25d_api.outline_shift_x(plank_xz_hole_A, (i+1)*nai_box_size+1.0/2*c['plank_height'], 1)) r_plank_xz_hole_fig.append(cnc25d_api.outline_shift_x(plank_xz_hole_A, nai_module_width*nai_box_size-c['plank_height']-hdx-2*hpx, 1)) return(r_plank_xz_hole_fig)
def plank_tobo_diagonal(c): """ Create the FreeCAD Part Object plank_tobo_diagonal """ #c['plank_tobo_diagonal_length'] = c['tobo_diagonal_size']*math.sqrt(2)+2*c['d_plank_width']+0*c['tobo_diag_depth']*math.sqrt(2)/2 plank_tobo_diagonal_outline = [] plank_tobo_diagonal_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_tobo_diagonal(c), 1*c['plank_tobo_diagonal_length'], -1)) plank_tobo_diagonal_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_tobo_diagonal(c), 0*c['plank_tobo_diagonal_length'], 1)) plank_tobo_diagonal_A = cnc25d_api.outline_close(plank_tobo_diagonal_outline) r_fig = [plank_tobo_diagonal_A] return(r_fig)
def plank_xz_top(c): """ Create the FreeCAD Part Object plank_xz_top """ # plank_xz_top_outline plank_xz_top_outline = [] plank_xz_top_outline.append([0*c['box_width'], 0*c['h_plank_width'], 0*c['router_bit_radius']]) #0 plank_xz_top_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_xz_with_zx(c), 0*c['box_width'], 1)) #1-4 plank_xz_top_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_xz_with_wall_diagonal(c), 0*c['box_width'], 1)) #5-8 for i in range(c['module_width']-1): plank_xz_top_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_xz_with_wall_diagonal(c), (i+1)*c['box_width']+1.0/2*c['v_plank_width'], -1)) plank_xz_top_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_xz_with_middle_zx(c), (i+1)*c['box_width'], 1)) plank_xz_top_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_xz_with_wall_diagonal(c), (i+1)*c['box_width']-1.0/2*c['v_plank_width'], 1)) plank_xz_top_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_xz_with_wall_diagonal(c), c['module_width']*c['box_width'], -1)) #9-12 plank_xz_top_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_xz_with_zx(c), c['module_width']*c['box_width'], -1)) #13-16 plank_xz_top_outline.append([c['module_width']*c['box_width'], 0*c['plank_height'], 0*c['router_bit_radius']]) #17 plank_xz_top_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_top_xz_with_yz(c), c['module_width']*c['box_width'], -1)) #18-21 plank_xz_top_outline.append([c['module_width']*c['box_width'], 1*c['h_plank_width'], 0*c['router_bit_radius']]) #22 for i in range(c['module_width']): plank_xz_top_outline.extend(cnc25d_api.outline_shift_xy(jonction_plank_xz_fitting(c)[::-1], (c['module_width']-i)*c['box_width'], -1, c['h_plank_width'], 1)) #23-24 plank_xz_top_outline.extend(cnc25d_api.outline_shift_xy(jonction_plank_xz_fitting(c)[::-1], (c['module_width']-1-i)*c['box_width'], 1, c['h_plank_width'], 1)) #25-26 plank_xz_top_outline.append([0*c['box_width'], 1*c['h_plank_width'], 0*c['router_bit_radius']]) #27 plank_xz_top_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_top_xz_with_yz(c), 0*c['box_width'], 1)) #28-31 plank_xz_top_A = cnc25d_api.outline_close(plank_xz_top_outline) # final build of the plank plank_xz_top r_fig = [plank_xz_top_A] r_fig.extend(plank_xz_top_hole(c)) return(r_fig)
def plank_wall_diagonal(c): """ Create the FreeCAD Part Object plank_wall_diagonal """ #c['plank_wall_diagonal_length'] = (c['wall_diagonal_size']+2*c['crenel_depth'])*math.sqrt(2)+2*(c['d_plank_width']-c['crenel_depth']*math.sqrt(2)/2) #print("dbg825: c['plank_wall_diagonal_length']:", c['plank_wall_diagonal_length']) plank_wall_diagonal_outline = [] plank_wall_diagonal_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_wall_diagonal(c), 1*c['plank_wall_diagonal_length'], -1)) plank_wall_diagonal_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_wall_diagonal(c), 0*c['plank_wall_diagonal_length'], 1)) plank_wall_diagonal_A = cnc25d_api.outline_close(plank_wall_diagonal_outline) r_fig = [plank_wall_diagonal_A] return(r_fig)
def plank_z_side(c): """ Create the FreeCAD Part Object plank_z_side """ # plank_z_side_outline #plank_z_side_length = c['box_height'] - 2*c['h_plank_width'] - c['fitting_height'] + 2*c['crenel_depth'] plank_z_side_length = c['plank_z_length'] plank_z_side_outline = [] plank_z_side_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_z_side_with_xz(c), 0*plank_z_side_length, 1)) plank_z_side_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_z_side_with_xz(c), 1*plank_z_side_length,-1)) plank_z_side_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_z_with_wall_diagonal(c), 1*plank_z_side_length,-1)) plank_z_side_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_z_with_wall_diagonal(c), 0*plank_z_side_length, 1)) plank_z_side_A = cnc25d_api.outline_close(plank_z_side_outline) r_fig = [plank_z_side_A] return(r_fig)
def plank_tobo_diagonal(c): """ Create the FreeCAD Part Object plank_tobo_diagonal """ #c['plank_tobo_diagonal_length'] = c['tobo_diagonal_size']*math.sqrt(2)+2*c['d_plank_width']+0*c['tobo_diag_depth']*math.sqrt(2)/2 plank_tobo_diagonal_outline = [] plank_tobo_diagonal_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_tobo_diagonal(c), 1 * c['plank_tobo_diagonal_length'], -1)) plank_tobo_diagonal_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_tobo_diagonal(c), 0 * c['plank_tobo_diagonal_length'], 1)) plank_tobo_diagonal_A = cnc25d_api.outline_close( plank_tobo_diagonal_outline) r_fig = [plank_tobo_diagonal_A] return (r_fig)
def plank_wall_diagonal(c): """ Create the FreeCAD Part Object plank_wall_diagonal """ #c['plank_wall_diagonal_length'] = (c['wall_diagonal_size']+2*c['crenel_depth'])*math.sqrt(2)+2*(c['d_plank_width']-c['crenel_depth']*math.sqrt(2)/2) #print("dbg825: c['plank_wall_diagonal_length']:", c['plank_wall_diagonal_length']) plank_wall_diagonal_outline = [] plank_wall_diagonal_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_wall_diagonal(c), 1 * c['plank_wall_diagonal_length'], -1)) plank_wall_diagonal_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_wall_diagonal(c), 0 * c['plank_wall_diagonal_length'], 1)) plank_wall_diagonal_A = cnc25d_api.outline_close( plank_wall_diagonal_outline) r_fig = [plank_wall_diagonal_A] return (r_fig)
def plank_yz_top(c): """ Create the FreeCAD Part Object plank_yz_top """ # plank_yz_top_outline plank_yz_top_outline = [] plank_yz_top_outline.append([ 0 * c['box_depth'] + 1 * c['plank_height'], 0 * c['h_plank_width'], 0 * c['router_bit_radius'] ]) #0 plank_yz_top_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_xz_with_zx(c), 0 * c['box_depth'] + 1 * c['plank_height'], 1)) #1-4 plank_yz_top_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_xz_with_wall_diagonal(c), 0 * c['box_depth'] + 1 * c['plank_height'], 1)) #5-8 plank_yz_top_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_xz_with_wall_diagonal(c), 1 * c['box_depth'] - 1 * c['plank_height'], -1)) #9-12 plank_yz_top_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_xz_with_zx(c), 1 * c['box_depth'] - 1 * c['plank_height'], -1)) #13-16 plank_yz_top_outline.append([ 1 * c['box_depth'] - 1 * c['plank_height'], 0 * c['plank_height'], 0 * c['router_bit_radius'] ]) #17 plank_yz_top_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_top_yz_with_xz(c), 1 * c['box_depth'], -1)) #18-21 plank_yz_top_outline.append([ 1 * c['box_depth'] - 1 * c['plank_height'], 1 * c['h_plank_width'], 0 * c['router_bit_radius'] ]) #22 plank_yz_top_outline.extend( cnc25d_api.outline_shift_xy( jonction_plank_xz_fitting(c)[::-1], 1 * c['box_depth'], -1, c['h_plank_width'], 1)) #23-24 plank_yz_top_outline.extend( cnc25d_api.outline_shift_xy( jonction_plank_xz_fitting(c)[::-1], 0 * c['box_depth'], 1, c['h_plank_width'], 1)) #25-26 plank_yz_top_outline.append([ 0 * c['box_depth'] + 1 * c['plank_height'], 1 * c['h_plank_width'], 0 * c['router_bit_radius'] ]) #27 plank_yz_top_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_top_yz_with_xz(c), 0 * c['box_depth'], 1)) #28-31 plank_yz_top_A = cnc25d_api.outline_close(plank_yz_top_outline) r_fig = [plank_yz_top_A] r_fig.extend(plank_yz_top_hole(c)) return (r_fig)
def plank_yz_top(c): """ Create the FreeCAD Part Object plank_yz_top """ # plank_yz_top_outline plank_yz_top_outline = [] plank_yz_top_outline.append([0*c['box_depth']+1*c['plank_height'], 0*c['h_plank_width'], 0*c['router_bit_radius']]) #0 plank_yz_top_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_xz_with_zx(c), 0*c['box_depth']+1*c['plank_height'], 1)) #1-4 plank_yz_top_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_xz_with_wall_diagonal(c), 0*c['box_depth']+1*c['plank_height'], 1)) #5-8 plank_yz_top_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_xz_with_wall_diagonal(c), 1*c['box_depth']-1*c['plank_height'], -1)) #9-12 plank_yz_top_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_xz_with_zx(c), 1*c['box_depth']-1*c['plank_height'], -1)) #13-16 plank_yz_top_outline.append([1*c['box_depth']-1*c['plank_height'], 0*c['plank_height'], 0*c['router_bit_radius']]) #17 plank_yz_top_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_top_yz_with_xz(c), 1*c['box_depth'], -1)) #18-21 plank_yz_top_outline.append([1*c['box_depth']-1*c['plank_height'], 1*c['h_plank_width'], 0*c['router_bit_radius']]) #22 plank_yz_top_outline.extend(cnc25d_api.outline_shift_xy(jonction_plank_xz_fitting(c)[::-1], 1*c['box_depth'], -1, c['h_plank_width'], 1)) #23-24 plank_yz_top_outline.extend(cnc25d_api.outline_shift_xy(jonction_plank_xz_fitting(c)[::-1], 0*c['box_depth'], 1, c['h_plank_width'], 1)) #25-26 plank_yz_top_outline.append([0*c['box_depth']+1*c['plank_height'], 1*c['h_plank_width'], 0*c['router_bit_radius']]) #27 plank_yz_top_outline.extend(cnc25d_api.outline_shift_x(jonction_plank_top_yz_with_xz(c), 0*c['box_depth'], 1)) #28-31 plank_yz_top_A = cnc25d_api.outline_close(plank_yz_top_outline) r_fig = [plank_yz_top_A] r_fig.extend(plank_yz_top_hole(c)) return(r_fig)
def plank_xz_top(c): """ Create the FreeCAD Part Object plank_xz_top """ # plank_xz_top_outline plank_xz_top_outline = [] plank_xz_top_outline.append([ 0 * c['box_width'], 0 * c['h_plank_width'], 0 * c['router_bit_radius'] ]) #0 plank_xz_top_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_xz_with_zx(c), 0 * c['box_width'], 1)) #1-4 plank_xz_top_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_xz_with_wall_diagonal(c), 0 * c['box_width'], 1)) #5-8 for i in range(c['module_width'] - 1): plank_xz_top_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_xz_with_wall_diagonal(c), (i + 1) * c['box_width'] + 1.0 / 2 * c['v_plank_width'], -1)) plank_xz_top_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_xz_with_middle_zx(c), (i + 1) * c['box_width'], 1)) plank_xz_top_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_xz_with_wall_diagonal(c), (i + 1) * c['box_width'] - 1.0 / 2 * c['v_plank_width'], 1)) plank_xz_top_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_xz_with_wall_diagonal(c), c['module_width'] * c['box_width'], -1)) #9-12 plank_xz_top_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_xz_with_zx(c), c['module_width'] * c['box_width'], -1)) #13-16 plank_xz_top_outline.append([ c['module_width'] * c['box_width'], 0 * c['plank_height'], 0 * c['router_bit_radius'] ]) #17 plank_xz_top_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_top_xz_with_yz(c), c['module_width'] * c['box_width'], -1)) #18-21 plank_xz_top_outline.append([ c['module_width'] * c['box_width'], 1 * c['h_plank_width'], 0 * c['router_bit_radius'] ]) #22 for i in range(c['module_width']): plank_xz_top_outline.extend( cnc25d_api.outline_shift_xy( jonction_plank_xz_fitting(c)[::-1], (c['module_width'] - i) * c['box_width'], -1, c['h_plank_width'], 1)) #23-24 plank_xz_top_outline.extend( cnc25d_api.outline_shift_xy( jonction_plank_xz_fitting(c)[::-1], (c['module_width'] - 1 - i) * c['box_width'], 1, c['h_plank_width'], 1)) #25-26 plank_xz_top_outline.append([ 0 * c['box_width'], 1 * c['h_plank_width'], 0 * c['router_bit_radius'] ]) #27 plank_xz_top_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_top_xz_with_yz(c), 0 * c['box_width'], 1)) #28-31 plank_xz_top_A = cnc25d_api.outline_close(plank_xz_top_outline) # final build of the plank plank_xz_top r_fig = [plank_xz_top_A] r_fig.extend(plank_xz_top_hole(c)) return (r_fig)
def plank_yz_bottom(c): """ Create the FreeCAD Part Object plank_yz_bottom """ # plank_yz_bottom_outline plank_yz_bottom_outline = [] plank_yz_bottom_outline.append([ 0 * c['box_depth'] + 1 * c['plank_height'], 0 * (c['h_plank_width'] + c['fitting_height']), 0 * c['router_bit_radius'] ]) #0 plank_yz_bottom_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_xz_fitting(c), 0 * c['box_depth'], 1)) #1-2 plank_yz_bottom_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_xz_fitting(c), 1 * c['box_depth'], -1)) plank_yz_bottom_outline.append([ 1 * c['box_depth'] - 1 * c['plank_height'], 0 * (c['h_plank_width'] + c['fitting_height']), 0 * c['router_bit_radius'] ]) plank_yz_bottom_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_bot_yz_with_xz(c), 1 * c['box_depth'], -1)) plank_yz_bottom_outline.append([ 1 * c['box_depth'] - 1 * c['plank_height'], 1 * (c['h_plank_width'] + c['fitting_height']), 0 * c['router_bit_radius'] ]) plank_yz_bottom_outline.extend( cnc25d_api.outline_shift_xy( jonction_plank_xz_with_zx(c), 1 * c['box_depth'] - 1 * c['plank_height'], -1, 1 * (c['h_plank_width'] + c['fitting_height']), -1)) plank_yz_bottom_outline.extend( cnc25d_api.outline_shift_xy( jonction_plank_xz_with_wall_diagonal(c), 1 * c['box_depth'] - 1 * c['plank_height'], -1, 1 * (c['h_plank_width'] + c['fitting_height']), -1)) plank_yz_bottom_outline.extend( cnc25d_api.outline_shift_xy( jonction_plank_xz_with_wall_diagonal(c), 0 * c['box_depth'] + 1 * c['plank_height'], 1, 1 * (c['h_plank_width'] + c['fitting_height']), -1)) plank_yz_bottom_outline.extend( cnc25d_api.outline_shift_xy( jonction_plank_xz_with_zx(c), 0 * c['box_depth'] + 1 * c['plank_height'], 1, 1 * (c['h_plank_width'] + c['fitting_height']), -1)) plank_yz_bottom_outline.append([ 0 * c['box_depth'] + 1 * c['plank_height'], 1 * (c['h_plank_width'] + c['fitting_height']), 0 * c['router_bit_radius'] ]) plank_yz_bottom_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_bot_yz_with_xz(c), 0 * c['box_depth'], 1)) plank_yz_bottom_A = cnc25d_api.outline_close(plank_yz_bottom_outline) r_fig = [plank_yz_bottom_A] r_fig.extend(plank_yz_bottom_hole(c)) return (r_fig)
def plank_xz_bottom(c): """ Create the FreeCAD Part Object plank_xz_bottom """ # plank_xz_bottom_outline plank_xz_bottom_outline = [] plank_xz_bottom_outline.append([ 0 * c['box_width'], 0 * (c['h_plank_width'] + c['fitting_height']), 0 * c['router_bit_radius'] ]) #0 for i in range(c['module_width']): plank_xz_bottom_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_xz_fitting(c), i * c['box_width'], 1)) #1-2 plank_xz_bottom_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_xz_fitting(c), (i + 1) * c['box_width'], -1)) plank_xz_bottom_outline.append([ c['module_width'] * c['box_width'], 0 * (c['h_plank_width'] + c['fitting_height']), 0 * c['router_bit_radius'] ]) plank_xz_bottom_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_bot_xz_with_yz(c), c['module_width'] * c['box_width'], -1)) plank_xz_bottom_outline.append([ c['module_width'] * c['box_width'], 1 * (c['h_plank_width'] + c['fitting_height']), 0 * c['router_bit_radius'] ]) plank_xz_bottom_outline.extend( cnc25d_api.outline_shift_xy( jonction_plank_xz_with_zx(c), c['module_width'] * c['box_width'], -1, 1 * (c['h_plank_width'] + c['fitting_height']), -1)) plank_xz_bottom_outline.extend( cnc25d_api.outline_shift_xy( jonction_plank_xz_with_wall_diagonal(c), c['module_width'] * c['box_width'], -1, 1 * (c['h_plank_width'] + c['fitting_height']), -1)) for i in range(c['module_width'] - 1): plank_xz_bottom_outline.extend( cnc25d_api.outline_shift_xy( jonction_plank_xz_with_wall_diagonal(c), (c['module_width'] - i - 1) * c['box_width'] - 1.0 / 2 * c['v_plank_width'], 1, 1 * (c['h_plank_width'] + c['fitting_height']), -1)) plank_xz_bottom_outline.extend( cnc25d_api.outline_shift_xy( jonction_plank_xz_with_middle_zx(c), (c['module_width'] - i - 1) * c['box_width'], 1, 1 * (c['h_plank_width'] + c['fitting_height']), -1)) plank_xz_bottom_outline.extend( cnc25d_api.outline_shift_xy( jonction_plank_xz_with_wall_diagonal(c), (c['module_width'] - i - 1) * c['box_width'] + 1.0 / 2 * c['v_plank_width'], -1, 1 * (c['h_plank_width'] + c['fitting_height']), -1)) plank_xz_bottom_outline.extend( cnc25d_api.outline_shift_xy( jonction_plank_xz_with_wall_diagonal(c), 0 * c['box_width'], 1, 1 * (c['h_plank_width'] + c['fitting_height']), -1)) plank_xz_bottom_outline.extend( cnc25d_api.outline_shift_xy( jonction_plank_xz_with_zx(c), 0 * c['box_width'], 1, 1 * (c['h_plank_width'] + c['fitting_height']), -1)) plank_xz_bottom_outline.append([ 0 * c['box_width'], 1 * (c['h_plank_width'] + c['fitting_height']), 0 * c['router_bit_radius'] ]) plank_xz_bottom_outline.extend( cnc25d_api.outline_shift_x(jonction_plank_bot_xz_with_yz(c), 0 * c['box_width'], 1)) plank_xz_bottom_A = cnc25d_api.outline_close(plank_xz_bottom_outline) r_fig = [plank_xz_bottom_A] r_fig.extend(plank_xz_bottom_hole(c)) return (r_fig)
def motor_lid_2d_construction(c): """ construct the 2D-figures with outlines at the A-format for the motor_lid design """ # holder_A from axle_lid i1_axle_lid = axle_lid.axle_lid() i1_axle_lid.apply_external_constraint(holder_A_al2ml(c)) holder_A_figure = i1_axle_lid.get_A_figure('annulus_holder_fig') holder_A_simple_figure = i1_axle_lid.get_A_figure('annulus_holder_simple_fig') holder_A_with_motor_lid_figure = i1_axle_lid.get_A_figure('annulus_holder_with_axle_B_fig') holder_A_with_leg_figure = i1_axle_lid.get_A_figure('annulus_holder_with_leg_fig') # holder_B from axle_lid i2_axle_lid = axle_lid.axle_lid() i2_axle_lid.apply_external_constraint(holder_B_al2ml(c)) holder_B_figure = i2_axle_lid.get_A_figure('top_lid_fig') holder_B_simple_figure = i2_axle_lid.get_A_figure('top_lid_simple_fig') holder_B_with_motor_lid_figure = i2_axle_lid.get_A_figure('top_lid_with_axle_B_fig') holder_B_with_leg_figure = i2_axle_lid.get_A_figure('top_lid_with_leg_fig') middle_lid_0_figure = i2_axle_lid.get_A_figure('middle_lid_0_fig') middle_lid_1_figure = i2_axle_lid.get_A_figure('middle_lid_1_fig') ## holder_B_hole_figure g1_ix = 0.0 g1_iy = 0.0 holder_B_hole_figure = [] # axle_B_hole_diameter a_AB = c['holder_axis_angle'] + c['axle_B_angle'] a_BC = a_AB + c['axle_C_angle'] bx = g1_ix+c['axle_B_distance']*math.cos(a_AB) by = g1_iy+c['axle_B_distance']*math.sin(a_AB) if(c['axle_B_hole_radius']>0): holder_B_hole_figure.append((bx, by, c['axle_B_hole_radius'])) # fastening_BC_hole_figure fastening_BC_hole_figure = [] if(c['fastening_BC_hole_radius']>0): for s in [-1, 1]: a_bottom = a_AB + math.pi + s * c['fastening_BC_bottom_angle'] fastening_BC_hole_figure.append((bx+c['fastening_BC_bottom_position_radius']*math.cos(a_bottom), by+c['fastening_BC_bottom_position_radius']*math.sin(a_bottom), c['fastening_BC_hole_radius'])) a_top = a_BC + s * c['fastening_BC_top_angle'] fastening_BC_hole_figure.append((bx+c['fastening_BC_top_position_radius']*math.cos(a_top), by+c['fastening_BC_top_position_radius']*math.sin(a_top), c['fastening_BC_hole_radius'])) holder_B_hole_figure.extend(fastening_BC_hole_figure) # motor_screw cx = bx + c['axle_C_distance']*math.cos(a_BC) cy = by + c['axle_C_distance']*math.sin(a_BC) for i in range(len(c['motor_screw_diameter'])): if(c['motor_screw_diameter'][i]>0): for s in [-1, 1]: a_h = a_BC + c['motor_screw_angle'][i] hx = cx + c['motor_screw_y_length'][i] * math.cos(a_h) + c['motor_screw_x_length'][i] * math.cos(a_h+s*math.pi/2) hy = cy + c['motor_screw_y_length'][i] * math.sin(a_h) + c['motor_screw_x_length'][i] * math.sin(a_h+s*math.pi/2) holder_B_hole_figure.append((hx, hy, c['motor_screw_diameter'][i]/2.0)) # holder_B holder_B_figure.extend(holder_B_hole_figure) holder_B_with_motor_lid_figure.extend(holder_B_hole_figure) ### holder_C holder_C_figure = [] if(c['fastening_BC_external_radius']>0): # holder_C_outline_A holder_C_outline_A = [] hca = ((a_AB + math.pi - c['fastening_BC_bottom_angle'], c['fastening_BC_bottom_position_radius']), (a_AB + math.pi + c['fastening_BC_bottom_angle'], c['fastening_BC_bottom_position_radius']), (a_BC - c['fastening_BC_top_angle'], c['fastening_BC_top_position_radius']), (a_BC + c['fastening_BC_top_angle'], c['fastening_BC_top_position_radius'])) for i in range(len(hca)): ea = hca[i][0] ma = hca[i-1][0] + (math.fmod(hca[i][0] - hca[i-1][0] + 4*math.pi, 2*math.pi) - 0*math.pi)/2.0 # we always want the angle positive because we always turn CCW dl = math.sqrt(hca[i][1]**2 + c['fastening_BC_external_radius']**2) da = math.atan(float(c['fastening_BC_external_radius'])/hca[i][1]) sl = hca[i][1] + c['fastening_BC_external_radius'] holder_C_outline_A.append((bx+c['axle_B_central_radius']*math.cos(ma), by+c['axle_B_central_radius']*math.sin(ma), c['smoothing_radius'])) holder_C_outline_A.append((bx+dl*math.cos(ea-da), by+dl*math.sin(ea-da), 0)) holder_C_outline_A.append((bx+sl*math.cos(ea), by+sl*math.sin(ea), bx+dl*math.cos(ea+da), by+dl*math.sin(ea+da), 0)) holder_C_outline_A.append((holder_C_outline_A[0][0], holder_C_outline_A[0][1], 0)) # holder_C_figure holder_C_figure.append(holder_C_outline_A) if(c['axle_B_radius']>0): holder_C_figure.append((bx, by, c['axle_B_radius'])) holder_C_figure.extend(fastening_BC_hole_figure) ### design output # part_figure_list part_figure_list = [] part_figure_list.append(holder_A_figure) part_figure_list.append(middle_lid_0_figure) part_figure_list.append(middle_lid_1_figure) part_figure_list.append(holder_B_figure) part_figure_list.append(holder_C_figure) part_figure_list.append(holder_A_with_motor_lid_figure) # assembly ml_assembly_figure = [] for i in range(len(part_figure_list)): ml_assembly_figure.extend(part_figure_list[i]) # ml_list_of_parts x_space = 3.1*c['holder_radius'] ml_list_of_parts = [] for i in range(len(part_figure_list)): for j in range(len(part_figure_list[i])): ml_list_of_parts.append(cnc25d_api.outline_shift_x(part_figure_list[i][j], i*x_space, 1)) ### r_figures = {} r_height = {} # r_figures['holder_A_fig'] = holder_A_figure r_height['holder_A_fig'] = c['extrusion_height'] # r_figures['middle_lid_0_fig'] = middle_lid_0_figure r_height['middle_lid_0_fig'] = c['extrusion_height'] # r_figures['middle_lid_1_fig'] = middle_lid_1_figure r_height['middle_lid_1_fig'] = c['extrusion_height'] # r_figures['holder_B_fig'] = holder_B_figure r_height['holder_B_fig'] = c['extrusion_height'] # r_figures['holder_C_fig'] = holder_C_figure r_height['holder_C_fig'] = c['extrusion_height'] # r_figures['holder_A_with_motor_lid_fig'] = holder_A_with_motor_lid_figure r_height['holder_A_with_motor_lid_fig'] = c['extrusion_height'] # r_figures['ml_assembly_fig'] = ml_assembly_figure r_height['ml_assembly_fig'] = 1.0 # r_figures['ml_part_list'] = ml_list_of_parts r_height['ml_part_list'] = 1.0 # r_figures['holder_A_simple_fig'] = holder_A_simple_figure r_height['holder_A_simple_fig'] = c['extrusion_height'] # r_figures['holder_B_simple_fig'] = holder_B_simple_figure r_height['holder_B_simple_fig'] = c['extrusion_height'] # r_figures['holder_A_with_leg_fig'] = holder_A_with_leg_figure r_height['holder_A_with_leg_fig'] = c['extrusion_height'] # r_figures['holder_B_with_leg_fig'] = holder_B_with_leg_figure r_height['holder_B_with_leg_fig'] = c['extrusion_height'] ### return((r_figures, r_height))
def plank_xz_yz_hole(c, nai_box_size, nai_module_width): hdx = (c['d_plank_width'] * math.sqrt(2) - (1 + 1.5) * c['tobo_diag_depth']) hdy = c['d_plank_height'] hpx = c['tobo_diagonal_size'] + c['tobo_diag_depth'] + 0 * c['plank_height'] #hpy = ai_diagonal_lining_height act = (1 + math.sqrt(2)) * c['router_bit_radius'] plank_xz_hole_outline = [ # the y position is not set yet for an easier re-use for other planks [ hpx + 0 * hdx - 1 * c['cutting_extra'], 0 * hdy - act - 1 * c['cutting_extra'], 1 * c['router_bit_radius'] ], [ hpx + 0 * hdx + act - 1 * c['cutting_extra'], 0 * hdy - 1 * c['cutting_extra'], 0 * c['router_bit_radius'] ], [ hpx + 1 * hdx - act + 1 * c['cutting_extra'], 0 * hdy - 1 * c['cutting_extra'], 0 * c['router_bit_radius'] ], [ hpx + 1 * hdx + 1 * c['cutting_extra'], 0 * hdy - act - 1 * c['cutting_extra'], 1 * c['router_bit_radius'] ], [ hpx + 1 * hdx + 1 * c['cutting_extra'], 1 * hdy + act + 1 * c['cutting_extra'], 1 * c['router_bit_radius'] ], [ hpx + 1 * hdx - act + 1 * c['cutting_extra'], 1 * hdy + 1 * c['cutting_extra'], 0 * c['router_bit_radius'] ], [ hpx + 0 * hdx + act - 1 * c['cutting_extra'], 1 * hdy + 1 * c['cutting_extra'], 0 * c['router_bit_radius'] ], [ hpx + 0 * hdx - 1 * c['cutting_extra'], 1 * hdy + act + 1 * c['cutting_extra'], 1 * c['router_bit_radius'] ] ] plank_xz_hole_A = cnc25d_api.outline_close(plank_xz_hole_outline) ## array of holes r_plank_xz_hole_fig = [] ## place the holes r_plank_xz_hole_fig.append( cnc25d_api.outline_shift_x(plank_xz_hole_A, 0 * nai_box_size + c['plank_height'], 1)) for i in range(nai_module_width - 1): r_plank_xz_hole_fig.append( cnc25d_api.outline_shift_x( plank_xz_hole_A, (i + 1) * nai_box_size - 1.0 / 2 * c['plank_height'] - hdx - 2 * hpx, 1)) r_plank_xz_hole_fig.append( cnc25d_api.outline_shift_x(plank_xz_hole_A, (i + 1) * nai_box_size + 1.0 / 2 * c['plank_height'], 1)) r_plank_xz_hole_fig.append( cnc25d_api.outline_shift_x( plank_xz_hole_A, nai_module_width * nai_box_size - c['plank_height'] - hdx - 2 * hpx, 1)) return (r_plank_xz_hole_fig)