Class Material

Hierarchy (view full)

Constructors

Properties

ambientColor: number[]
diffuseColor: number[]
disableLighting: boolean
emissionColor: number[]
fresnelIndexOfRefraction: number

Gets or sets the Fresnel index of refraction of the material, default is 1.56

fresnelReflections: boolean

Gets or sets if Fresnel reflections are used.

id: string

Gets or sets the ID of the current instance.

indexOfRefraction: number

Gets or sets the index of refraction of the material, generally

= 1.0 (speed of light in vacuum)/(speed of light in material)

isSystemComponent: boolean

True if this model component is a system constant. An incomplete list of system constant model components is below:ON_ModelComponent::Unset ON_InstanceDefinition::Empty ON_Linetype::UnsetON_Linetype::ContinuousON_Linetype::ByLayerON_Linetype::ByParent ON_Layer::UnsetON_Layer::Default ON_TextStyle::UnsetON_TextStyle::DefaultON_TextStyle::ByLayerON_TextStyle::ByParent ON_DimStyle::UnsetON_DimStyle::DefaultON_DimStyle::DefaultInchDecimalON_DimStyle::DefaultInchFractionalON_DimStyle::DefaultFootInchArchitectureON_DimStyle::DefaultMillimeterSmallON_DimStyle::DefaultMillimeterLargeON_DimStyle::DefaultMillimeterArchitecture

isValid: boolean

Tests an object to see if it is valid.

isValidWithLog: [boolean, string]

...

name: string
previewColor: number[]

Very simple preview color function for GUIs.

reflectionColor: number[]
reflectionGlossiness: number

Gets or sets the reflection glossiness.

reflectivity: number

Gets or sets how reflective a material is, 0f is no reflection 1f is 100% reflective.

refractionGlossiness: number

Gets or sets the refraction glossiness.

renderMaterialInstanceId: string
renderPlugInId: string

The Id of the RenderPlugIn that is associated with this material.

shine: number

Gets or sets the shine factor of the material.

specularColor: number[]
transparency: number

Gets or sets the transparency of the material (0.0 = opaque to 1.0 = transparent)

transparentColor: number[]
userStringCount: number

Gets the amount of user strings.

Methods

  • Parameters

    • currentRemainder: number

      The current remainder value.

    Returns number

    The updated remainder value.

    Description

    Increments the Cyclic Redundancy Check value by this instance.

  • Returns void

    Description

    Set material to default settings.

  • Returns Texture

    A texture; or null if no bump texture has been added to this material.

    Description

    Gets the bump texture of this material.

  • 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.

  • ...

    Parameters

    • filename: string

    Returns boolean

  • ...

    Parameters

    • filename: string

    Returns boolean

  • ...

    Parameters

    • filename: string

    Returns boolean

  • ...

    Parameters

    • filename: string

    Returns boolean

  • 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

    • 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