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 slab_side(c, nai_type): """ Create the FreeCAD Part Object slab_side """ slab_length = c['slab_side_length'] if(nai_type=='left_right'): slab_width = c['slab_side_left_right_width'] elif(nai_type=='rear_single'): slab_width = c['slab_side_rear_single_width'] elif(nai_type=='rear_side'): slab_width = c['slab_side_rear_side_width'] elif(nai_type=='rear_middle'): slab_width = c['slab_side_rear_middle_width'] slab_side_outline = [] slab_side_outline.append([0*slab_length+1*c['cutting_extra'], 0*slab_width+1*c['cutting_extra'], 0]) slab_side_outline.extend(cnc25d_api.outline_shift_xy(jonction_slab_side_with_wall_diagonal_horizontal(c), 0*slab_length, 1, 0*slab_width, 1)) slab_side_outline.extend(cnc25d_api.outline_shift_xy(jonction_slab_side_with_wall_diagonal_horizontal(c), 1*slab_length,-1, 0*slab_width, 1)) slab_side_outline.append([1*slab_length-1*c['cutting_extra'], 0*slab_width+1*c['cutting_extra'], 0]) slab_side_outline.extend(cnc25d_api.outline_shift_xy(jonction_slab_side_with_wall_diagonal_vertical(c), 1*slab_length,-1, 0*slab_width, 1)) slab_side_outline.extend(cnc25d_api.outline_shift_xy(jonction_slab_side_with_wall_diagonal_vertical(c), 1*slab_length,-1, 1*slab_width,-1)) slab_side_outline.append([1*slab_length-1*c['cutting_extra'], 1*slab_width-1*c['cutting_extra'], 0]) slab_side_outline.extend(cnc25d_api.outline_shift_xy(jonction_slab_side_with_wall_diagonal_horizontal(c), 1*slab_length, -1, 1*slab_width,-1)) slab_side_outline.extend(cnc25d_api.outline_shift_xy(jonction_slab_side_with_wall_diagonal_horizontal(c), 0*slab_length, 1, 1*slab_width,-1)) slab_side_outline.append([0*slab_length+1*c['cutting_extra'], 1*slab_width-1*c['cutting_extra'], 0]) slab_side_outline.extend(cnc25d_api.outline_shift_xy(jonction_slab_side_with_wall_diagonal_vertical(c), 0*slab_length, 1, 1*slab_width,-1)) slab_side_outline.extend(cnc25d_api.outline_shift_xy(jonction_slab_side_with_wall_diagonal_vertical(c), 0*slab_length, 1, 0*slab_width, 1)) slab_side_A = cnc25d_api.outline_close(slab_side_outline) r_fig = [slab_side_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 hole_in_plank_bot_xz_for_yz(c, nai_x_offset): l_outline = [ [ nai_x_offset - 1.0 / 2 * c['plank_height'] - 1 * c['cutting_extra'], 2.0 / 3 * (c['h_plank_width'] + c['fitting_height'] - c['crenel_depth']) + 1 * c['cutting_extra'], -1 * c['router_bit_radius'] ], [ nai_x_offset + 1.0 / 2 * c['plank_height'] + 1 * c['cutting_extra'], 2.0 / 3 * (c['h_plank_width'] + c['fitting_height'] - c['crenel_depth']) + 1 * c['cutting_extra'], -1 * c['router_bit_radius'] ], [ nai_x_offset + 1.0 / 2 * c['plank_height'] + 1 * c['cutting_extra'], 1.0 / 3 * (c['h_plank_width'] + c['fitting_height'] - c['crenel_depth']) - 1 * c['cutting_extra'], -1 * c['router_bit_radius'] ], [ nai_x_offset - 1.0 / 2 * c['plank_height'] - 1 * c['cutting_extra'], 1.0 / 3 * (c['h_plank_width'] + c['fitting_height'] - c['crenel_depth']) - 1 * c['cutting_extra'], -1 * c['router_bit_radius'] ] ] #l_outline.append([l_outline[0][0], l_outline[0][1], 0]) # close the outline l_outline_A = cnc25d_api.outline_close(l_outline) r_fig = [l_outline_A] return (r_fig)
def slab_top_bottom(c, nai_type): """ Create the FreeCAD Part Object slab_top_bottom """ if (nai_type == 'single'): slab_length = c['slab_top_bottom_single_length'] elif (nai_type == 'side'): slab_length = c['slab_top_bottom_side_length'] elif (nai_type == 'middle'): slab_length = c['slab_top_bottom_middle_length'] slab_width = c['slab_top_bottom_width'] slab_top_bottom_outline = [] slab_top_bottom_outline.append([ 0 * slab_length + 1 * c['cutting_extra'], 0 * slab_width + 1 * c['cutting_extra'], 0 ]) slab_top_bottom_outline.append([ 1 * slab_length - 1 * c['cutting_extra'], 0 * slab_width + 1 * c['cutting_extra'], 0 ]) slab_top_bottom_outline.append([ 1 * slab_length - 1 * c['cutting_extra'], 1 * slab_width - 1 * c['cutting_extra'], 0 ]) slab_top_bottom_outline.append([ 0 * slab_length + 1 * c['cutting_extra'], 1 * slab_width - 1 * c['cutting_extra'], 0 ]) slab_top_bottom_A = cnc25d_api.outline_close(slab_top_bottom_outline) r_fig = [slab_top_bottom_A] return (r_fig)
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_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 bell_base_main_hole_outline(ai_c): """ generate the A-outline of the main hole of the bell_base part """ ### constant radian_epsilon = math.pi/1000 ### intermediate parameters bell_face_width_10 = ai_c['bell_face_width']/10.0 wall_thickness = max(ai_c['face_thickness'], ai_c['side_thickness']) ect = ai_c['bell_extra_cut_thickness'] ### sub-outline construction sol = [] sol.append((-3*bell_face_width_10, -5*bell_face_width_10+1.5*wall_thickness, ai_c['bell_cnc_router_bit_radius'])) sol.append((-3*bell_face_width_10, -5*bell_face_width_10-ect, -1*ai_c['bell_cnc_router_bit_radius'])) sol.append((-1*bell_face_width_10, -5*bell_face_width_10-ect, -1*ai_c['bell_cnc_router_bit_radius'])) sol.append((-1*bell_face_width_10, -5*bell_face_width_10+wall_thickness, 0)) sol.append((1*bell_face_width_10, -5*bell_face_width_10+wall_thickness, 0)) sol.append((1*bell_face_width_10, -5*bell_face_width_10-ect, -1*ai_c['bell_cnc_router_bit_radius'])) sol.append((3*bell_face_width_10, -5*bell_face_width_10-ect, -1*ai_c['bell_cnc_router_bit_radius'])) sol.append((3*bell_face_width_10, -5*bell_face_width_10+1.5*wall_thickness, ai_c['bell_cnc_router_bit_radius'])) if(ai_c['z_hole_radius']>0): lAB = 2*bell_face_width_10 - wall_thickness lAC = ai_c['z_hole_position_length'] lCD = ai_c['z_hole_external_radius'] aBAC = math.pi/4 lCB = math.sqrt(lAB**2+lAC**2-2*lAB*lAC*math.cos(aBAC)) # law of cosines in the triangle ABC cos_aACB = (lCB**2+lAC**2-lAB**2)/(2*lCB*lAC) if(abs(cos_aACB)>1): print("ERR359: Error, cos_aACB {:0.3f} is out of the range -1..1".format(cos_aACB)) sys.exit(2) aACB = math.acos(cos_aACB) cos_aBCD = lCD/lCB if(abs(cos_aBCD)>1): print("ERR364: Error, cos_aBCD {:0.3f} is out of the range -1..1".format(cos_aBCD)) sys.exit(2) aBCD = math.acos(cos_aBCD) aACD = aACB + aBCD #print("dbg370: aACB {:0.3f} aBCD {:0.3f} aACD {:0.3f}".format(aACB, aBCD, aACD)) lEC = math.sqrt(2)*wall_thickness + lAC Cx = 5*bell_face_width_10 - lEC * math.cos(math.pi/4) # sqrt(2)/2 Cy = -5*bell_face_width_10 + lEC * math.sin(math.pi/4) Fx = Cx - ai_c['z_hole_external_radius']*math.cos(math.pi/4) Fy = Cy + ai_c['z_hole_external_radius']*math.sin(math.pi/4) Dx = Cx + ai_c['z_hole_external_radius']*math.cos(-math.pi/4-aACD) Dy = Cy + ai_c['z_hole_external_radius']*math.sin(-math.pi/4-aACD) Gx = Cx + ai_c['z_hole_external_radius']*math.cos(-math.pi/4+aACD) Gy = Cy + ai_c['z_hole_external_radius']*math.sin(-math.pi/4+aACD) if(aACD>math.pi-radian_epsilon): sol.append((Fx, Fy, ai_c['bell_cnc_router_bit_radius'])) else: sol.append((Dx, Dy, 0)) sol.append((Fx, Fy, Gx, Gy, 0)) #print("dbg351: sol:", sol) ### outline construction r_ol = [] for i in range(4): r_ol.extend(cnc25d_api.outline_rotate(sol, 0.0, 0.0, i*math.pi/2)) r_ol = cnc25d_api.outline_close(r_ol) ### return return(r_ol)
def slab_front(c): """ Create the FreeCAD Part Object slab_front """ slab_front_outline = [] slab_front_outline.append( [0 + 1 * c['cutting_extra'], 0 + 1 * c['cutting_extra'], 0]) slab_front_outline.append([ c['wall_diagonal_size'] + 0 * c['crenel_depth'] + 0 * c['d_plank_width'] * math.sqrt(2) - 1 * c['cutting_extra'], 0 * c['crenel_depth'] + 1 * c['cutting_extra'], -1 * c['router_bit_radius'] ]) slab_front_outline.append([ c['wall_diagonal_size'] + 1 * c['crenel_depth'] + 0 * c['d_plank_width'] * math.sqrt(2) + 0 * c['cutting_extra'], -1 * c['crenel_depth'] + 0 * c['cutting_extra'], 1 * c['router_bit_radius'] ]) slab_front_outline.append([ c['wall_diagonal_size'] + 0 * c['crenel_depth'] + 1 * c['d_plank_width'] * math.sqrt(2) + 0 * c['cutting_extra'], -1 * c['crenel_depth'] + 0 * c['cutting_extra'], 1 * c['router_bit_radius'] ]) slab_front_outline.append([ c['wall_diagonal_size'] + 0 * c['crenel_depth'] + 1 * c['d_plank_width'] * math.sqrt(2) + 0 * c['cutting_extra'], 0 * c['crenel_depth'] + 0 * c['cutting_extra'], 0 * c['router_bit_radius'] ]) slab_front_outline.append([ 0 * c['crenel_depth'] + 0 * c['cutting_extra'], c['wall_diagonal_size'] + 0 * c['crenel_depth'] + 1 * c['d_plank_width'] * math.sqrt(2) + 0 * c['cutting_extra'], 0 * c['router_bit_radius'] ]) slab_front_outline.append([ -1 * c['crenel_depth'] + 0 * c['cutting_extra'], c['wall_diagonal_size'] + 0 * c['crenel_depth'] + 1 * c['d_plank_width'] * math.sqrt(2) + 0 * c['cutting_extra'], 1 * c['router_bit_radius'] ]) slab_front_outline.append([ -1 * c['crenel_depth'] + 0 * c['cutting_extra'], c['wall_diagonal_size'] + 1 * c['crenel_depth'] + 0 * c['d_plank_width'] * math.sqrt(2) + 0 * c['cutting_extra'], 1 * c['router_bit_radius'] ]) slab_front_outline.append([ 0 * c['crenel_depth'] + 1 * c['cutting_extra'], c['wall_diagonal_size'] + 0 * c['crenel_depth'] + 0 * c['d_plank_width'] * math.sqrt(2) - 1 * c['cutting_extra'], -1 * c['router_bit_radius'] ]) slab_front_A = cnc25d_api.outline_close(slab_front_outline) r_fig = [slab_front_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 hole_in_plank_top_xz_for_yz(c, nai_x_offset): l_outline = [ [nai_x_offset-1.0/2*c['plank_height']-1*c['cutting_extra'], c['crenel_depth']+2.0/3*(c['h_plank_width']-c['crenel_depth'])+1*c['cutting_extra'],-1*c['router_bit_radius']], [nai_x_offset+1.0/2*c['plank_height']+1*c['cutting_extra'], c['crenel_depth']+2.0/3*(c['h_plank_width']-c['crenel_depth'])+1*c['cutting_extra'],-1*c['router_bit_radius']], [nai_x_offset+1.0/2*c['plank_height']+1*c['cutting_extra'], c['crenel_depth']+1.0/3*(c['h_plank_width']-c['crenel_depth'])-1*c['cutting_extra'],-1*c['router_bit_radius']], [nai_x_offset-1.0/2*c['plank_height']-1*c['cutting_extra'], c['crenel_depth']+1.0/3*(c['h_plank_width']-c['crenel_depth'])-1*c['cutting_extra'],-1*c['router_bit_radius']]] #l_outline.append([l_outline[0][0], l_outline[0][1], 0]) # close the outline l_outline_A = cnc25d_api.outline_close(l_outline) r_fig = [l_outline_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 cross_cube_face(ai_constraints, ai_left_thickness, ai_right_thickness): """ Generate the whole face figure """ face_ol = [] face_ol.extend(cross_cube_face_bottom_outline(ai_constraints, ai_left_thickness, ai_right_thickness)) face_ol.extend(cross_cube_face_top_outline(ai_constraints, ai_left_thickness, ai_right_thickness)) face_ol = cnc25d_api.outline_close(face_ol) r_face_figure = [] r_face_figure.append(face_ol) r_face_figure.extend(cross_cube_face_holes(ai_constraints, ai_left_thickness, ai_right_thickness)) return r_face_figure
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 cross_cube_face(ai_constraints, ai_left_thickness, ai_right_thickness): """ Generate the whole face figure """ face_ol = [] face_ol.extend(cross_cube_face_bottom_outline(ai_constraints, ai_left_thickness, ai_right_thickness)) face_ol.extend(cross_cube_face_top_outline(ai_constraints, ai_left_thickness, ai_right_thickness)) face_ol = cnc25d_api.outline_close(face_ol) r_face_figure = [] r_face_figure.append(face_ol) r_face_figure.extend(cross_cube_face_holes(ai_constraints, ai_left_thickness, ai_right_thickness)) return(r_face_figure)
def cross_cube_top(ai_constraints): """ Generate the whole top figure """ # alias cc_c = cross_cube_sub_top_check(ai_constraints) cccrbr = cc_c['cross_cube_cnc_router_bit_radius'] ccect = cc_c['cross_cube_extra_cut_thickness'] cw5 = cc_c['cube_width']/5.0 fa1t = cc_c['face_A1_thickness'] fa2t = cc_c['face_A2_thickness'] fb1t = cc_c['face_B1_thickness'] fb2t = cc_c['face_B2_thickness'] # # top_sub_outline def top_sub_outline(ai_previous_face_thickness, ai_current_face_thickness, ai_post_face_thickness): """ Generate a sub-outline of the top_outline """ # pre_ft = ai_previous_face_thickness cur_ft = ai_current_face_thickness post_ft = ai_post_face_thickness # r_top_sub_ol = [] r_top_sub_ol.append((pre_ft+ccect, cur_ft+ccect, 0)) r_top_sub_ol.append((1*cw5, cur_ft+ccect, -1*cccrbr)) r_top_sub_ol.append((1*cw5, 0, 0)) r_top_sub_ol.append((2*cw5, 0, 0)) r_top_sub_ol.append((2*cw5, cur_ft+ccect, -1*cccrbr)) r_top_sub_ol.append((3*cw5, cur_ft+ccect, -1*cccrbr)) r_top_sub_ol.append((3*cw5, 0, 0)) r_top_sub_ol.append((4*cw5, 0, 0)) r_top_sub_ol.append((4*cw5, cur_ft+ccect, -1*cccrbr)) r_top_sub_ol.append((5*cw5-post_ft-ccect, cur_ft+ccect, 0)) # return(r_top_sub_ol) # top_outline top_ol = [] top_ol.extend(cnc25d_api.outline_rotate(top_sub_outline(fb1t, fa1t, fb2t)[:-1], cc_c['cube_width']/2.0, cc_c['cube_width']/2.0, 0*math.pi/2)) top_ol.extend(cnc25d_api.outline_rotate(top_sub_outline(fa1t, fb2t, fa2t)[:-1], cc_c['cube_width']/2.0, cc_c['cube_width']/2.0, 1*math.pi/2)) top_ol.extend(cnc25d_api.outline_rotate(top_sub_outline(fb2t, fa2t, fb1t)[:-1], cc_c['cube_width']/2.0, cc_c['cube_width']/2.0, 2*math.pi/2)) top_ol.extend(cnc25d_api.outline_rotate(top_sub_outline(fa2t, fb1t, fa1t)[:-1], cc_c['cube_width']/2.0, cc_c['cube_width']/2.0, 3*math.pi/2)) top_ol = cnc25d_api.outline_close(top_ol) top_A = [] top_A.append(top_ol) # holes if(cc_c['top_rod_hole_radius']>0): top_A.append((fb1t+cc_c['top_rod_hole_h_position'], fa1t+cc_c['top_rod_hole_h_position'], cc_c['top_rod_hole_radius'])) top_A.append((cc_c['cube_width']-(fb2t+cc_c['top_rod_hole_h_position']), fa1t+cc_c['top_rod_hole_h_position'], cc_c['top_rod_hole_radius'])) top_A.append((cc_c['cube_width']-(fb2t+cc_c['top_rod_hole_h_position']), cc_c['cube_width']-(fa2t+cc_c['top_rod_hole_h_position']), cc_c['top_rod_hole_radius'])) top_A.append((fb1t+cc_c['top_rod_hole_h_position'], cc_c['cube_width']-(fa2t+cc_c['top_rod_hole_h_position']), cc_c['top_rod_hole_radius'])) # top-hollow # [todo] # return return(top_A)
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_hole_cover(c): """ Create the FreeCAD Part Object plank_hole_cover """ hdx = c['plank_hole_cover_length'] hdy = c['plank_hole_cover_width'] hdz = c['plank_hole_cover_height'] plank_hole_cover_outline = [] plank_hole_cover_outline.append([0*hdx, 0*hdy, 0]) plank_hole_cover_outline.append([1*hdx, 0*hdy, 0]) plank_hole_cover_outline.append([1*hdx, 1*hdy, 0]) plank_hole_cover_outline.append([0*hdx, 1*hdy, 0]) #plank_hole_cover_outline.append([plank_hole_cover_outline[0][0], plank_hole_cover_outline[0][1], 0]) # close the outline plank_hole_cover_A = cnc25d_api.outline_close(plank_hole_cover_outline) r_fig = [plank_hole_cover_A] return(r_fig)
def plank_hole_cover(c): """ Create the FreeCAD Part Object plank_hole_cover """ hdx = c['plank_hole_cover_length'] hdy = c['plank_hole_cover_width'] hdz = c['plank_hole_cover_height'] plank_hole_cover_outline = [] plank_hole_cover_outline.append([0 * hdx, 0 * hdy, 0]) plank_hole_cover_outline.append([1 * hdx, 0 * hdy, 0]) plank_hole_cover_outline.append([1 * hdx, 1 * hdy, 0]) plank_hole_cover_outline.append([0 * hdx, 1 * hdy, 0]) #plank_hole_cover_outline.append([plank_hole_cover_outline[0][0], plank_hole_cover_outline[0][1], 0]) # close the outline plank_hole_cover_A = cnc25d_api.outline_close(plank_hole_cover_outline) r_fig = [plank_hole_cover_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 slab_front(c): """ Create the FreeCAD Part Object slab_front """ slab_front_outline = [] slab_front_outline.append([0+1*c['cutting_extra'], 0+1*c['cutting_extra'], 0]) slab_front_outline.append([c['wall_diagonal_size']+0*c['crenel_depth']+0*c['d_plank_width']*math.sqrt(2)-1*c['cutting_extra'], 0*c['crenel_depth']+1*c['cutting_extra'], -1*c['router_bit_radius']]) slab_front_outline.append([c['wall_diagonal_size']+1*c['crenel_depth']+0*c['d_plank_width']*math.sqrt(2)+0*c['cutting_extra'], -1*c['crenel_depth']+0*c['cutting_extra'], 1*c['router_bit_radius']]) slab_front_outline.append([c['wall_diagonal_size']+0*c['crenel_depth']+1*c['d_plank_width']*math.sqrt(2)+0*c['cutting_extra'], -1*c['crenel_depth']+0*c['cutting_extra'], 1*c['router_bit_radius']]) slab_front_outline.append([c['wall_diagonal_size']+0*c['crenel_depth']+1*c['d_plank_width']*math.sqrt(2)+0*c['cutting_extra'], 0*c['crenel_depth']+0*c['cutting_extra'], 0*c['router_bit_radius']]) slab_front_outline.append([ 0*c['crenel_depth']+0*c['cutting_extra'], c['wall_diagonal_size']+0*c['crenel_depth']+1*c['d_plank_width']*math.sqrt(2)+0*c['cutting_extra'], 0*c['router_bit_radius']]) slab_front_outline.append([-1*c['crenel_depth']+0*c['cutting_extra'], c['wall_diagonal_size']+0*c['crenel_depth']+1*c['d_plank_width']*math.sqrt(2)+0*c['cutting_extra'], 1*c['router_bit_radius']]) slab_front_outline.append([-1*c['crenel_depth']+0*c['cutting_extra'], c['wall_diagonal_size']+1*c['crenel_depth']+0*c['d_plank_width']*math.sqrt(2)+0*c['cutting_extra'], 1*c['router_bit_radius']]) slab_front_outline.append([ 0*c['crenel_depth']+1*c['cutting_extra'], c['wall_diagonal_size']+0*c['crenel_depth']+0*c['d_plank_width']*math.sqrt(2)-1*c['cutting_extra'], -1*c['router_bit_radius']]) slab_front_A = cnc25d_api.outline_close(slab_front_outline) r_fig = [slab_front_A] return(r_fig)
def slab_top_bottom(c, nai_type): """ Create the FreeCAD Part Object slab_top_bottom """ if(nai_type=='single'): slab_length = c['slab_top_bottom_single_length'] elif(nai_type=='side'): slab_length = c['slab_top_bottom_side_length'] elif(nai_type=='middle'): slab_length = c['slab_top_bottom_middle_length'] slab_width = c['slab_top_bottom_width'] slab_top_bottom_outline = [] slab_top_bottom_outline.append([0*slab_length+1*c['cutting_extra'], 0*slab_width+1*c['cutting_extra'], 0]) slab_top_bottom_outline.append([1*slab_length-1*c['cutting_extra'], 0*slab_width+1*c['cutting_extra'], 0]) slab_top_bottom_outline.append([1*slab_length-1*c['cutting_extra'], 1*slab_width-1*c['cutting_extra'], 0]) slab_top_bottom_outline.append([0*slab_length+1*c['cutting_extra'], 1*slab_width-1*c['cutting_extra'], 0]) slab_top_bottom_A = cnc25d_api.outline_close(slab_top_bottom_outline) r_fig = [slab_top_bottom_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 gearwheel_2d_construction(c): """ construct the 2D-figures with outlines at the A-format for the gearwheel design """ ### precision radian_epsilon = math.pi/1000 ### axle axle_figure = [] if(c['axle_type']=='circle'): if(not c['crenel_axle_merge']): axle_figure.append([c['g1_ix'], c['g1_iy'], c['axle_radius']]) else: axle_A = [(c['g1_ix']+c['axle_radius']*math.cos(-1*c['crenel_half_width_angle']), c['g1_iy']+c['axle_radius']*math.sin(-1*c['crenel_half_width_angle']), 0)] if(c['crenel_rectangle_type']==1): crenel_A = [ (c['g1_ix']+c['axle_radius']+c['crenel_height'], c['g1_iy']-c['crenel_width']/2.0, -1*c['crenel_rbr']), (c['g1_ix']+c['axle_radius']+c['crenel_height'], c['g1_iy']+c['crenel_width']/2.0, -1*c['crenel_rbr']), (c['g1_ix']+c['axle_radius']*math.cos(1*c['crenel_half_width_angle']), c['g1_iy']+c['axle_radius']*math.sin(1*c['crenel_half_width_angle']), 0)] crenel_A_marked = crenel_A[:] crenel_A_marked[-1] = (crenel_A[-1][0], crenel_A[-1][1], 0.6*c['crenel_height']) elif(c['crenel_rectangle_type']==2): tmp_l = c['crenel_rbr'] * (1+math.sqrt(2)) crenel_A = [ (c['g1_ix']+c['axle_radius']+c['crenel_height']+1*tmp_l, c['g1_iy']-c['crenel_width']/2.0+0*tmp_l, 1*c['crenel_rbr']), (c['g1_ix']+c['axle_radius']+c['crenel_height']+0*tmp_l, c['g1_iy']-c['crenel_width']/2.0+1*tmp_l, 0*c['crenel_rbr']), (c['g1_ix']+c['axle_radius']+c['crenel_height']+0*tmp_l, c['g1_iy']+c['crenel_width']/2.0-1*tmp_l, 0*c['crenel_rbr']), (c['g1_ix']+c['axle_radius']+c['crenel_height']+1*tmp_l, c['g1_iy']+c['crenel_width']/2.0-0*tmp_l, 1*c['crenel_rbr']), (c['g1_ix']+c['axle_radius']*math.cos(1*c['crenel_half_width_angle']), c['g1_iy']+c['axle_radius']*math.sin(1*c['crenel_half_width_angle']), 0)] crenel_A_marked = crenel_A[:] crenel_A_marked[-1] = (crenel_A[-1][0], crenel_A[-1][1], 0.6*c['crenel_height']) arc_half_angle = (c['crenel_portion_angle'] - 2*c['crenel_half_width_angle'])/2.0 arc_middle_a = c['crenel_half_width_angle'] + arc_half_angle arc_end_a = arc_middle_a + arc_half_angle crenel_A.append((c['g1_ix']+c['axle_radius']*math.cos(arc_middle_a), c['g1_iy']+c['axle_radius']*math.sin(arc_middle_a), c['g1_ix']+c['axle_radius']*math.cos(arc_end_a), c['g1_iy']+c['axle_radius']*math.sin(arc_end_a), 0)) crenel_A_marked.append(crenel_A[-1]) for i in range(c['crenel_number']): if(i<c['crenel_mark_nb']): crenel_A_selected = crenel_A_marked else: crenel_A_selected = crenel_A axle_A.extend(cnc25d_api.outline_rotate(crenel_A_selected, c['g1_ix'], c['g1_iy'], i*c['crenel_portion_angle'])) axle_A[-1] = (axle_A[-1][0], axle_A[-1][1], axle_A[0][0], axle_A[0][1], 0) axle_A_rotated = cnc25d_api.outline_rotate(axle_A, c['g1_ix'], c['g1_iy'], c['crenel_angle']) axle_figure.append(axle_A_rotated) elif(c['axle_type']=='rectangle'): axle_A = [ [c['g1_ix']-c['axle_x_width']/2.0, c['g1_iy']-c['axle_y_width']/2.0, -1*c['axle_rbr']], [c['g1_ix']+c['axle_x_width']/2.0, c['g1_iy']-c['axle_y_width']/2.0, -1*c['axle_rbr']], [c['g1_ix']+c['axle_x_width']/2.0, c['g1_iy']+c['axle_y_width']/2.0, -1*c['axle_rbr']], [c['g1_ix']-c['axle_x_width']/2.0, c['g1_iy']+c['axle_y_width']/2.0, -1*c['axle_rbr']]] axle_A = cnc25d_api.outline_close(axle_A) axle_figure.append(axle_A) ### crenel #crenel_template if(c['crenel_number']>0): if((c['crenel_type']=='rectangle')and(not c['crenel_axle_merge'])): if(c['crenel_rectangle_type']==1): template_crenel = [ (c['g1_ix']+c['crenel_radius']+0*c['crenel_height'], c['g1_iy']-1*c['crenel_width']/2.0, -1*c['crenel_rbr']), (c['g1_ix']+c['crenel_radius']+1*c['crenel_height'], c['g1_iy']-1*c['crenel_width']/2.0, -1*c['crenel_rbr']), (c['g1_ix']+c['crenel_radius']+1*c['crenel_height'], c['g1_iy']+1*c['crenel_width']/2.0, -1*c['crenel_rbr']), (c['g1_ix']+c['crenel_radius']+0*c['crenel_height'], c['g1_iy']+1*c['crenel_width']/2.0, -1*c['crenel_rbr'])] elif(c['crenel_rectangle_type']==2): tmp_l = c['crenel_rbr'] * (1+math.sqrt(2)) template_crenel = [ (c['g1_ix']+c['crenel_radius']+0*c['crenel_height']-1*tmp_l, c['g1_iy']-1*c['crenel_width']/2.0+0*tmp_l, 1*c['crenel_rbr']), (c['g1_ix']+c['crenel_radius']+1*c['crenel_height']+1*tmp_l, c['g1_iy']-1*c['crenel_width']/2.0+0*tmp_l, 1*c['crenel_rbr']), (c['g1_ix']+c['crenel_radius']+1*c['crenel_height']+0*tmp_l, c['g1_iy']-1*c['crenel_width']/2.0+1*tmp_l, 0*c['crenel_rbr']), (c['g1_ix']+c['crenel_radius']+1*c['crenel_height']+0*tmp_l, c['g1_iy']+1*c['crenel_width']/2.0-1*tmp_l, 0*c['crenel_rbr']), (c['g1_ix']+c['crenel_radius']+1*c['crenel_height']+1*tmp_l, c['g1_iy']+1*c['crenel_width']/2.0-0*tmp_l, 1*c['crenel_rbr']), (c['g1_ix']+c['crenel_radius']+0*c['crenel_height']-1*tmp_l, c['g1_iy']+1*c['crenel_width']/2.0-0*tmp_l, 1*c['crenel_rbr']), (c['g1_ix']+c['crenel_radius']+0*c['crenel_height']-0*tmp_l, c['g1_iy']+1*c['crenel_width']/2.0-1*tmp_l, 0*c['crenel_rbr']), (c['g1_ix']+c['crenel_radius']+0*c['crenel_height']-0*tmp_l, c['g1_iy']-1*c['crenel_width']/2.0+1*tmp_l, 0*c['crenel_rbr'])] template_crenel = cnc25d_api.outline_close(template_crenel) for i in range(c['crenel_number']): crenel_A = cnc25d_api.outline_rotate(template_crenel, c['g1_ix'], c['g1_iy'], c['crenel_angle']+i*c['crenel_portion_angle']) axle_figure.append(crenel_A) elif(c['crenel_type']=='circle'): for i in range(c['crenel_number']): ta = c['crenel_angle']+i*c['crenel_portion_angle'] if(i<c['crenel_mark_nb']): axle_figure.append(marked_circle_crenel(c['g1_ix']+c['crenel_radius']*math.cos(ta), c['g1_iy']+c['crenel_radius']*math.sin(ta), c['crenel_width']/2.0, ta+math.pi/2, c['crenel_rbr'])) else: axle_figure.append((c['g1_ix']+c['crenel_radius']*math.cos(ta), c['g1_iy']+c['crenel_radius']*math.sin(ta), c['crenel_width']/2.0)) #print("dbg435: axle_figure:", axle_figure) ### wheel hollow (a.k.a legs) wheel_hollow_figure = [] if(c['wheel_hollow_leg_number']>0): wh_angle = 2*math.pi/c['wheel_hollow_leg_number'] wh_leg_top_angle1 = math.asin(float(c['wheel_hollow_leg_width']/2.0+c['wheel_hollow_rbr'])/(c['wheel_hollow_external_radius']-c['wheel_hollow_rbr'])) if(wh_angle<2*wh_leg_top_angle1+radian_epsilon): print("ERR664: Error, wh_angle {:0.2f} too small compare to wh_leg_top_angle1 {:0.2f}!".format(wh_angle, wh_leg_top_angle1)) sys.exit(2) wh_leg_bottom_angle1 = math.asin(float(c['wheel_hollow_leg_width']/2.0+c['wheel_hollow_rbr'])/(c['wheel_hollow_internal_radius']+c['wheel_hollow_rbr'])) #wh_leg_top_angle2 = math.asin((c['wheel_hollow_leg_width']/2)/c['wheel_hollow_external_radius']) wh_leg_top_angle2 = math.asin(float(c['wheel_hollow_leg_width'])/(2*c['wheel_hollow_external_radius'])) #wh_leg_bottom_angle2 = math.asin((c['wheel_hollow_leg_width']/2)/c['wheel_hollow_internal_radius']) wh_leg_bottom_angle2 = math.asin(float(c['wheel_hollow_leg_width'])/(2*c['wheel_hollow_internal_radius'])) # angular coordinates of the points wh_top1_a = c['wheel_hollow_leg_angle']+wh_leg_top_angle2 wh_top2_a = c['wheel_hollow_leg_angle']+wh_angle/2.0 wh_top3_a = c['wheel_hollow_leg_angle']+wh_angle-wh_leg_top_angle2 wh_bottom1_a = c['wheel_hollow_leg_angle']+wh_leg_bottom_angle2 wh_bottom2_a = c['wheel_hollow_leg_angle']+wh_angle/2.0 wh_bottom3_a = c['wheel_hollow_leg_angle']+wh_angle-wh_leg_bottom_angle2 # Cartesian coordinates of the points wh_top1_x = c['g1_ix'] + c['wheel_hollow_external_radius']*math.cos(wh_top1_a) wh_top1_y = c['g1_iy'] + c['wheel_hollow_external_radius']*math.sin(wh_top1_a) wh_top2_x = c['g1_ix'] + c['wheel_hollow_external_radius']*math.cos(wh_top2_a) wh_top2_y = c['g1_iy'] + c['wheel_hollow_external_radius']*math.sin(wh_top2_a) wh_top3_x = c['g1_ix'] + c['wheel_hollow_external_radius']*math.cos(wh_top3_a) wh_top3_y = c['g1_iy'] + c['wheel_hollow_external_radius']*math.sin(wh_top3_a) wh_bottom1_x = c['g1_ix'] + c['wheel_hollow_internal_radius']*math.cos(wh_bottom1_a) wh_bottom1_y = c['g1_iy'] + c['wheel_hollow_internal_radius']*math.sin(wh_bottom1_a) wh_bottom2_x = c['g1_ix'] + c['wheel_hollow_internal_radius']*math.cos(wh_bottom2_a) wh_bottom2_y = c['g1_iy'] + c['wheel_hollow_internal_radius']*math.sin(wh_bottom2_a) wh_bottom3_x = c['g1_ix'] + c['wheel_hollow_internal_radius']*math.cos(wh_bottom3_a) wh_bottom3_y = c['g1_iy'] + c['wheel_hollow_internal_radius']*math.sin(wh_bottom3_a) # create one outline if(wh_angle<2*wh_leg_bottom_angle1+radian_epsilon): wh_outline_A = [ [wh_top1_x, wh_top1_y, c['wheel_hollow_rbr']], [wh_top2_x, wh_top2_y, wh_top3_x, wh_top3_y, c['wheel_hollow_rbr']], [wh_bottom2_x, wh_bottom2_y, c['wheel_hollow_rbr']]] else: wh_outline_A = [ [wh_top1_x, wh_top1_y, c['wheel_hollow_rbr']], [wh_top2_x, wh_top2_y, wh_top3_x, wh_top3_y, c['wheel_hollow_rbr']], [wh_bottom3_x, wh_bottom3_y, c['wheel_hollow_rbr']], [wh_bottom2_x, wh_bottom2_y, wh_bottom1_x, wh_bottom1_y, c['wheel_hollow_rbr']]] wh_outline_A = cnc25d_api.outline_close(wh_outline_A) for i in range(c['wheel_hollow_leg_number']): wheel_hollow_figure.append(cnc25d_api.outline_rotate(wh_outline_A, c['g1_ix'], c['g1_iy'], i*wh_angle)) ### design output gw_figure = [] if(c['gear_tooth_nb']>0): i_gear_profile = inherit_gear_profile(c) # inherit from gear_profile gw_figure.extend(i_gear_profile.get_A_figure('first_gear')) else: gw_figure.append((c['g1_ix'], c['g1_iy'], float(c['gear_primitive_diameter'])/2)) gw_figure.extend(axle_figure) gw_figure.extend(wheel_hollow_figure) ### r_figures = {} r_height = {} # r_figures['gearwheel_fig'] = gw_figure r_height['gearwheel_fig'] = c['gear_profile_height'] ### return((r_figures, r_height))
def cross_cube_top(ai_constraints): """ Generate the whole top figure """ # alias cc_c = cross_cube_sub_top_check(ai_constraints) cccrbr = cc_c["cross_cube_cnc_router_bit_radius"] ccect = cc_c["cross_cube_extra_cut_thickness"] cw5 = cc_c["cube_width"] / 5.0 fa1t = cc_c["face_A1_thickness"] fa2t = cc_c["face_A2_thickness"] fb1t = cc_c["face_B1_thickness"] fb2t = cc_c["face_B2_thickness"] # # top_sub_outline def top_sub_outline(ai_previous_face_thickness, ai_current_face_thickness, ai_post_face_thickness): """ Generate a sub-outline of the top_outline """ # pre_ft = ai_previous_face_thickness cur_ft = ai_current_face_thickness post_ft = ai_post_face_thickness # r_top_sub_ol = [] r_top_sub_ol.append((pre_ft + ccect, cur_ft + ccect, 0)) r_top_sub_ol.append((1 * cw5, cur_ft + ccect, -1 * cccrbr)) r_top_sub_ol.append((1 * cw5, 0, 0)) r_top_sub_ol.append((2 * cw5, 0, 0)) r_top_sub_ol.append((2 * cw5, cur_ft + ccect, -1 * cccrbr)) r_top_sub_ol.append((3 * cw5, cur_ft + ccect, -1 * cccrbr)) r_top_sub_ol.append((3 * cw5, 0, 0)) r_top_sub_ol.append((4 * cw5, 0, 0)) r_top_sub_ol.append((4 * cw5, cur_ft + ccect, -1 * cccrbr)) r_top_sub_ol.append((5 * cw5 - post_ft - ccect, cur_ft + ccect, 0)) # return r_top_sub_ol # top_outline top_ol = [] top_ol.extend( cnc25d_api.outline_rotate( top_sub_outline(fb1t, fa1t, fb2t)[:-1], cc_c["cube_width"] / 2.0, cc_c["cube_width"] / 2.0, 0 * math.pi / 2 ) ) top_ol.extend( cnc25d_api.outline_rotate( top_sub_outline(fa1t, fb2t, fa2t)[:-1], cc_c["cube_width"] / 2.0, cc_c["cube_width"] / 2.0, 1 * math.pi / 2 ) ) top_ol.extend( cnc25d_api.outline_rotate( top_sub_outline(fb2t, fa2t, fb1t)[:-1], cc_c["cube_width"] / 2.0, cc_c["cube_width"] / 2.0, 2 * math.pi / 2 ) ) top_ol.extend( cnc25d_api.outline_rotate( top_sub_outline(fa2t, fb1t, fa1t)[:-1], cc_c["cube_width"] / 2.0, cc_c["cube_width"] / 2.0, 3 * math.pi / 2 ) ) top_ol = cnc25d_api.outline_close(top_ol) top_A = [] top_A.append(top_ol) # holes if cc_c["top_rod_hole_radius"] > 0: top_A.append( ( fb1t + cc_c["top_rod_hole_h_position"], fa1t + cc_c["top_rod_hole_h_position"], cc_c["top_rod_hole_radius"], ) ) top_A.append( ( cc_c["cube_width"] - (fb2t + cc_c["top_rod_hole_h_position"]), fa1t + cc_c["top_rod_hole_h_position"], cc_c["top_rod_hole_radius"], ) ) top_A.append( ( cc_c["cube_width"] - (fb2t + cc_c["top_rod_hole_h_position"]), cc_c["cube_width"] - (fa2t + cc_c["top_rod_hole_h_position"]), cc_c["top_rod_hole_radius"], ) ) top_A.append( ( fb1t + cc_c["top_rod_hole_h_position"], cc_c["cube_width"] - (fa2t + cc_c["top_rod_hole_h_position"]), cc_c["top_rod_hole_radius"], ) ) # top-hollow # [todo] # return return top_A
def slab_side(c, nai_type): """ Create the FreeCAD Part Object slab_side """ slab_length = c['slab_side_length'] if (nai_type == 'left_right'): slab_width = c['slab_side_left_right_width'] elif (nai_type == 'rear_single'): slab_width = c['slab_side_rear_single_width'] elif (nai_type == 'rear_side'): slab_width = c['slab_side_rear_side_width'] elif (nai_type == 'rear_middle'): slab_width = c['slab_side_rear_middle_width'] slab_side_outline = [] slab_side_outline.append([ 0 * slab_length + 1 * c['cutting_extra'], 0 * slab_width + 1 * c['cutting_extra'], 0 ]) slab_side_outline.extend( cnc25d_api.outline_shift_xy( jonction_slab_side_with_wall_diagonal_horizontal(c), 0 * slab_length, 1, 0 * slab_width, 1)) slab_side_outline.extend( cnc25d_api.outline_shift_xy( jonction_slab_side_with_wall_diagonal_horizontal(c), 1 * slab_length, -1, 0 * slab_width, 1)) slab_side_outline.append([ 1 * slab_length - 1 * c['cutting_extra'], 0 * slab_width + 1 * c['cutting_extra'], 0 ]) slab_side_outline.extend( cnc25d_api.outline_shift_xy( jonction_slab_side_with_wall_diagonal_vertical(c), 1 * slab_length, -1, 0 * slab_width, 1)) slab_side_outline.extend( cnc25d_api.outline_shift_xy( jonction_slab_side_with_wall_diagonal_vertical(c), 1 * slab_length, -1, 1 * slab_width, -1)) slab_side_outline.append([ 1 * slab_length - 1 * c['cutting_extra'], 1 * slab_width - 1 * c['cutting_extra'], 0 ]) slab_side_outline.extend( cnc25d_api.outline_shift_xy( jonction_slab_side_with_wall_diagonal_horizontal(c), 1 * slab_length, -1, 1 * slab_width, -1)) slab_side_outline.extend( cnc25d_api.outline_shift_xy( jonction_slab_side_with_wall_diagonal_horizontal(c), 0 * slab_length, 1, 1 * slab_width, -1)) slab_side_outline.append([ 0 * slab_length + 1 * c['cutting_extra'], 1 * slab_width - 1 * c['cutting_extra'], 0 ]) slab_side_outline.extend( cnc25d_api.outline_shift_xy( jonction_slab_side_with_wall_diagonal_vertical(c), 0 * slab_length, 1, 1 * slab_width, -1)) slab_side_outline.extend( cnc25d_api.outline_shift_xy( jonction_slab_side_with_wall_diagonal_vertical(c), 0 * slab_length, 1, 0 * slab_width, 1)) slab_side_A = cnc25d_api.outline_close(slab_side_outline) r_fig = [slab_side_A] 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_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_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_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)