Light

Light

Represents a light that shines in the modeling space.

Constructor

new Light()

Extends

Members

ambient :System.Drawing.Color

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

attenuationVector :Array.<x, y, z>

Gets or Sets the attenuation vector.
Type:
  • Array.<x, y, z>

diffuse :System.Drawing.Color

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

direction :Array.<x, y, z>

Gets or sets the vector direction of the camera.
Type:
  • Array.<x, y, z>

hasBrepForm :bool

Inherited From:
Returns true if the Brep.TryConvertBrep function will be successful for this object
Type:
  • bool

hotSpot :double

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.
Type:
  • double

intensity :double

Gets or sets the light intensity.
Type:
  • double

isDeformable :bool

Inherited From:
true if object can be accurately modified with "squishy" transformations like projections, shears, and non-uniform scaling.
Type:
  • bool

isDirectionalLight :bool

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

isEnabled :bool

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

isLinearLight :bool

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

isPointLight :bool

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

isRectangularLight :bool

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

isSpotLight :bool

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

isValid :bool

Inherited From:
Tests an object to see if it is valid.
Type:
  • bool

length :Array.<x, y, z>

Gets or sets the height in linear and rectangular lights. (ignored for non-linear/rectangular lights.)
Type:
  • Array.<x, y, z>

lightStyle :LightStyle

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

location :Array.<x, y, z>

Gets or sets the light or 3D position or location.
Type:
  • Array.<x, y, z>

name :string

Gets or sets the spot light name.
Type:
  • string

objectType :ObjectType

Inherited From:
Useful for switch statements that need to differentiate between basic object types like points, curves, surfaces, and so on.
Type:
  • ObjectType

perpendicularDirection :Array.<x, y, z>

Gets a perpendicular vector to the camera direction.
Type:
  • Array.<x, y, z>

powerCandela :double

Gets or sets the light power in candelas (cd).
Type:
  • double

powerLumens :double

Gets or sets the light power in lumens (lm).
Type:
  • double

powerWatts :double

Gets or sets the light power in watts (W).
Type:
  • double

shadowIntensity :double

Gets or sets the shadow intensity for the light.
Type:
  • double

specular :System.Drawing.Color

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

spotAngleRadians :double

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

spotExponent :double

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.
Type:
  • double

userStringCount

Inherited From:

width :Array.<x, y, z>

Gets or sets the width in linear and rectangular lights. (ignored for non-linear/rectangular lights.)
Type:
  • Array.<x, y, z>

Methods

duplicate() → {GeometryBase}

Inherited From:
Constructs a deep (full) copy of this object.
Returns:
An object of the same type as this, with the same properties and behavior.
Type
GeometryBase

encode()

Inherited From:
...

getAttenuation(d) → {double}

Gets the attenuation settings (ignored for "directional" and "ambient" lights). attenuation = 1/(a0 + d*a1 + d^2*a2) where d = distance to light.
Parameters:
Name Type Description
d double The distance to evaluate.
Returns:
0 if a0 + d*a1 + d^2*a2 <= 0.
Type
double

getBoundingBox(plane) → {Array}

Inherited From:
Aligned Bounding box solver. Gets the plane aligned bounding box.
Parameters:
Name Type Description
plane Plane Orientation plane for BoundingBox.
Returns:
[BoundingBox, Box]
  • (BoundingBox) A BoundingBox in plane coordinates.
  • (Box) Aligned box in World coordinates.
Type
Array

getUserString()

Inherited From:
...

getUserStrings()

Inherited From:
...

makeDeformable() → {bool}

Inherited From:
If possible, converts the object into a form that can be accurately modified with "squishy" transformations like projections, shears, an non-uniform scaling.
Returns:
false if object cannot be converted to a deformable object. true if object was already deformable or was converted into a deformable object.
Type
bool

rdkXml()

Inherited From:
...

rotate(angleRadians, rotationAxis, rotationCenter) → {bool}

Inherited From:
Rotates the object about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule).
Parameters:
Name Type Description
angleRadians double Angle of rotation in radians.
rotationAxis Array.<x, y, z> Direction of the axis of rotation.
rotationCenter Array.<x, y, z> Point on the axis of rotation.
Returns:
true if geometry successfully rotated.
Type
bool

scale(scaleFactor) → {bool}

Inherited From:
Scales the object by the specified factor. The scale is centered at the origin.
Parameters:
Name Type Description
scaleFactor double The uniform scaling factor.
Returns:
true if geometry successfully scaled.
Type
bool

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:
Name Type Description
a0 double The new constant attenuation divisor term.
a1 double The new reverse linear attenuation divisor term.
a2 double The new reverse quadratic attenuation divisor term.

setUserString()

Inherited From:
...

toJSON()

Inherited From:
Create a JSON string representation of this object

transform(xform) → {bool}

Inherited From:
Transforms the geometry. If the input Transform has a SimilarityType of OrientationReversing, you may want to consider flipping the transformed geometry after calling this function when it makes sense. For example, you may want to call Flip() on a Brep after transforming it.
Parameters:
Name Type Description
xform Transform Transformation to apply to geometry.
Returns:
true if geometry successfully transformed.
Type
bool

translate(translationVector) → {bool}

Inherited From:
Translates the object along the specified vector.
Parameters:
Name Type Description
translationVector Array.<x, y, z> A moving vector.
Returns:
true if geometry successfully translated.
Type
bool