Skip to content

editor › Globals › Assembly

Class: Assembly

An assembly contains one or more PhysicalObjects that are connected to each other via Joints. An assembly has its own local coordinate system.

Hierarchy

  • Assembly

↳ PlateStack

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

+ new Assembly(uid: string): Assembly

Defined in src/model/data/Assembly.ts:172

Parameters:

Name Type Default
uid string PseudoRandomString.generate(10)

Returns: Assembly

Properties

Private Readonly assemblyChangeEventEmitter

• assemblyChangeEventEmitter: EventEmitter‹AssemblyChangeEvent› = new EventEmitter()

Defined in src/model/data/Assembly.ts:169


Private cachedLocalAABB

• cachedLocalAABB: AABB | null = null

Defined in src/model/data/Assembly.ts:171


Private changedPlateMergingState

• changedPlateMergingState: boolean = false

Defined in src/model/data/Assembly.ts:156


Private Readonly components

• components: Set‹AssemblyComponent› = new Set()

Defined in src/model/data/Assembly.ts:135


Private compositeModel

• compositeModel: CompositeModel | null = null

Defined in src/model/data/Assembly.ts:132


Private debugRenderingHelper

• debugRenderingHelper: DebugRenderingHelper = new DebugRenderingHelper(null)

Defined in src/model/data/Assembly.ts:167


Private Readonly hintManager

• hintManager: HintManager

Defined in src/model/data/Assembly.ts:172


Private Readonly hints

• hints: any

Defined in src/model/data/Assembly.ts:124


Private lowQualityRendering

• lowQualityRendering: boolean

Defined in src/model/data/Assembly.ts:163


Private Readonly modelElementRealizers

• modelElementRealizers: Map‹IModelElement, IModelElementRealizer‹IModelElement›› = new Map()

Defined in src/model/data/Assembly.ts:141


Private Readonly modelElements

• modelElements: Set‹IModelElement› = new Set()

Defined in src/model/data/Assembly.ts:138


Private Readonly modelElementsToChangeEvents

• modelElementsToChangeEvents: Map‹IModelElement, IModelElementEvent› = new Map()

Defined in src/model/data/Assembly.ts:110


Private Readonly modelElementsToTransformsChangeEvents

• modelElementsToTransformsChangeEvents: Map‹IModelElement, ITransformsChangeEvent› = new Map()

Defined in src/model/data/Assembly.ts:158


Private Readonly obb

• obb: OBB = new OBB()

Defined in src/model/data/Assembly.ts:127


Private obbValid

• obbValid: boolean = false

Defined in src/model/data/Assembly.ts:129


Private ongoingModelChangeEvents

• ongoingModelChangeEvents: number = 0

Defined in src/model/data/Assembly.ts:165


Private physEngineBody

• physEngineBody: any = null

Defined in src/model/data/Assembly.ts:120


Private Readonly physicalObjects

• physicalObjects: Set‹PhysicalObject› = new Set()

Defined in src/model/data/Assembly.ts:111


Private physicsShapeDirty

• physicsShapeDirty: boolean

Defined in src/model/data/Assembly.ts:160


Private physicsTransformsDirty

• physicsTransformsDirty: boolean = true

Defined in src/model/data/Assembly.ts:114


Private realizerPending

• realizerPending: boolean = false

Defined in src/model/data/Assembly.ts:150

Whether the started realizers' realization promises are resolved. Does not check if unrealized elements or pending element changes exist, use/see allRealizersFinished.


Private shouldMergePlates

• shouldMergePlates: boolean = true

Defined in src/model/data/Assembly.ts:155


Private threeNode

• threeNode: Object3D

Defined in src/model/data/Assembly.ts:159


Protected transforms

• transforms: Transforms = new Transforms()

Defined in src/model/data/Assembly.ts:109


Private Readonly uid

• uid: string

Defined in src/model/data/Assembly.ts:174


Private unrealizedModelElementsExist

• unrealizedModelElementsExist: boolean = false

Defined in src/model/data/Assembly.ts:144


Private visualizationShapeDirty

• visualizationShapeDirty: boolean

Defined in src/model/data/Assembly.ts:161


Private visualizationTransformsDirty

• visualizationTransformsDirty: boolean = true

Defined in src/model/data/Assembly.ts:117

Methods

Private _addModelElement

▸ _addModelElement(modelElement: IModelElement, realizer: IModelElementRealizer‹IModelElement›): void

Defined in src/model/data/Assembly.ts:1046

Parameters:

Name Type
modelElement IModelElement
realizer IModelElementRealizer‹IModelElement›

Returns: void


Private _copyBoxelQueueToAssembly

▸ _copyBoxelQueueToAssembly(newAssembly: Assembly): void

Defined in src/model/data/Assembly.ts:1178

Parameters:

Name Type
newAssembly Assembly

Returns: void


Private _copyHintsToAssembly

▸ _copyHintsToAssembly(newAssembly: Assembly): void

Defined in src/model/data/Assembly.ts:1170

Parameters:

Name Type
newAssembly Assembly

Returns: void


Private _ensureAlignmentWithAssembly

▸ _ensureAlignmentWithAssembly(otherAssembly: Assembly): void

Defined in src/model/data/Assembly.ts:1257

Parameters:

Name Type
otherAssembly Assembly

Returns: void


Private _getRelevantJoints

▸ _getRelevantJoints(object: PhysicalObject): Joint[]

Defined in src/model/data/Assembly.ts:1198

joints that are relevant in regard to this assembly - i.e. no joints that span cross assemblies

Parameters:

Name Type
object PhysicalObject

Returns: Joint[]


Private _isConnectedTo

▸ _isConnectedTo(objectA: PhysicalObject, objectB: PhysicalObject, visitedObjects: Set‹PhysicalObject›): boolean

Defined in src/model/data/Assembly.ts:1209

Parameters:

Name Type Default
objectA PhysicalObject -
objectB PhysicalObject -
visitedObjects Set‹PhysicalObject› new Set()

Returns: boolean

True if both objects are connected with joints (and over other objects). Cross-assembly joints are ignored.


Private _mapObjectToAssembly

▸ _mapObjectToAssembly(physicalObject: PhysicalObject): void

Defined in src/model/data/Assembly.ts:1249

Changes the object's global coordinates/rotation to assembly-local coordinates/rotation

Parameters:

Name Type
physicalObject PhysicalObject

Returns: void


Private _mapObjectToWorld

▸ _mapObjectToWorld(physicalObject: PhysicalObject): void

Defined in src/model/data/Assembly.ts:1235

Changes the object's assembly-local coordinates/rotation into global coordinates/rotation

Parameters:

Name Type
physicalObject PhysicalObject

Returns: void


Private _onModelElementChange

▸ _onModelElementChange(event: IModelElementEvent, emitter: IEmittingEventEmitter): void

Defined in src/model/data/Assembly.ts:1091

Parameters:

Name Type
event IModelElementEvent
emitter IEmittingEventEmitter

Returns: void


Private _onModelElementTransformsChange

▸ _onModelElementTransformsChange(event: ITransformsChangeEvent): void

Defined in src/model/data/Assembly.ts:1105

Parameters:

Name Type
event ITransformsChangeEvent

Returns: void


Private _physicalObjectJointAdd

▸ _physicalObjectJointAdd(physicalObject: PhysicalObject, joint: Joint): void

Defined in src/model/data/Assembly.ts:1115

Called if a physical object is joined with another object. If both objects do not belong to the same assembly, the other object needs to be added to this assembly.

Parameters:

Name Type
physicalObject PhysicalObject
joint Joint

Returns: void


Private _physicalObjectJointRemove

▸ _physicalObjectJointRemove(physicalObject: PhysicalObject, joint: Joint): void

Defined in src/model/data/Assembly.ts:1138

Called if a joint is removed from a physical object.

Parameters:

Name Type
physicalObject PhysicalObject
joint Joint

Returns: void


Private _removeModelElement

▸ _removeModelElement(modelElement: IModelElement, removePhysicalObjects: boolean, destroyRealizer: boolean): IModelElementRealizer | null

Defined in src/model/data/Assembly.ts:1010

Removes a IModelElement (and its IModelElementRealizer) from the assembly. If other elements depend on it, you need to take care of removing/adapting them yourself or directly use removeModelElementSubgraph().

Parameters:

Name Type Default Description
modelElement IModelElement - The model element to remove
removePhysicalObjects boolean true If physical objects should get removed too.
destroyRealizer boolean true if true, we assume that the realizer is not needed and we can destroy it

Returns: IModelElementRealizer | null

The realizer of the element. Will be destroyed


Private _resetCache

▸ _resetCache(): void

Defined in src/model/data/Assembly.ts:1268

Returns: void


Private _splitAssembly

▸ _splitAssembly(objectToSplitOff: PhysicalObject): Assembly

Defined in src/model/data/Assembly.ts:1154

Splits the specified physicalObject off of this assembly and puts it into a newly created assembly. All physicalObjects connected to objectToSplit will be moved along.

Parameters:

Name Type Description
objectToSplitOff PhysicalObject The object to remove from this assembly

Returns: Assembly


Private _transformModelElementCoordinateSystem

▸ _transformModelElementCoordinateSystem(transformsDefiningAnchors: IPositionableElementTransformsDefiner[], sourceAssembly: Assembly): void

Defined in src/model/data/Assembly.ts:1073

Transforms given anchors from the coordinate system of the old assembly to the current one

Parameters:

Name Type Description
transformsDefiningAnchors IPositionableElementTransformsDefiner[] The anchors to transform.
sourceAssembly Assembly see Assembly.addModelElementSubgraph

Returns: void


addAssembly

▸ addAssembly(assembly: Assembly): void

Defined in src/model/data/Assembly.ts:296

Add all physical objects of the given assembly to this assembly

Parameters:

Name Type
assembly Assembly

Returns: void


addComponent

▸ addComponent(component: AssemblyComponent): void

Defined in src/model/data/Assembly.ts:308

Parameters:

Name Type
component AssemblyComponent

Returns: void


addModelElementSubgraph

▸ addModelElementSubgraph(elementsToRealizers: Map‹IModelElement, IModelElementRealizer‹IModelElement››, sourceAssembly: Assembly): void

Defined in src/model/data/Assembly.ts:410

Adds a subgraph of concepts to this assembly

Parameters:

Name Type Default Description
elementsToRealizers Map‹IModelElement, IModelElementRealizer‹IModelElement›› - map of elements to their realizers If defined, coordinate systems of the concept's anchors will be transferred from the sourceAssembly to this assembly. If not, it is assumed that all anchor's transforms are already in assembly coordinates, and no transformation is performed.
sourceAssembly Assembly null -

Returns: void


addPhysicalObject

▸ addPhysicalObject(physicalObject: PhysicalObject, convertCoordinateSystems: boolean): void

Defined in src/model/data/Assembly.ts:709

Adds the specified physical object and all joined objects to this assembly and changes the object's position/rotation to local values

Parameters:

Name Type Default Description
physicalObject PhysicalObject - The physicalObject to add
convertCoordinateSystems boolean true If true, the coordinate systems will be converted as follows: - if the added object already has an assembly, the assemblies will be aligned before adding it - if this assembly is empty, it will copy the position/rotation of the new object - otherwise, the new object is mapped to world coordinates and then to assembly coordinates if false, no mapping will be performed (position and rotation are interpreted as assembly coordinates). Defaults to true.

Returns: void


alignTo

▸ alignTo(otherAssembly: Assembly): void

Defined in src/model/data/Assembly.ts:920

Translates this assembly and its objects so that the objects stay at the same world position, but the assembly has the same coordinate system as the target assembly

Parameters:

Name Type Description
otherAssembly Assembly The other assembly0

Returns: void


allRealizersFinished

▸ allRealizersFinished(): boolean

Defined in src/model/data/Assembly.ts:456

Whether all added model elements are done realizing (ie their realize promise resolved).

Returns: boolean


areInSameSubgraph

▸ areInSameSubgraph(modelElementA: IModelElement, modelElementB: IModelElement): boolean

Defined in src/model/data/Assembly.ts:397

Determines whether the two given IModelElement are in the same subgraph given the other concepts in this assembly.

Parameters:

Name Type
modelElementA IModelElement
modelElementB IModelElement

Returns: boolean


findModelElement

▸ findModelElement‹DesiredType›(desiredType: any, interactionData: IInteractionData, maxDistance: number, strategy: FindModelElementReturnStrategy): FoundModelElements‹DesiredType›

Defined in src/model/data/Assembly.ts:341

Queries the realizers of all model elements in this assembly for instances of desiredType and decides which to return

Type parameters:

▪ DesiredType

Parameters:

Name Type Default
desiredType any -
interactionData IInteractionData -
maxDistance number 20
strategy FindModelElementReturnStrategy FindModelElementReturnStrategy.BEST

Returns: FoundModelElements‹DesiredType›


getAllHints

▸ getAllHints(): Record‹string, any›

Defined in src/model/data/Assembly.ts:634

Returns the whole hints object. This must be treated as readonly

Returns: Record‹string, any›


getAssemblyChangeEventEmitter

▸ getAssemblyChangeEventEmitter(): IPublicEventEmitterInterface‹AssemblyChangeEvent›

Defined in src/model/data/Assembly.ts:182

Returns: IPublicEventEmitterInterface‹AssemblyChangeEvent›


getAssemblyComponents

▸ getAssemblyComponents(): Set‹AssemblyComponent›

Defined in src/model/data/Assembly.ts:326

Returns: Set‹AssemblyComponent›


getComponents

▸ getComponents(): Set‹Component›

Defined in src/model/data/Assembly.ts:333

Returns: Set‹Component›

all components contained in this assembly


getCompositeModel

▸ getCompositeModel(): CompositeModel | null

Defined in src/model/data/Assembly.ts:903

Returns: CompositeModel | null

The composite model this object belongs to


getDebugRenderingHelper

▸ getDebugRenderingHelper(): DebugRenderingHelper | null

Defined in src/model/data/Assembly.ts:211

Returns: DebugRenderingHelper | null


getHint

▸ getHint(key: string, defaultValue: any): any

Defined in src/model/data/Assembly.ts:613

Retrieve a hint for this object

Parameters:

Name Type Default Description
key string - The name of the hint
defaultValue any null Default value if hint is not defined Used hints: - physicsEngineBodyType (One of: Body.DYNAMIC, Body.STATIC and Body.KINEMATIC see http://schteppe.github.io/cannon.js/docs/classes/Body.html) - ignoreWindSimulation [Boolean] (if true this assembly will be ignored in the wind simulation) - fixateInPhysicsEngine [Boolean] (if true this assembly will not be moved by the physics engine) - ignoreInPhysicsEngine [Boolean] (if true this assembly will be completely ignored by the physics engine) - isPartOfBackground [Boolean] (if true, this assembly will e.g. not be serialized into the save file) - currentBoxelOperationId [Number] (maximum boxel operation counter used in this assembly) - removeCandidates [Boolean] (if true parts of baseAssembly with operationId will be removed if that operation fails) - boxelOperationRunning [Boolean] (if the assembly is currently being modified by BoxelCSG) - trussSystem [TrussSystem] (sets TrussSystem object for truss structures) - polished [Boolean] (if true, plates in this assembly will be shown with sanded sides and will be exported with elongated fingers for sanding) - initialScene [Boolean] (if true, this assembly will be considered part of the initial scene that is loaded when loading the editor. see Editor.replayInitialScript)

Returns: any


getLocalAABB

▸ getLocalAABB(): AABB | null

Defined in src/model/data/Assembly.ts:850

Returns: AABB | null


getLocalPoints

▸ getLocalPoints(): Vector3[]

Defined in src/model/data/Assembly.ts:844

Returns: Vector3[]


getModelElements

▸ getModelElements(): Set‹IModelElement›

Defined in src/model/data/Assembly.ts:357

Returns: Set‹IModelElement›


getModelElementsByType

▸ getModelElementsByType‹T›(type: Constructor‹T›): T[]

Defined in src/model/data/Assembly.ts:361

Type parameters:

▪ T: IModelElement

Parameters:

Name Type
type Constructor‹T›

Returns: T[]


getParent

▸ getParent(): ITransformable | null

Implementation of ITransformable

Defined in src/model/data/Assembly.ts:222

Parent is world, so it will return null

Returns: ITransformable | null


getPhysEngineBody

▸ getPhysEngineBody(): any

Defined in src/model/data/Assembly.ts:831

Returns: any

The body that represents this assembly in the physics engine


getPhysicalObjects

▸ getPhysicalObjects(): Set‹PhysicalObject›

Defined in src/model/data/Assembly.ts:304

Returns: Set‹PhysicalObject›


getPhysicsTransformsDirty

▸ getPhysicsTransformsDirty(): boolean

Defined in src/model/data/Assembly.ts:824

Returns: boolean

Whether this object's transforms should be considered dirty regarding its physics representation


getPlateCount

▸ getPlateCount(): number

Defined in src/model/data/Assembly.ts:528

Count all plates in this assembly (use this rather than getPlates when comparing number of plates)

Returns: number

number of plates in this assembly


getPlates

▸ getPlates(ignoredSubclasses: any[]): Plate[]

Defined in src/model/data/Assembly.ts:514

Helper method that only returns the plates contained in this assembly

Parameters:

Name Type Default Description
ignoredSubclasses any[] [] Instances of these classes will be excluded from the result

Returns: Plate[]

all plates contained in this assembly


getPosition

▸ getPosition(target: Vector3‹›): Vector3

Defined in src/model/data/Assembly.ts:229

Parameters:

Name Type Default Description
target Vector3‹› new Vector3() position of the assembly, in world space.

Returns: Vector3


getRealizerFor

▸ getRealizerFor‹T›(modelElement: T): IModelElementRealizer‹T›

Defined in src/model/data/Assembly.ts:433

Type parameters:

▪ T: IModelElement

Parameters:

Name Type
modelElement T

Returns: IModelElementRealizer‹T›

the realizer for the given model element


getRotation

▸ getRotation(target: Quaternion‹›): Quaternion

Defined in src/model/data/Assembly.ts:268

Returns the rotation of the assembly in world space

Parameters:

Name Type Default
target Quaternion‹› new Quaternion()

Returns: Quaternion


getShouldMergePlates

▸ getShouldMergePlates(): boolean

Defined in src/model/data/Assembly.ts:186

Returns: boolean


getThreeNode

▸ getThreeNode(): Object3D

Defined in src/model/data/Assembly.ts:197

Returns: Object3D


getTransforms

▸ getTransforms(): IReadOnlyTransforms

Implementation of ITransformable

Defined in src/model/data/Assembly.ts:215

Returns: IReadOnlyTransforms


getUid

▸ getUid(): string

Defined in src/model/data/Assembly.ts:178

Returns: string


getVisualizationTransformsDirty

▸ getVisualizationTransformsDirty(): boolean

Defined in src/model/data/Assembly.ts:817

Returns: boolean

Whether this object's transforms should be considered dirty regarding its visualization


getWorldAABB

▸ getWorldAABB(): AABB | null

Defined in src/model/data/Assembly.ts:879

Returns: AABB | null


getWorldOBB

▸ getWorldOBB(): OBB | null

Defined in src/model/data/Assembly.ts:861

Returns: OBB | null


hasAssets

▸ hasAssets(): boolean

Defined in src/model/data/Assembly.ts:982

Returns: boolean

true, iff this assembly contains a MakerAsset This should be removed after implementing https://gitlab.dev.kyub.io/laser-project/general-issues/-/issues/3519 But still might break afterwards with other assets


mapAssemblyAxisToWorld

▸ mapAssemblyAxisToWorld(assemblyAxis: Vector3, targetAxis?: Vector3): Vector3

Defined in src/model/data/Assembly.ts:588

Maps an axis from local coordinate system into global system (applies rotation only)

deprecated use transforms directly

Parameters:

Name Type Description
assemblyAxis Vector3 A point in assembly coordinates
targetAxis? Vector3 (optional) Vector that will receive the calculation result

Returns: Vector3


mapAssemblyToWorld

▸ mapAssemblyToWorld(assemblyPoint: ReadonlyVector3, target?: Vector3): Vector3

Defined in src/model/data/Assembly.ts:570

Maps a point from local coordinate system into global system (applies rotation and translation)

deprecated use transforms directly

Parameters:

Name Type Description
assemblyPoint ReadonlyVector3 A point in assembly coordinates
target? Vector3 (optional) Vector that will receive the calculation result

Returns: Vector3

▸ mapAssemblyToWorld(assemblyPoint: Quaternion, target?: Quaternion): Quaternion

Defined in src/model/data/Assembly.ts:572

deprecated use transforms directly

Parameters:

Name Type
assemblyPoint Quaternion
target? Quaternion

Returns: Quaternion


mapWorldAxisToAssembly

▸ mapWorldAxisToAssembly(worldAxis: ReadonlyVector3, targetAxis?: Vector3): Vector3‹›

Defined in src/model/data/Assembly.ts:560

Maps an axis from world coordinate system into the assembly local coordinate system (undo rotation only)

deprecated use transforms directly

Parameters:

Name Type Description
worldAxis ReadonlyVector3 A axis in world coordinates
targetAxis? Vector3 (optional) Vector that will receive the calculation result

Returns: Vector3‹›


mapWorldToAssembly

▸ mapWorldToAssembly(worldPoint: ReadonlyVector3, targetPoint?: Vector3): Vector3

Defined in src/model/data/Assembly.ts:542

Maps a point from world coordinate system into the assembly local coordinate system (undo rotation and translation)

deprecated use transforms directly

Parameters:

Name Type Description
worldPoint ReadonlyVector3 A point in world coordinates
targetPoint? Vector3 (optional) Vector that will receive the calculation result

Returns: Vector3

▸ mapWorldToAssembly(worldPoint: Quaternion, targetPoint?: Quaternion): Quaternion

Defined in src/model/data/Assembly.ts:544

deprecated use transforms directly

Parameters:

Name Type
worldPoint Quaternion
targetPoint? Quaternion

Returns: Quaternion


markShapeHasChanged

▸ markShapeHasChanged(): void

Defined in src/model/data/Assembly.ts:794

Returns: void


markTransformsHaveChanged

▸ markTransformsHaveChanged(): void

Defined in src/model/data/Assembly.ts:770

Returns: void


needsRealizationOfModelElements

▸ needsRealizationOfModelElements(): boolean

Defined in src/model/data/Assembly.ts:444

Whether all model elements' realizations are up to date (ie realizer.realize got called with the latest changes). Does not wait for the realization promises, use allRealizersFinished for that.

Returns: boolean


placeOnGround

▸ placeOnGround(onlyIfBelowGround: boolean): Promise‹boolean›

Defined in src/model/data/Assembly.ts:252

Move the object on the z axis to place it exactly on ground

Parameters:

Name Type Default Description
onlyIfBelowGround boolean true should this only be done if the object is below ground returns true if the placement was successful

Returns: Promise‹boolean›


realizeModelElementsIfNecessary

▸ realizeModelElementsIfNecessary(hintManager?: HintManager, skipAfterRealization?: boolean): Promise‹void›

Defined in src/model/data/Assembly.ts:464

Parameters:

Name Type Description
hintManager? HintManager -
skipAfterRealization? boolean when realizing while realizing, skip those component.afterRealization steps so they are only executed in the outermost realize call.

Returns: Promise‹void›


removeComponent

▸ removeComponent(component: AssemblyComponent): void

Defined in src/model/data/Assembly.ts:317

Parameters:

Name Type
component AssemblyComponent

Returns: void


removeModelElementSubgraph

▸ removeModelElementSubgraph(modelElement: IModelElement, removePhysicalObjects: boolean, destroyRealizer: boolean): Map‹IModelElement, IModelElementRealizer‹IModelElement››

Defined in src/model/data/Assembly.ts:375

Removes the concept and its realizer including all concepts this depends on or other concepts that depend on it. Coordinate systems are not changed, but are changed when adding IModelElements to a new assembly. note that realizer can be null. Destroy your dependencies to other modelElements before calling this when you don't want to remove them as well.

Parameters:

Name Type Default Description
modelElement IModelElement - -
removePhysicalObjects boolean true -
destroyRealizer boolean true if true we assume that the subgraph is not needed and that we can destroy the realizer. You must be sure that the realizer is not used by anyone else.

Returns: Map‹IModelElement, IModelElementRealizer‹IModelElement››

a map of model element to their realizer for all model elements of the given subgraph. Destroys the realizer.


removePhysicalObject

▸ removePhysicalObject(physicalObject: PhysicalObject, dueToMerge: boolean): void

Defined in src/model/data/Assembly.ts:644

Removes the PhysicalObject from the internal set, and changes the physical object coordinates/rotation to global ones

Parameters:

Name Type Default Description
physicalObject PhysicalObject - The physical object to remove
dueToMerge boolean false Indicates whether the removal takes place due to an assembly merge operation

Returns: void


resetPhysicsShapeDirty

▸ resetPhysicsShapeDirty(): boolean

Defined in src/model/data/Assembly.ts:808

Resets the physicsShapeDirty flag. Returns the state of the flag before reset

Returns: boolean


resetPhysicsTransformsDirty

▸ resetPhysicsTransformsDirty(): boolean

Defined in src/model/data/Assembly.ts:788

Resets the physicsShapeDirty flag. Returns the state of the flag before reset

Returns: boolean


resetVisualizationTransformsDirty

▸ resetVisualizationTransformsDirty(): boolean

Defined in src/model/data/Assembly.ts:779

Resets the visualizationShapeDirty flag. Returns the state of the flag before reset

Returns: boolean


rotate

▸ rotate(rotation: Quaternion): void

Defined in src/model/data/Assembly.ts:282

Rotates this assembly around the local origin.

Parameters:

Name Type
rotation Quaternion

Returns: void


rotateAround

▸ rotateAround(rotation: Quaternion, globalPoint: ReadonlyVector3): void

Defined in src/model/data/Assembly.ts:289

Rotates the assembly around the specified point (in world coordinates)

Parameters:

Name Type
rotation Quaternion
globalPoint ReadonlyVector3

Returns: void


setCompositeModel

▸ setCompositeModel(newCompositeModel: CompositeModel): void

Defined in src/model/data/Assembly.ts:910

Parameters:

Name Type Description
newCompositeModel CompositeModel The composite model this object belongs to

Returns: void


setHint

▸ setHint(key: string, value: any): void

Defined in src/model/data/Assembly.ts:626

Sets a hint for this object

Parameters:

Name Type Description
key string Name of the hint
value any Value for this hint

Returns: void


setLowQualityRendering

▸ setLowQualityRendering(lowQuality: boolean): void

Defined in src/model/data/Assembly.ts:895

Sets the lowQuality hint on all physical objects of this assembly.

Parameters:

Name Type Default Description
lowQuality boolean false The value to set for the lowQuality hint

Returns: void


setPhysEngineBody

▸ setPhysEngineBody(body: any): void

Defined in src/model/data/Assembly.ts:839

Sets the body that represents the assembly in the physics engine

Parameters:

Name Type Description
body any The body the physics engine body

Returns: void


setPosition

▸ setPosition(position: Vector3): void

Defined in src/model/data/Assembly.ts:236

Parameters:

Name Type Description
position Vector3 new world position of the assembly

Returns: void


setRotation

▸ setRotation(rotation: Quaternion): void

Defined in src/model/data/Assembly.ts:275

Parameters:

Name Type Description
rotation Quaternion new rotation quaternion in world space

Returns: void


setShouldMergePlates

▸ setShouldMergePlates(value: boolean): void

Defined in src/model/data/Assembly.ts:190

Parameters:

Name Type
value boolean

Returns: void


setThreeNode

▸ setThreeNode(threeNode: Object3D | null): void

Defined in src/model/data/Assembly.ts:201

Parameters:

Name Type
threeNode Object3D | null

Returns: void


silence

▸ silence(func: function, args?: any): void

Defined in src/model/data/Assembly.ts:996

Parameters:

▪ func: function

▸ (): void

▪Optional args: any

Returns: void


splitOffUnconnectedPhysicalObjects

▸ splitOffUnconnectedPhysicalObjects(): Assembly[]

Defined in src/model/data/Assembly.ts:670

Splits unconnected physical objects off this assembly

Returns: Assembly[]


toString

▸ toString(): string

Defined in src/model/data/Assembly.ts:949

Returns: string


translate

▸ translate(translation: Vector3): void

Defined in src/model/data/Assembly.ts:243

translates the assembly's position by translation

Parameters:

Name Type
translation Vector3

Returns: void


Static fromModelElementGraph

▸ fromModelElementGraph(elementsToRealizers: Map‹IModelElement, IModelElementRealizer‹IModelElement››): Assembly

Defined in src/model/data/Assembly.ts:101

Creates an assembly from a graph of ModelElements

Parameters:

Name Type Description
elementsToRealizers Map‹IModelElement, IModelElementRealizer‹IModelElement›› map of elements + their realizers

Returns: Assembly