Ejemplo n.º 1
0
def trim_wire(occwire, pypt1, pypt2, is_periodic=False):
    """
    This function trims the wire.
 
    Parameters
    ----------        
    occwire : OCCwire
        The OCCwire to be fixed.
        
    pypt1 : tuple of floats
        The starting point of the trim. A pypt is a tuple that documents the xyz coordinates of a pt e.g. (x,y,z)
        
    pypt2 : tuple of floats
        The ending point of the trim. A pypt is a tuple that documents the xyz coordinates of a pt e.g. (x,y,z)
        
    is_periodic : bool, optional
        Indicates if the wire is open or close, True for close, False for open, Default = False.

    Returns
    -------
    trimmed wire : OCCwire
        The trimmed OCCwire.
    """
    gppnt1 = construct.make_gppnt(pypt1)
    gppnt2 = construct.make_gppnt(pypt2)
    trimmed = Construct.trim_wire(occwire,
                                  gppnt1,
                                  gppnt2,
                                  periodic=is_periodic)
    return trimmed
Ejemplo n.º 2
0
def trim_wire(occwire, pypt1, pypt2, is_periodic=False):
    """
    This function trims the wire.
 
    Parameters
    ----------        
    occwire : OCCwire
        The OCCwire to be fixed.
        
    pypt1 : tuple of floats
        The starting point of the trim. A pypt is a tuple that documents the xyz coordinates of a pt e.g. (x,y,z)
        
    pypt2 : tuple of floats
        The ending point of the trim. A pypt is a tuple that documents the xyz coordinates of a pt e.g. (x,y,z)
        
    is_periodic : bool, optional
        Indicates if the wire is open or close, True for close, False for open, Default = False.

    Returns
    -------
    trimmed wire : OCCwire
        The trimmed OCCwire.
    """
    gppnt1 = construct.make_gppnt(pypt1)
    gppnt2 = construct.make_gppnt(pypt2)
    trimmed = Construct.trim_wire(occwire, gppnt1, gppnt2, periodic= is_periodic )
    return trimmed
Ejemplo n.º 3
0
def trim_wire(occ_wire, shapeLimit1, shapeLimit2, is_periodic=False):
    '''
    occwire: wire to be trimmed
    type: occwire
    
    shapeLimit1: the 1st point where to cut the wire
    type: tuple, e.g. (0,1,2.5)
    
    shapeLimit1: the 2nd point where to cut the wire
    type: tuple, e.g. (0,1,2.5)
    
    is_periodic: indicate if the wire is open or close, true for close, false for open
    type: bool, e.g. True or False
    '''

    trimmed = Construct.trim_wire(occ_wire,
                                  shapeLimit1,
                                  shapeLimit2,
                                  periodic=is_periodic)
    return trimmed