Help with Python Script from LadyBug

Hi everyone,

I am working on the scrip of a component from LadyBug and there is things that I don’t understand becaune I have never used Python and I started using Grasshopper 2 weeks ago. This is a part of the script :

intNormal = cleanBrep.ClosestPoint(intPts[-1], sc.doc.ModelAbsoluteTolerance)[5]

lastVector = rc.Geometry.Vector3d(ptList[-2] - ptList[-1]
lastVector.Unitize()

crossProductNormal = rc.Geometry.Vector3d.CrossProduct(intNormal, lastVector)

plane = rc.Geometry.Plane(intPts[-1], intNormal, crossProductNormal)

mirrorT = rc.Geometry.Transform.Mirror(intPts[-1], plane.Normal)

lastRay = rc.Geometry.Line(intPts[-1], lastBounceLen * lastVector).ToNurbsCurve()
lastRay.Transform(mirrorT)

So the code traces ray and the specular reflexion on a Brep.
I don’t understand what mirrorT is actually and what Geometry.Transform.Mirror does.

Thank you so much for your help !

Hello,
Not sure but in Python you should never

try:
    Something 
except:
    pass

Because

mirrorT is an instance of Transform
RhinoCommon.Geometry.Transform.Mirror() creates this instance object, which is later used in another object’s Transform() method as input parameter.
https://apidocs.co/apps/rhinocommon/6/T_Rhino_Geometry_Transform.htm
The sequence is just mirroring the lastRay but with python codes…