Light

class rhino3dm.Light
Light()

Light constructor

IsEnabled

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

LightStyle

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

IsPointLight

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

IsDirectionalLight

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

IsSpotLight

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

IsLinearLight

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

IsRectangularLight

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

Location

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

Direction

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

PerpendicularDirection

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

Intensity

float: Gets or sets the light intensity.

PowerWatts

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

PowerLumens

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

PowerCandela

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

Ambient

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

Diffuse

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

Specular

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

AttenuationVector

rhino3dm.Vector3d: Gets or Sets the attenuation vector.

SpotAngleRadians

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

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.

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.

Length

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

Width

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

ShadowIntensity

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

Name

str: Gets or sets the spot light name.

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.

Parameters:
  • a0 (float) – The new constant attenuation divisor term.

  • a1 (float) – The new reverse linear attenuation divisor term.

  • a2 (float) – The new reverse quadratic attenuation divisor term.

Return type:

void

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.

Parameters:

d (float) – The distance to evaluate.

Returns:

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

Return type:

float

GetSpotLightRadii()

Gets the spot light radii.

Returns:

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.

Return type:

(bool, float, float)