def Curve_Leg3(R, A2, i, step, date): Angle = A2 / 180 * math.pi if (R < -abs(Xb)): R = -R q1 = math.atan(-Yd / (R + Xd)) r1 = math.sqrt((R + Xd)**2 + (Yd)**2) x0 = r1 * math.cos(q1 - Angle / 2) - R y0 = -r1 * math.sin(q1 - Angle / 2) z0 = Zd x1 = r1 * math.cos(q1 + Angle / 2) - R y1 = -r1 * math.sin(q1 + Angle / 2) z1 = Zd stepcut.StepCut_Leg3(x0, y0, z0, x1, y1, z1, i, step, date) elif ((R > -abs(Xb)) and (R < 0)): R = -R La = math.sqrt((Xd + R)**2 + Yd**2) Lb = math.sqrt(Xd**2 + Yd**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 = Zd x1 = La * math.cos(q1 + Angle / 2) - R y1 = -La * math.sin(q1 + Angle / 2) z1 = Zd stepcut.StepCut_Leg3(x0, y0, z0, x1, y1, z1, i, step, date) elif (R == 0): q1 = -math.atan(-Yd / Xd) r1 = math.sqrt(Yd**2 + Xd**2) x0 = r1 * math.cos(q1 + Angle / 2) y0 = r1 * math.sin(q1 + Angle / 2) z0 = Zd x1 = r1 * math.cos(q1 - Angle / 2) y1 = r1 * math.sin(q1 - Angle / 2) z1 = Zd stepcut.StepCut_Leg3(x0, y0, z0, x1, y1, z1, i, step, date) elif ((R > 0) and (R < abs(Xb))): La = math.sqrt((Xd - R)**2 + Yd**2) Lb = math.sqrt(Xd**2 + Yd**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 = Zd x1 = -La * math.cos(q1 + Angle / 2) + R y1 = -La * math.sin(q1 + Angle / 2) z1 = Zd stepcut.StepCut_Leg3(x0, y0, z0, x1, y1, z1, i, step, date) else: q1 = math.atan(-Yd / (R - Xd)) r1 = math.sqrt((R - Xd)**2 + (Yd)**2) x0 = -r1 * math.cos(q1 - Angle / 2) + R y0 = -r1 * math.sin(q1 - Angle / 2) z0 = Zd x1 = -r1 * math.cos(q1 + Angle / 2) + R y1 = -r1 * math.sin(q1 + Angle / 2) z1 = Zd stepcut.StepCut_Leg3(x0, y0, z0, x1, y1, z1, i, step, date)
def shrinkage_Leg3(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_Leg3(x0,y0,z0,x1,y1,z1,i,step,date)
def straight_Leg3(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_Leg3(x0,y0,z0,x1,y1,z1,i,step,date)