ShootRay

Shoots a ray at a collection of surfaces.

Syntax

rhinoscriptsyntax.ShootRay (surface_ids, start_point, direction, reflections=10)

rhinoscript.surface.ShootRay (surface_ids, start_point, direction, reflections=10)

Parameters

surface_ids

Required.  Guid or list of guids.  The identifiers of one or more reflecting surface and polysurface objects.

start_point

Required.  A 3-D point identifying the starting point of the ray.

direction

Required.  A 3-D vector identifying the direction of the ray.

reflections

Optional.  Number.  The maximum number of times the ray will be reflected.  The default is 10 reflections.

Returns

List

A list of 3-D points identifying the points of reflection.

None

If not successful, or on error.

Example

import rhinoscriptsyntax as rs

def TestRayShooter():

    corners = []

    corners.append((0,0,0))

    corners.append((10,0,0))

    corners.append((10,10,0))

    corners.append((0,10,0))

    corners.append((0,0,10))

    corners.append((10,0,10))

    corners.append((10,10,10))

    corners.append((0,10,10))

    box = rs.AddBox(corners)

    dir = 10,7.5,7

    reflections = rs.ShootRay(box, (0,0,0), dir)

    rs.AddPolyline( reflections )

    rs.AddPoints( reflections )

 

TestRayShooter()

 

Also See

IsPolysurface

IsSurface