Announcement

Collapse
No announcement yet.

Script - show the reflection dir of a surface point

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Script - show the reflection dir of a surface point

    I have got this script several months befor at the Rhino forum. I think, some of you will like to use it.

    Copy this script to a button (Rhino 3.0)
    Code:
    ! _-Runscript (
    Sub ReflectCameraRay
    
    Dim arrPivot, strSrf, arrParam, arrNorm
    Dim strRay, strRefl
    
    strSrf=Rhino.GetObject("Select the target surface", 8, True, True)
    If IsNull(strSrf) Then
      Exit Sub
        End If
    
            arrPivot=Rhino.GetPointOnSurface(StrSrf, "Select reflection point on the target surface")
            If IsArray(arrPivot) Then
                arrParam = Rhino.SurfaceClosestPoint(strSrf, arrPivot)
                arrNorm= Rhino.SurfaceNormal(strSrf, arrParam)
                arrCam=Rhino.ViewCamera
                strRay=Rhino.addLine (arrCam, arrPivot)
                StrRefl=Rhino.RotateObject (StrRay,arrPivot,180,  arrNorm, True)
                Rhino.DeleteObject(strRay)
               
                  Else
                Exit Sub
            End If
           
    End Sub
    ReflectCameraRay
    )
    www.simulacrum.de - visualization for designer and architects
Working...
X