import ROOT def TVector3ToPov(vec): return "<"+str(vec.X())+","+str(vec.Y())+","+str(vec.Z())+">" def TVector3ToRot(vec,dtheta=0,dphi=0): return "rotate <"+str(vec.Theta()*ROOT.TMath.RadToDeg()+dtheta)+",0,"+str(vec.Phi()*ROOT.TMath.RadToDeg()+dphi)+">" #return "rotate <"+str(vec.Theta()*ROOT.TMath.RadToDeg())+",0,0>" def TVector3ToTrans(vec): return "translate <"+str(vec.X())+","+str(vec.Y())+","+str(vec.Z())+">" def PovLine(vec1,vec2,rad,col,trans): return "cylinder {"+TVector3ToPov(vec1)+","+TVector3ToPov(vec2)+","+str(rad)+"\n texture{ pigment{ color "+str(col)+" transmit "+str(trans)+"}}}\n" def PovSphere(vec,rad,texture): texture.replace("{","{{") texture.replace("}","}}") return "sphere {{ {0},{1} \n texture {{ {2} }} }}\n".format( TVector3ToPov(vec),rad,texture )