Example #1
0
def Curve_Leg6(R, A2, i, step, date):
    Angle = A2 / 180 * math.pi
    if (R < -abs(Xb)):
        R = -R
        q1 = math.atan(-Yc / (R + Xc))
        r1 = math.sqrt((R + Xc)**2 + Yc**2)
        x0 = r1 * math.cos(q1 - Angle / 2) - R
        y0 = -r1 * math.sin(q1 - Angle / 2)
        z0 = Zc
        x1 = r1 * math.cos(q1 + Angle / 2) - R
        y1 = -r1 * math.sin(q1 + Angle / 2)
        z1 = Zc
        stepcut.StepCut_Leg6(x0, y0, z0, x1, y1, z1, i, step, date)
    elif ((R > -abs(Xb)) and (R < 0)):
        R = -R
        La = math.sqrt((Xc + R)**2 + Yc**2)
        Lb = math.sqrt(Xc**2 + Yc**2)
        q1 = math.acos((R**2 + La**2 - Lb**2) / (2 * La * R))
        x0 = La * math.cos(q1 - Angle / 2) - R
        y0 = -La * math.sin(q1 - Angle / 2)
        z0 = Zc
        x1 = La * math.cos(q1 + Angle / 2) - R
        y1 = -La * math.sin(q1 + Angle / 2)
        z1 = Zc
        stepcut.StepCut_Leg6(x0, y0, z0, x1, y1, z1, i, step, date)
    elif (R == 0):
        q1 = math.pi + math.atan(Yc / Xc)
        r1 = math.sqrt(Yc**2 + Xc**2)
        x0 = r1 * math.cos(q1 + Angle / 2)
        y0 = r1 * math.sin(q1 + Angle / 2)
        z0 = Zc
        x1 = r1 * math.cos(q1 - Angle / 2)
        y1 = r1 * math.sin(q1 - Angle / 2)
        z1 = Zc
        stepcut.StepCut_Leg6(x0, y0, z0, x1, y1, z1, i, step, date)
    elif ((R > 0) and (R < abs(Xb))):
        La = math.sqrt((-Xc + R)**2 + Yc**2)
        Lb = math.sqrt(Xc**2 + Yc**2)
        q1 = math.acos((R**2 + La**2 - Lb**2) / (2 * La * R))
        x0 = -La * math.cos(q1 - Angle / 2) + R
        y0 = -La * math.sin(q1 - Angle / 2)
        z0 = Zc
        x1 = -La * math.cos(q1 + Angle / 2) + R
        y1 = -La * math.sin(q1 + Angle / 2)
        z1 = Zc
        stepcut.StepCut_Leg6(x0, y0, z0, x1, y1, z1, i, step, date)
    else:
        q1 = math.atan(-Yc / (R - Xc))
        r1 = math.sqrt((R - Xc)**2 + (Yc)**2)
        x0 = -r1 * math.cos(q1 - Angle / 2) + R
        y0 = -r1 * math.sin(q1 - Angle / 2)
        z0 = Zc
        x1 = -r1 * math.cos(q1 + Angle / 2) + R
        y1 = -r1 * math.sin(q1 + Angle / 2)
        z1 = Zc
        stepcut.StepCut_Leg6(x0, y0, z0, x1, y1, z1, i, step, date)
def shrinkage_Leg6(L,A1,i,step,date):
    Angle = A1/180*math.pi
    x0 = L/2*math.cos(Angle)+Xc
    y0 = L/2*math.sin(Angle)+Yc
    z0 = Zc
    x1 = -L/2*math.cos(Angle)+Xc
    y1 = -L/2*math.sin(Angle)+Yc
    z1 = Zc
    stepcut.StepCut_Leg6(x0,y0,z0,x1,y1,z1,i,step,date)
def straight_Leg6(L,A1,i,step,date):
    Angle = A1/180*math.pi
    x0 = L/2*math.cos(Angle)+Xf
    y0 = L/2*math.sin(Angle)+Yf
    z0 = Zf
    x1 = -L/2*math.cos(Angle)+Xf
    y1 = -L/2*math.sin(Angle)+Yf
    z1 = Zf
    stepcut.StepCut_Leg6(x0,y0,z0,x1,y1,z1,i,step,date)