예제 #1
0
def generate_contact(calc_dim):
    pin_group_width = calc_dim.pin_group_width
    contact_width = series_params.contact_width
    contact_thickness = series_params.contact_thickness
    contact_minimum_radius = series_params.contact_minimum_radius
    pin_pitch = series_params.pitch
    pocket_width = series_params.pocket_width
    body_height = series_params.body_height
    pocket_base_thickness = series_params.pocket_base_thickness
    c_list = [('start', {
        'position':
        ((-pocket_width / 2 - contact_thickness / 2.0, pocket_base_thickness)),
        'direction':
        90.0,
        'width':
        contact_thickness
    }),
              ('line', {
                  'length':
                  body_height - pocket_base_thickness -
                  contact_minimum_radius - contact_thickness / 2.0
              }), ('arc', {
                  'radius': contact_minimum_radius,
                  'angle': 90.0
              }), ('line', {
                  'length': 0.25
              })]
    ribbon = Ribbon(
        cq.Workplane("YZ").workplane(offset=-contact_width / 2.0 -
                                     pin_group_width / 2.0), c_list)
    contact = ribbon.drawRibbon().extrude(contact_width)
    contact = contact.faces("<Y").edges("|Z").chamfer((contact_width / 2.0) -
                                                      0.01)
    return contact
예제 #2
0
def generate_pin(num_pins, calc_dim):
    pin_group_width = calc_dim.pin_group_width
    pin_width = series_params.pin_width
    pin_thickness = series_params.pin_thickness
    pin_pitch = series_params.pitch
    body_width = series_params.body_width
    pin_minimum_radius = series_params.pin_minimum_radius
    pin_y_offset = series_params.pin_y_offset
    p_list = [('start', {
        'position': ((-body_width / 2 - pin_y_offset, pin_thickness / 2.0)),
        'direction':
        0.0,
        'width':
        pin_thickness
    }), ('line', {
        'length': pin_y_offset
    }), ('arc', {
        'radius': pin_minimum_radius,
        'angle': 60.0
    }), ('line', {
        'length': 0.05
    }), ('arc', {
        'radius': pin_minimum_radius,
        'angle': -60.0
    }), ('line', {
        'length': 0.4
    })]
    ribbon = Ribbon(
        cq.Workplane("YZ").workplane(offset=-pin_width / 2.0 -
                                     pin_group_width / 2.0), p_list)
    pin = ribbon.drawRibbon().extrude(pin_width)
    return pin
def generate_contact(calc_dim):
    pin_group_width = calc_dim.pin_group_width
    pin_width = series_params.pin_width
    pin_thickness = series_params.pin_thickness
    pin_minimum_radius = series_params.pin_minimum_radius
    pitch = series_params.pitch
    pin_y_offset = series_params.pin_y_offset
    body_width = series_params.body_width
    hole_length = series_params.hole_length-0.02
    hole_offset = series_params.hole_offset
    slot_height = series_params.slot_height
    c1_list = [
        ('start', {'position': ((-body_width/2 - pin_y_offset, pin_thickness/2.0)), 'direction': 0.0, 'width':pin_thickness}),
        ('line', {'length': pin_y_offset}),
        ('arc', {'radius': pin_minimum_radius, 'angle': 60.0}),
        ('line', {'length': 0.05}),
        ('arc', {'radius': pin_minimum_radius, 'angle': -60.0}),
        ('line', {'length': 0.8}),
        ('arc', {'radius': pin_minimum_radius, 'angle': -45.0}),
        ('arc', {'radius': pin_minimum_radius, 'angle': 45.0}),
        ('line', {'length': 0.63}),
        ('arc', {'radius': 0.15, 'angle': 95.0}),
        ('line', {'length': 0.5}),
        ('arc', {'radius': 0.1, 'angle': 85.0})
    ]
    ribbon = Ribbon(cq.Workplane("YZ").workplane(offset=-pin_width/2.0 - pin_group_width/2.0), c1_list)
    contact1 = ribbon.drawRibbon().extrude(pin_width)
    c2_list = [
        ('start', {'position': ((-hole_offset-hole_length/2.0+pin_thickness/2.0, slot_height-pin_minimum_radius-pin_thickness/2.0)), 'direction': 90.0, 'width':pin_thickness}),
        ('arc', {'radius': pin_minimum_radius, 'angle': -90.0}),
        ('line', {'length': hole_length-2.0*pin_minimum_radius-pin_thickness}),
        ('arc', {'radius': pin_minimum_radius, 'angle': -90.0}),
        ('line', {'length': slot_height - 0.32}),
        ('arc', {'radius': pin_minimum_radius, 'angle': 90.0}),
        ('line', {'length': 0.29}),
        ('arc', {'radius': 0.1, 'angle': 90.0}),
        ('line', {'length': 0.45}),
        ('arc', {'radius': 0.1, 'angle': -90.0})
    ]
    ribbon = Ribbon(cq.Workplane("YZ").workplane(offset=-pin_width/2.0 - pin_group_width/2.0), c2_list)
    contact2 = ribbon.drawRibbon().extrude(pin_width)
    contact1 = contact1.union(contact2)
    return contact1
def generate_2_contact_group(params):
    pin_y_pitch = params.pin_y_pitch
    foot_height = seriesParams.foot_height
    pin_thickness = seriesParams.pin_thickness
    pin_width = seriesParams.pin_width
    y_offset = -(2 * pin_y_pitch)
    c_list = [
        ('start', {
            'position': (pin_y_pitch, foot_height),
            'direction': 90.0,
            'width': pin_thickness
        }),
        ('line', {
            'length': 4.5
        }),
        ('arc', {
            'radius': 0.2,
            'angle': 35.0
        }),
        ('line', {
            'length': 3
        }),
        ('arc', {
            'radius': 2.0,
            'angle': -70.0
        }),
        ('line', {
            'length': 2
        }),
        ('arc', {
            'radius': 0.2,
            'angle': 35.0
        }),
        ('line', {
            'length': 2.8
        }),
    ]
    ribbon = Ribbon(
        cq.Workplane("YZ").workplane(offset=-pin_width / 2.0), c_list)
    contact1 = ribbon.drawRibbon().extrude(pin_width)
    contact2 = contact1.mirror("XZ")
    contact1 = contact1.union(contact2).translate(
        (0, -3 * pin_y_pitch / 2.0, 0))
    return contact1
def generate_contact(calc_dim):
    pin_group_width = calc_dim.pin_group_width
    contact_width = series_params.contact_width
    contact_thickness = series_params.contact_thickness
    contact_minimum_radius = series_params.contact_minimum_radius
    pin_pitch = series_params.pitch
    pocket_width = series_params.pocket_width
    body_height = series_params.body_height
    pocket_base_thickness = series_params.pocket_base_thickness
    c_list = [
        ('start', {'position': ((-pocket_width/2 - contact_thickness / 2.0, pocket_base_thickness)), 'direction': 90.0, 'width':contact_thickness}),
        ('line', {'length': body_height  - pocket_base_thickness - contact_minimum_radius - contact_thickness / 2.0}),
        ('arc', {'radius': contact_minimum_radius, 'angle': 90.0}),
        ('line', {'length': 0.25})
    ]
    ribbon = Ribbon(cq.Workplane("YZ").workplane(offset=-contact_width/2.0 - pin_group_width/2.0), c_list)
    contact = ribbon.drawRibbon().extrude(contact_width)
    contact = contact.faces("<Y").edges("|Z").chamfer((contact_width / 2.0)- 0.01)
    return contact
def generate_pin(num_pins, calc_dim):
    pin_group_width = calc_dim.pin_group_width
    pin_width = series_params.pin_width
    pin_thickness = series_params.pin_thickness
    pin_pitch = series_params.pitch
    body_width = series_params.body_width
    pin_minimum_radius = series_params.pin_minimum_radius
    pin_y_offset = series_params.pin_y_offset
    p_list = [
        ('start', {'position': ((-body_width/2 - pin_y_offset, pin_thickness/2.0)), 'direction': 0.0, 'width':pin_thickness}),
        ('line', {'length': pin_y_offset}),
        ('arc', {'radius': pin_minimum_radius, 'angle': 60.0}),
        ('line', {'length': 0.05}),
        ('arc', {'radius': pin_minimum_radius, 'angle': -60.0}),
        ('line', {'length': 0.4})
    ]
    ribbon = Ribbon(cq.Workplane("YZ").workplane(offset=-pin_width/2.0 - pin_group_width/2.0), p_list)
    pin = ribbon.drawRibbon().extrude(pin_width)
    return pin
def generate_2_contact_group(params):
    pin_y_pitch=params.pin_y_pitch
    foot_height = seriesParams.foot_height
    pin_thickness = seriesParams.pin_thickness
    pin_width=seriesParams.pin_width
    y_offset = -(2*pin_y_pitch)
    c_list = [
        ('start', {'position': (pin_y_pitch, foot_height), 'direction': 90.0, 'width':pin_thickness}),
        ('line', {'length': 4.5}),
        ('arc', {'radius': 0.2, 'angle': 35.0}),
        ('line', {'length': 3}),
        ('arc', {'radius': 2.0, 'angle': -70.0}),
        ('line', {'length': 2}),
        ('arc', {'radius': 0.2, 'angle': 35.0}),
        ('line', {'length': 2.8}),
    ]
    ribbon = Ribbon(cq.Workplane("YZ").workplane(offset=-pin_width/2.0), c_list)
    contact1 = ribbon.drawRibbon().extrude(pin_width)
    contact2 = contact1.mirror("XZ")
    contact1 = contact1.union(contact2).translate((0,-3*pin_y_pitch/2.0,0))
    return contact1
def generate_contact(calc_dim):
    pin_group_width = calc_dim.pin_group_width
    pin_width = series_params.pin_width
    pin_thickness = series_params.pin_thickness
    pin_minimum_radius = series_params.pin_minimum_radius
    pitch = series_params.pitch
    pin_y_offset = series_params.pin_y_offset
    body_width = series_params.body_width
    hole_length = series_params.hole_length - 0.02
    hole_offset = series_params.hole_offset
    slot_height = series_params.slot_height
    c1_list = [('start', {
        'position': ((-body_width / 2 - pin_y_offset, pin_thickness / 2.0)),
        'direction':
        0.0,
        'width':
        pin_thickness
    }), ('line', {
        'length': pin_y_offset
    }), ('arc', {
        'radius': pin_minimum_radius,
        'angle': 60.0
    }), ('line', {
        'length': 0.05
    }), ('arc', {
        'radius': pin_minimum_radius,
        'angle': -60.0
    }), ('line', {
        'length': 0.8
    }), ('arc', {
        'radius': pin_minimum_radius,
        'angle': -45.0
    }), ('arc', {
        'radius': pin_minimum_radius,
        'angle': 45.0
    }), ('line', {
        'length': 0.63
    }), ('arc', {
        'radius': 0.15,
        'angle': 95.0
    }), ('line', {
        'length': 0.5
    }), ('arc', {
        'radius': 0.1,
        'angle': 85.0
    })]
    ribbon = Ribbon(
        cq.Workplane("YZ").workplane(offset=-pin_width / 2.0 -
                                     pin_group_width / 2.0), c1_list)
    contact1 = ribbon.drawRibbon().extrude(pin_width)
    c2_list = [('start', {
        'position': ((-hole_offset - hole_length / 2.0 + pin_thickness / 2.0,
                      slot_height - pin_minimum_radius - pin_thickness / 2.0)),
        'direction':
        90.0,
        'width':
        pin_thickness
    }), ('arc', {
        'radius': pin_minimum_radius,
        'angle': -90.0
    }),
               ('line', {
                   'length':
                   hole_length - 2.0 * pin_minimum_radius - pin_thickness
               }), ('arc', {
                   'radius': pin_minimum_radius,
                   'angle': -90.0
               }), ('line', {
                   'length': slot_height - 0.32
               }), ('arc', {
                   'radius': pin_minimum_radius,
                   'angle': 90.0
               }), ('line', {
                   'length': 0.29
               }), ('arc', {
                   'radius': 0.1,
                   'angle': 90.0
               }), ('line', {
                   'length': 0.45
               }), ('arc', {
                   'radius': 0.1,
                   'angle': -90.0
               })]
    ribbon = Ribbon(
        cq.Workplane("YZ").workplane(offset=-pin_width / 2.0 -
                                     pin_group_width / 2.0), c2_list)
    contact2 = ribbon.drawRibbon().extrude(pin_width)
    contact1 = contact1.union(contact2)
    return contact1