Skip to content

editorGlobalsPlateStack

Class: PlateStack

Hierarchy

PlateStack

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

+ new PlateStack(uid: string): PlateStack

Inherited from PlateStack.constructor

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

Parameters:

Name Type Default
uid string PseudoRandomString.generate(10)

Returns: PlateStack

Properties

Protected transforms

transforms: Transforms = new Transforms()

Inherited from PlateStack.transforms

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

Methods

addAssembly

addAssembly(assembly: Assembly): void

Inherited from PlateStack.addAssembly

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

Inherited from PlateStack.addComponent

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

Parameters:

Name Type
component AssemblyComponent

Returns: void


addModelElementSubgraph

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

Inherited from PlateStack.addModelElementSubgraph

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

Adds a subgraph of concepts to this assembly

Parameters:

Name Type Default Description
elementsToRealizers Map‹IModelElement, IModelElementRealizerIModelElement›› - 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

Inherited from PlateStack.addPhysicalObject

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


addSvgPlate

addSvgPlate(plate: SvgSurfaceDescriptor): void

Defined in src/modules/kyub.core.plateImport/src/PlateStack.ts:34

Adds an SvgSurfaceDescriptor to the stack. Its center gets aligned with the plate stack. It gets a small random translation and rotation to make the plates distinguishable. Plates are rotated 90 degrees, iff their AABB is taller than wide

Parameters:

Name Type
plate SvgSurfaceDescriptor

Returns: void


alignTo

alignTo(otherAssembly: Assembly): void

Inherited from PlateStack.alignTo

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

Inherited from PlateStack.allRealizersFinished

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

Inherited from PlateStack.areInSameSubgraph

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

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

Inherited from PlateStack.findModelElement

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›

Inherited from PlateStack.getAllHints

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(): IPublicEventEmitterInterfaceAssemblyChangeEvent

Inherited from PlateStack.getAssemblyChangeEventEmitter

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

Returns: IPublicEventEmitterInterfaceAssemblyChangeEvent


getAssemblyComponents

getAssemblyComponents(): SetAssemblyComponent

Inherited from PlateStack.getAssemblyComponents

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

Returns: SetAssemblyComponent


getComponents

getComponents(): SetComponent

Inherited from PlateStack.getComponents

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

Returns: SetComponent

all components contained in this assembly


getCompositeModel

getCompositeModel(): CompositeModel | null

Inherited from PlateStack.getCompositeModel

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

Returns: CompositeModel | null

The composite model this object belongs to


getDebugRenderingHelper

getDebugRenderingHelper(): DebugRenderingHelper | null

Inherited from PlateStack.getDebugRenderingHelper

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

Returns: DebugRenderingHelper | null


getHint

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

Inherited from PlateStack.getHint

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

Inherited from PlateStack.getLocalAABB

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

Returns: AABB | null


getLocalPoints

getLocalPoints(): Vector3[]

Inherited from PlateStack.getLocalPoints

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

Returns: Vector3[]


getModelElements

getModelElements(): SetIModelElement

Inherited from PlateStack.getModelElements

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

Returns: SetIModelElement


getModelElementsByType

getModelElementsByTypeT›(type: Constructor‹T›): T[]

Inherited from PlateStack.getModelElementsByType

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

Inherited from PlateStack.getParent

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

Parent is world, so it will return null

Returns: ITransformable | null


getPhysEngineBody

getPhysEngineBody(): any

Inherited from PlateStack.getPhysEngineBody

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

Returns: any

The body that represents this assembly in the physics engine


getPhysicalObjects

getPhysicalObjects(): SetPhysicalObject

Inherited from PlateStack.getPhysicalObjects

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

Returns: SetPhysicalObject


getPhysicsTransformsDirty

getPhysicsTransformsDirty(): boolean

Inherited from PlateStack.getPhysicsTransformsDirty

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

Inherited from PlateStack.getPlateCount

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[]

Inherited from PlateStack.getPlates

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

Inherited from PlateStack.getPosition

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

getRealizerForT›(modelElement: T): IModelElementRealizer‹T›

Inherited from PlateStack.getRealizerFor

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

Inherited from PlateStack.getRotation

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

Inherited from PlateStack.getShouldMergePlates

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

Returns: boolean


getSvgPlate

getSvgPlate(index?: number): SvgSurfaceDescriptor

Defined in src/modules/kyub.core.plateImport/src/PlateStack.ts:75

Get SvgSurfaceDescriptor at the given index. This index parameter counts from the top of the stack to the bottom. If you want the top plate, you can omit index (defaults to 0). Returns undefined iff the index is out of bounds.

Parameters:

Name Type
index? number

Returns: SvgSurfaceDescriptor


getSvgPlates

getSvgPlates(): SvgSurfaceDescriptor[]

Defined in src/modules/kyub.core.plateImport/src/PlateStack.ts:66

Get all SvgSurfaceDescriptors in the stack.

Returns: SvgSurfaceDescriptor[]


getThreeNode

getThreeNode(): Object3D

Inherited from PlateStack.getThreeNode

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

Returns: Object3D


getTransforms

getTransforms(): IReadOnlyTransforms

Implementation of ITransformable

Inherited from PlateStack.getTransforms

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

Returns: IReadOnlyTransforms


getUid

getUid(): string

Inherited from PlateStack.getUid

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

Returns: string


getVisualizationTransformsDirty

getVisualizationTransformsDirty(): boolean

Inherited from PlateStack.getVisualizationTransformsDirty

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

Inherited from PlateStack.getWorldAABB

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

Returns: AABB | null


getWorldOBB

getWorldOBB(): OBB | null

Inherited from PlateStack.getWorldOBB

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

Returns: OBB | null


hasAssets

hasAssets(): boolean

Inherited from PlateStack.hasAssets

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

Inherited from PlateStack.mapAssemblyAxisToWorld

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

Inherited from PlateStack.mapAssemblyToWorld

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

Inherited from PlateStack.mapAssemblyToWorld

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‹›

Inherited from PlateStack.mapWorldAxisToAssembly

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

Inherited from PlateStack.mapWorldToAssembly

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

Inherited from PlateStack.mapWorldToAssembly

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

deprecated use transforms directly

Parameters:

Name Type
worldPoint Quaternion
targetPoint? Quaternion

Returns: Quaternion


markShapeHasChanged

markShapeHasChanged(): void

Inherited from PlateStack.markShapeHasChanged

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

Returns: void


markTransformsHaveChanged

markTransformsHaveChanged(): void

Inherited from PlateStack.markTransformsHaveChanged

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

Returns: void


needsRealizationOfModelElements

needsRealizationOfModelElements(): boolean

Inherited from PlateStack.needsRealizationOfModelElements

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›

Inherited from PlateStack.placeOnGround

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›

Inherited from PlateStack.realizeModelElementsIfNecessary

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

Inherited from PlateStack.removeComponent

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, IModelElementRealizerIModelElement››

Inherited from PlateStack.removeModelElementSubgraph

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, IModelElementRealizerIModelElement››

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

Inherited from PlateStack.removePhysicalObject

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

Inherited from PlateStack.resetPhysicsShapeDirty

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

Inherited from PlateStack.resetPhysicsTransformsDirty

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

Inherited from PlateStack.resetVisualizationTransformsDirty

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

Inherited from PlateStack.rotate

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

Inherited from PlateStack.rotateAround

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

Inherited from PlateStack.setCompositeModel

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

Inherited from PlateStack.setHint

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

Inherited from PlateStack.setLowQualityRendering

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

Inherited from PlateStack.setPhysEngineBody

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

Inherited from PlateStack.setPosition

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

Inherited from PlateStack.setRotation

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

Inherited from PlateStack.setShouldMergePlates

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

Parameters:

Name Type
value boolean

Returns: void


setThreeNode

setThreeNode(threeNode: Object3D | null): void

Inherited from PlateStack.setThreeNode

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

Parameters:

Name Type
threeNode Object3D | null

Returns: void


silence

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

Inherited from PlateStack.silence

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

Parameters:

func: function

▸ (): void

Optional args: any

Returns: void


splitOffUnconnectedPhysicalObjects

splitOffUnconnectedPhysicalObjects(): Assembly[]

Inherited from PlateStack.splitOffUnconnectedPhysicalObjects

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

Splits unconnected physical objects off this assembly

Returns: Assembly[]


toString

toString(): string

Inherited from PlateStack.toString

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

Returns: string


translate

translate(translation: Vector3): void

Inherited from PlateStack.translate

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

translates the assembly's position by translation

Parameters:

Name Type
translation Vector3

Returns: void


Static Private _getSmallRandomRotation

_getSmallRandomRotation(seed: number): Quaternion

Defined in src/modules/kyub.core.plateImport/src/PlateStack.ts:23

Parameters:

Name Type
seed number

Returns: Quaternion


Static Private _getSmallRandomTranslation

_getSmallRandomTranslation(seed: number): Vector3

Defined in src/modules/kyub.core.plateImport/src/PlateStack.ts:16

Parameters:

Name Type
seed number

Returns: Vector3


Static fromModelElementGraph

fromModelElementGraph(elementsToRealizers: Map‹IModelElement, IModelElementRealizerIModelElement››): Assembly

Inherited from PlateStack.fromModelElementGraph

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

Creates an assembly from a graph of ModelElements

Parameters:

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

Returns: Assembly