Light
=====

.. py:module:: rhino3dm

.. py:class:: Light

   .. py:method:: Light()

      Light constructor


   .. py:attribute:: IsEnabled

      bool: Gets or sets a value that defines if the light is turned on (true) or off (false).

   .. py:attribute:: LightStyle

      LightStyle: Gets or sets a light style on this camera.

   .. py:attribute:: IsPointLight

      bool: Gets a value indicating whether the light style
      is  CameraPoint or WorldPoint.

   .. py:attribute:: IsDirectionalLight

      bool: Gets a value indicating whether the light style
      is  CameraDirectional or WorldDirectional.

   .. py:attribute:: IsSpotLight

      bool: Gets a value indicating whether the light style
      is  CameraSpot or WorldSpot.

   .. py:attribute:: IsLinearLight

      bool: Gets a value indicating whether the light style
      is  WorldLinear.

   .. py:attribute:: IsRectangularLight

      bool: Gets a value indicating whether the light style
      is  WorldRectangular.

   .. py:attribute:: Location

      rhino3dm.Point3d: Gets or sets the light or 3D position or location.

   .. py:attribute:: Direction

      rhino3dm.Vector3d: Gets or sets the vector direction of the camera.

   .. py:attribute:: PerpendicularDirection

      rhino3dm.Vector3d: Gets a perpendicular vector to the camera direction.

   .. py:attribute:: Intensity

      float: Gets or sets the light intensity.

   .. py:attribute:: PowerWatts

      float: Gets or sets the light power in watts (W).

   .. py:attribute:: PowerLumens

      float: Gets or sets the light power in lumens (lm).

   .. py:attribute:: PowerCandela

      float: Gets or sets the light power in candelas (cd).

   .. py:attribute:: Ambient

      System.Drawing.Color: Gets or sets the ambient color.

   .. py:attribute:: Diffuse

      System.Drawing.Color: Gets or sets the diffuse color.

   .. py:attribute:: Specular

      System.Drawing.Color: Gets or sets the specular color.

   .. py:attribute:: AttenuationVector

      rhino3dm.Vector3d: Gets or Sets the attenuation vector.

   .. py:attribute:: SpotAngleRadians

      float: Gets or sets the spot angle in radians.
      Ignored for non-spot lights.angle = 0 to pi/2  (0 to 90 degrees).

   .. py:attribute:: SpotExponent

      float: The spot exponent varies from 0.0 to 128.0 and provides
      an exponential interface for controlling the focus or
      concentration of a spotlight (like the
      OpenGL GL_SPOT_EXPONENT parameter).  The spot exponent
      and hot spot parameters are linked; changing one will
      change the other.
      A hot spot setting of 0.0 corresponds to a spot exponent of 128.
      A hot spot setting of 1.0 corresponds to a spot exponent of 0.0.

   .. py:attribute:: HotSpot

      float: The hot spot setting runs from 0.0 to 1.0 and is used to
      provides a linear interface for controlling the focus or
      concentration of a spotlight.
      A hot spot setting of 0.0 corresponds to a spot exponent of 128.
      A hot spot setting of 1.0 corresponds to a spot exponent of 0.0.

   .. py:attribute:: Length

      rhino3dm.Vector3d: Gets or sets the height in linear and rectangular lights.
      (ignored for non-linear/rectangular lights.)

   .. py:attribute:: Width

      rhino3dm.Vector3d: Gets or sets the width in linear and rectangular lights.
      (ignored for non-linear/rectangular lights.)

   .. py:attribute:: ShadowIntensity

      float: Gets or sets the shadow intensity for the light.

   .. py:attribute:: Name

      str: Gets or sets the spot light name.

   .. py:method:: SetAttenuation(a0, a1, a2)

      Sets the attenuation settings (ignored for "directional" and "ambient" lights).
      attenuation = 1/(a0 + d*a1 + d^2*a2) where d = distance to light.

      :param float a0: The new constant attenuation divisor term.
      :param float a1: The new reverse linear attenuation divisor term.
      :param float a2: The new reverse quadratic attenuation divisor term.


      :rtype: void

   .. py:method:: GetAttenuation(d)

      Gets the attenuation settings (ignored for "directional" and "ambient" lights).
      attenuation = 1/(a0 + d*a1 + d^2*a2) where d = distance to light.

      :param float d: The distance to evaluate.

      :return: 0 if a0 + d*a1 + d^2*a2 <= 0.

      :rtype: float

   .. py:method:: GetSpotLightRadii()

      Gets the spot light radii.


      :return: tuple (bool, float, float)

         - True if operation succeeded; otherwise, false.
         - The inner radius. This out parameter is assigned during this call. \
         - The outer radius. This out parameter is assigned during this call. \

      :rtype: (bool, float, float)
