def Curve_Leg4(R, A2, i, step, date): Angle = A2 / 180 * math.pi if (R < -abs(Xb)): R = -R q1 = math.atan(Ya / (R + Xa)) r1 = math.sqrt((R + Xa)**2 + (Ya)**2) x0 = r1 * math.cos(q1 + Angle / 2) - R y0 = r1 * math.sin(q1 + Angle / 2) z0 = Za x1 = r1 * math.cos(q1 - Angle / 2) - R y1 = r1 * math.sin(q1 - Angle / 2) z1 = Za stepcut.StepCut_Leg4(x0, y0, z0, x1, y1, z1, i, step, date) elif ((R > -abs(Xb)) and (R < 0)): R = -R La = math.sqrt((Xa + R)**2 + Ya**2) Lb = math.sqrt(Xa**2 + Ya**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 = Za x1 = La * math.cos(q1 - Angle / 2) - R y1 = La * math.sin(q1 - Angle / 2) z1 = Za stepcut.StepCut_Leg4(x0, y0, z0, x1, y1, z1, i, step, date) elif (R == 0): q1 = math.pi - math.atan(Ya / -Xa) r1 = math.sqrt(Ya**2 + Xa**2) x0 = r1 * math.cos(q1 + Angle / 2) y0 = r1 * math.sin(q1 + Angle / 2) z0 = Za x1 = r1 * math.cos(q1 - Angle / 2) y1 = r1 * math.sin(q1 - Angle / 2) z1 = Za stepcut.StepCut_Leg4(x0, y0, z0, x1, y1, z1, i, step, date) elif ((R > 0) and (R < abs(Xb))): La = math.sqrt((Xa - R)**2 + Ya**2) Lb = math.sqrt(Xa**2 + Ya**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 = Za x1 = -La * math.cos(q1 - Angle / 2) + R y1 = La * math.sin(q1 - Angle / 2) z1 = Za stepcut.StepCut_Leg4(x0, y0, z0, x1, y1, z1, i, step, date) else: q1 = math.atan(Ya / (-Xa + R)) r1 = math.sqrt((R - Xa)**2 + Ya**2) x0 = -r1 * math.cos(q1 + Angle / 2) + R y0 = r1 * math.sin(q1 + Angle / 2) z0 = Za x1 = -r1 * math.cos(q1 - Angle / 2) + R y1 = r1 * math.sin(q1 - Angle / 2) z1 = Za stepcut.StepCut_Leg4(x0, y0, z0, x1, y1, z1, i, step, date)
def shrinkage_Leg4(L,A1,i,step,date): Angle = A1/180*math.pi x0 = L/2*math.cos(Angle)+Xa y0 = L/2*math.sin(Angle)+Ya z0 = Za x1 = -L/2*math.cos(Angle)+Xa y1 = -L/2*math.sin(Angle)+Ya z1 = Za stepcut.StepCut_Leg4(x0,y0,z0,x1,y1,z1,i,step,date)
def straight_Leg4(L,A1,i,step,date): Angle = A1/180*math.pi x0 = L/2*math.cos(Angle)+Xd y0 = L/2*math.sin(Angle)+Yd z0 = Zd x1 = -L/2*math.cos(Angle)+Xd y1 = -L/2*math.sin(Angle)+Yd z1 = Zd stepcut.StepCut_Leg4(x0,y0,z0,x1,y1,z1,i,step,date)