Class Light

Hierarchy (view full)

Constructors

Properties

ambient: object

Gets or sets the ambient color in js object format: {r:number, g:number, b:number)} where number is from 0 - 255

attenuationVector: number[]

Gets or Sets the attenuation vector.

diffuse: object

Gets or sets the diffuse color in js object format: {r:number, g:number, b:number)} where number is from 0 - 255

direction: number[]

Gets or sets the vector direction of the camera.

hasBrepForm: boolean

Returns true if the Brep.TryConvertBrep function will be successful for this object

hotSpot: number

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.

intensity: number

Gets or sets the light intensity.

isDeformable: boolean

true if object can be accurately modified with "squishy" transformations like projections, shears, and non-uniform scaling.

isDirectionalLight: boolean

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

isEnabled: boolean

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

isLinearLight: boolean

Gets a value indicating whether the light style is WorldLinear.

isPointLight: boolean

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

isRectangularLight: boolean

Gets a value indicating whether the light style is WorldRectangular.

isSpotLight: boolean

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

isValid: boolean

Tests an object to see if it is valid.

isValidWithLog: [boolean, string]

...

length: number[]

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

lightStyle: LightStyle

Gets or sets a light style on this camera.

location: number[]

Gets or sets the light or 3D position or location.

name: string

Gets or sets the spot light name.

objectType: ObjectType

Useful for switch statements that need to differentiate between basic object types like points, curves, surfaces, and so on.

perpendicularDirection: number[]

Gets a perpendicular vector to the camera direction.

powerCandela: number

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

powerLumens: number

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

powerWatts: number

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

shadowIntensity: number

Gets or sets the shadow intensity for the light.

specular: object

Gets or sets the specular color in js object format: {r:number, g:number, b:number)} where number is from 0 - 255

spotAngleRadians: number

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

spotExponent: number

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.

userStringCount: number

Gets the amount of user strings.

width: number[]

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

Methods

  • Parameters

    • d: number

      The distance to evaluate.

    Returns number

    0 if a0 + da1 + d^2a2 <= 0.

    Description

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

  • Parameters

    • accurate: boolean

      If true, a physically accurate bounding box will be computed. If not, a bounding box estimate will be computed. For some geometry types there is no difference between the estimate and the accurate bounding box. Estimated bounding boxes can be computed much (much) faster than accurate (or "tight") bounding boxes. Estimated bounding boxes are always similar to or larger than accurate bounding boxes.

    Returns BoundingBox

    The bounding box of the geometry in world coordinates or BoundingBox.Empty if not bounding box could be found.

    Description

    Bounding box solver. Gets the world axis aligned bounding box for the geometry.

  • Returns object

    [boolean, number, number] (boolean) true if operation succeeded; otherwise, false. (number) The inner radius. This out parameter is assigned during this call. (number) The outer radius. This out parameter is assigned during this call.

    Description

    Gets the spot light radii.

  • Parameters

    • key: string

      id used to retrieve the string.

    Returns string

    string associated with the key if successful. null if no key was found.

    Description

    Gets user string from this geometry.

  • Returns boolean

    false if object cannot be converted to a deformable object. true if object was already deformable or was converted into a deformable object.

    Description

    If possible, converts the object into a form that can be accurately modified with "squishy" transformations like projections, shears, an non-uniform scaling.

  • Parameters

    • angleRadians: number

      Angle of rotation in radians.

    • rotationAxis: number[]

      Direction of the axis of rotation.

    • rotationCenter: number[]

      Point on the axis of rotation.

    Returns boolean

    true if geometry successfully rotated.

    Description

    Rotates the object about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule).

  • Parameters

    • scaleFactor: number

      The uniform scaling factor.

    Returns boolean

    true if geometry successfully scaled.

    Description

    Scales the object by the specified factor. The scale is centered at the origin.

  • Parameters

    • a0: number

      The new constant attenuation divisor term.

    • a1: number

      The new reverse linear attenuation divisor term.

    • a2: number

      The new reverse quadratic attenuation divisor term.

    Returns void

    Description

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

  • Parameters

    • key: string

      id used to retrieve this string.

    • value: string

      string associated with key.

    Returns boolean

    true if successful, false if not.

    Description

    Attach a user string (key,value combination) to this geometry.

  • Parameters

    • xform: Transform

      Transformation to apply to geometry.

    Returns boolean

    true if geometry successfully transformed.

    Description

    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

    • translationVector: number[]

      A moving vector.

    Returns boolean

    true if geometry successfully translated.

    Description

    Translates the object along the specified vector.

  • Parameters

    • json: object

      A json formatted object in the following format (values are orientative):

      {
      version: 10000,
      archive3dm: 60,
      opennurbs: -1877964208,
      data: 'encoded 3dm object data'
      }

    Returns CommonObject

    Description

    Decodes a Rhino Object

Generated using TypeDoc