コード例 #1
0
ファイル: crest.py プロジェクト: charlyoleg/Cnc25D
def crest_constraint_constructor(ai_parser, ai_variant=0):
  """
  Add arguments relative to the crest
  """
  r_parser = ai_parser
  # parameter inheritance from cross_cube_sub
  r_parser = cross_cube_sub.cross_cube_sub_constraint_constructor(r_parser, 2)
  # parameter inheritance from gear_profile
  i_gear_profile = gear_profile.gear_profile()
  r_parser = i_gear_profile.get_constraint_constructor()(r_parser, 4)
  ### outline
  r_parser.add_argument('--gear_module','--gm', action='store', type=float, default=3.0,
    help="Set the gear-module of the crest. Default: 3.0")
  r_parser.add_argument('--virtual_tooth_nb','--vtn', action='store', type=int, default=60,
    help="Set the virtual number of gear-teeth of the crest. Default: 60")
  r_parser.add_argument('--portion_tooth_nb','--ptn', action='store', type=int, default=30,
    help="Set the number of teeth of the gear-portion of the crest. Default: 30")
  r_parser.add_argument('--free_mounting_width','--fmw', action='store', type=float, default=15.0,
    help="Set the width that must be kept free to mount the crest in a cross_cube (minimum: face_B1_thickness + cnc_router_bit_radius). Default: 15.0")
  ### crest_hollow
  r_parser.add_argument('--crest_hollow_leg_nb','--chln', action='store', type=int, default=4,
    help="Set the number of crest-hollow_legs. Possible values: 1(filled), 2(end-legs only), 3, 4, etc. Default: 4")
  r_parser.add_argument('--end_leg_width','--elw', action='store', type=float, default=10.0,
    help="Set the width of the two end-legs of the crest. Default: 10.0")
  r_parser.add_argument('--middle_leg_width','--mlw', action='store', type=float, default=0.0,
    help="Set the width of the middle-legs of the crest. If equal to 0.0, set to end_leg_width. Default: 0.0")
  r_parser.add_argument('--crest_hollow_external_diameter','--ched', action='store', type=float, default=0.0,
    help="Set the diameter of the crest-hollow-external circle. If equal to 0.0, set to gear_hollow_radius - delta. Default: 0.0")
  r_parser.add_argument('--crest_hollow_internal_diameter','--chid', action='store', type=float, default=0.0,
    help="Set the diameter of the crest-hollow-internal circle. If equal to 0.0, set to minimal_crest_hollow_internal_radius. Default: 0.0")
  r_parser.add_argument('--floor_width','--fw', action='store', type=float, default=0.0,
    help="Set the width between the cross_cube-top-holes and the crest-gear-hollow. If equal to 0.0, set to end_leg_width. Default: 0.0")
  r_parser.add_argument('--crest_hollow_smoothing_radius','--chsr', action='store', type=float, default=0.0,
    help="Set the smoothing radius for the crest-hollow. If equal to 0.0, set to 0.5*maximal_crest_hollow_smoothing_radius. Default: 0.0")
  ### gear_holes
  r_parser.add_argument('--fastening_hole_diameter','--fhd', action='store', type=float, default=5.0,
    help="Set the diameter of the crest-gear-fastening-holes. Default: 5.0")
  r_parser.add_argument('--fastening_hole_position','--fhp', action='store', type=float, default=0.0,
    help="Set the position relative to the gear-hollow-external circle of the crest-gear-fastening-holes. Default: 0.0")
  r_parser.add_argument('--centring_hole_diameter','--chd', action='store', type=float, default=1.0,
    help="Set the diameter of the crest-gear-centring-holes. Default: 1.0")
  r_parser.add_argument('--centring_hole_distance','--chdi', action='store', type=float, default=8.0,
    help="Set the distance between a pair of crest-gear-centring-holes. Default: 8.0")
  r_parser.add_argument('--centring_hole_position','--chp', action='store', type=float, default=0.0,
    help="Set the position relative to the gear-hollow-external circle of the crest-gear-centring-holes. Default: 0.0")
  ## part thickness
  r_parser.add_argument('--crest_thickness','--ct', action='store', type=float, default=5.0,
    help="Set the thickness (z-size) of the crest. Default: 5.0")
  ### manufacturing
  r_parser.add_argument('--crest_cnc_router_bit_radius','--ccrbr', action='store', type=float, default=0.5,
    help="Set the minimal router_bit radius for the crest part. Default: 0.5")
  ### output
  # return
  return(r_parser)
コード例 #2
0
ファイル: cross_cube.py プロジェクト: charlyoleg/Cnc25D
def cross_cube_constraint_constructor(ai_parser, ai_variant=0):
  """
  Add arguments relative to the cross_cube
  """
  r_parser = ai_parser
  ### face A1, A2, B1 and B2 : inherited from crest
  i_crest = crest.crest()
  r_parser = i_crest.get_constraint_constructor()(r_parser, 1)
  ### top : inherited from cross_cube_sub
  r_parser = cross_cube_sub.cross_cube_sub_constraint_constructor(r_parser, 1)
  ### select crest on face
  r_parser.add_argument('--face_A1_crest','--fa1c', action='store_true', default=False,
    help="Replace the face_A1 with the crest. Default: False")
  r_parser.add_argument('--face_A2_crest','--fa2c', action='store_true', default=False,
    help="Replace the face_A2 with the crest. Default: False")
  r_parser.add_argument('--face_B1_crest','--fb1c', action='store_true', default=False,
    help="Replace the face_B1 with the crest. Default: False")
  r_parser.add_argument('--face_B2_crest','--fb2c', action='store_true', default=False,
    help="Replace the face_B2 with the crest. Default: False")
  ### output
  # return
  return(r_parser)
コード例 #3
0
def cross_cube_constraint_constructor(ai_parser, ai_variant=0):
    """
  Add arguments relative to the cross_cube
  """
    r_parser = ai_parser
    ### face A1, A2, B1 and B2 : inherited from crest
    i_crest = crest.crest()
    r_parser = i_crest.get_constraint_constructor()(r_parser, 1)
    ### top : inherited from cross_cube_sub
    r_parser = cross_cube_sub.cross_cube_sub_constraint_constructor(
        r_parser, 1)
    ### select crest on face
    r_parser.add_argument(
        '--face_A1_crest',
        '--fa1c',
        action='store_true',
        default=False,
        help="Replace the face_A1 with the crest. Default: False")
    r_parser.add_argument(
        '--face_A2_crest',
        '--fa2c',
        action='store_true',
        default=False,
        help="Replace the face_A2 with the crest. Default: False")
    r_parser.add_argument(
        '--face_B1_crest',
        '--fb1c',
        action='store_true',
        default=False,
        help="Replace the face_B1 with the crest. Default: False")
    r_parser.add_argument(
        '--face_B2_crest',
        '--fb2c',
        action='store_true',
        default=False,
        help="Replace the face_B2 with the crest. Default: False")
    ### output
    # return
    return (r_parser)