Example #1
0
gw_constraint['wheel_hollow_leg_number']        = 7
gw_constraint['wheel_hollow_leg_width']         = 10.0
gw_constraint['wheel_hollow_leg_angle']         = 0.0
gw_constraint['wheel_hollow_internal_diameter'] = 40.0
gw_constraint['wheel_hollow_external_diameter'] = 125.0
gw_constraint['wheel_hollow_router_bit_radius'] = 5.0
### cnc router_bit constraint
gw_constraint['cnc_router_bit_radius']          = 1.0



################################################################
# action
################################################################

my_gw = cnc25d_design.gearwheel(gw_constraint)
my_gw.outline_display()
my_gw.write_info_txt("test_output/gearwheel_macro")
my_gw.write_figure_svg("test_output/gearwheel_macro")
my_gw.write_figure_dxf("test_output/gearwheel_macro")
my_gw.write_figure_brep("test_output/gearwheel_macro")
my_gw.write_assembly_brep("test_output/gearwheel_macro")
my_gw.write_freecad_brep("test_output/gearwheel_macro")
my_gw.run_simulation("")
my_gw.view_design_configuration()
#my_gw.run_self_test("")
#my_gw.cli("--output_file_basename test_output/gwm.dxf") # Warning: all constraint values are reset to their default values

if(cnc25d_api.interpretor_is_freecad()):
  Part.show(my_gw.get_fc_obj_3dconf('gearwheel_3dconf1'))
# --axle_type circle --axle_x_width 6.0 --wheel_hollow_leg_width 20.0 --wheel_hollow_internal_diameter 40.0 --cnc_router_bit_radius 2.0 --gear_module 10 --gear_tooth_nb 30 --second_gear_tooth_nb 19 --wheel_hollow_leg_number 4 --output_file_basename test_output/luke2.dxf

gw_c3 = gw_constraint.copy()
gw_c3['gear_tooth_nb'] = 25
gw_c3['second_gear_tooth_nb'] = 19
gw_c3['wheel_hollow_leg_number'] = 5

gw_c4 = gw_constraint.copy()
gw_c4['gear_tooth_nb'] = 33
gw_c4['second_gear_tooth_nb'] = 19
gw_c4['wheel_hollow_leg_number'] = 6

gw_c_array = [gw_c1, gw_c2, gw_c3, gw_c4]

for i in range(len(gw_c_array)):
  my_gw = cnc25d_design.gearwheel( gw_c_array[i])
  if(sim):
    my_gw.run_simulation("")
  elif(view):
    my_gw.outline_display()
  else:
    my_gw.write_figure_dxf("test_output/jh01_{:02d}.dxf".format(i+1))
  #Part.show(my_gw)
#Part.show(my_gw)

################################################################
# center-plank
################################################################

import math
Example #3
0
gw_constraint['wheel_hollow_leg_number']        = 7
gw_constraint['wheel_hollow_leg_width']         = 10.0
gw_constraint['wheel_hollow_leg_angle']         = 0.0
gw_constraint['wheel_hollow_internal_diameter'] = 40.0
gw_constraint['wheel_hollow_external_diameter'] = 125.0
gw_constraint['wheel_hollow_router_bit_radius'] = 5.0
### cnc router_bit constraint
gw_constraint['cnc_router_bit_radius']          = 1.0



################################################################
# action
################################################################

my_gw = cnc25d_design.gearwheel(gw_constraint)
my_gw.outline_display()
my_gw.write_info_txt("test_output/gearwheel_macro")
my_gw.write_figure_svg("test_output/gearwheel_macro")
my_gw.write_figure_dxf("test_output/gearwheel_macro")
my_gw.write_figure_brep("test_output/gearwheel_macro")
my_gw.write_assembly_brep("test_output/gearwheel_macro")
my_gw.write_freecad_brep("test_output/gearwheel_macro")
my_gw.run_simulation("")
my_gw.view_design_configuration()
#my_gw.run_self_test("")
#my_gw.cli("--output_file_basename test_output/gwm.dxf") # Warning: all constraint values are reset to their default values

if(cnc25d_api.interpretor_is_freecad()):
  Part.show(my_gw.get_fc_obj_3dconf('gearwheel_3dconf1'))
# --axle_type circle --axle_x_width 6.0 --wheel_hollow_leg_width 20.0 --wheel_hollow_internal_diameter 40.0 --cnc_router_bit_radius 2.0 --gear_module 10 --gear_tooth_nb 30 --second_gear_tooth_nb 19 --wheel_hollow_leg_number 4 --output_file_basename test_output/luke2.dxf

gw_c3 = gw_constraint.copy()
gw_c3['gear_tooth_nb'] = 25
gw_c3['second_gear_tooth_nb'] = 19
gw_c3['wheel_hollow_leg_number'] = 5

gw_c4 = gw_constraint.copy()
gw_c4['gear_tooth_nb'] = 33
gw_c4['second_gear_tooth_nb'] = 19
gw_c4['wheel_hollow_leg_number'] = 6

gw_c_array = [gw_c1, gw_c2, gw_c3, gw_c4]

for i in range(len(gw_c_array)):
    my_gw = cnc25d_design.gearwheel(gw_c_array[i])
    if (sim):
        my_gw.run_simulation("")
    elif (view):
        my_gw.outline_display()
    else:
        my_gw.write_figure_dxf("test_output/jh01_{:02d}.dxf".format(i + 1))
    #Part.show(my_gw)
#Part.show(my_gw)

################################################################
# center-plank
################################################################

import math