Hide menu
Loading...
Searching...
No Matches
Instance

Defines an occurrence of part or assembly in a scene graph.

Instance contains a reference to another element part or assembly and is used to share data, e.g. two instances can share the same part adding own transformations. Instance points to a specific scene graph element configuration and may return base configuration of reference scene graph element.

Extends

Constructors

new Instance()

new Instance(reference?, transformation?, name?): Instance

Parameters

reference?

Referenced element.

null | Part | Assembly | Instance

transformation?

Transformation of the referenced element.

null | Transformation

name?

Name of the instance.

null | string

Returns

Instance

Overrides

ModelElement.constructor

Properties

material

material: null | VisualMaterial = null

The model element material. null if the element has no material (by default).

Inherited from

ModelElement.material

Accessors

id

Get Signature

get id(): bigint

Returns object id.

Returns

bigint

Inherited from

ModelElement.id


name

Get Signature

get name(): null | string

Returns name of the model element. null if the element has no name (by default).

Returns

null | string

Set Signature

set name(name): void

Sets name of the model element.

Parameters

name

Name of the model element.

null | string

Returns

void

Inherited from

ModelElement.name


reference

Get Signature

get reference(): null | ModelElement

Returns the referenced object. null if the instance does not refer to any object (by default).

Returns

null | ModelElement

Set Signature

set reference(reference): void

Sets referenced object.

  • If reference represents part or assembly or null, then sets its as this object reference.
  • If reference represents instance, then sets its reference as this object reference.
  • Otherwise nothing happens.

Parameters

reference

Referenced object.

null | ModelElement

Returns

void


transformation

Get Signature

get transformation(): Transformation

Returns the transformation matrix.

If the matrix has not been explicitly assigned, then creates and explicitly assigns an identity matrix.

Returns

Transformation

Set Signature

set transformation(transformation): void

Sets transformation matrix.

Parameters

transformation

Transformation

Transformation matrix.

Returns

void


uuid

Get Signature

get uuid(): null | `$string