Skip to content

editorGlobalsAssetRotationHelper

Class: AssetRotationHelper

Analyzes an asset and determines what rotations users could (usefully) perform on it. An asset may have multiple rotation origins, which may not necessarily map to an asset's connector.

Hierarchy

  • AssetRotationHelper

Index

Constructors

Properties

Methods

Constructors

Protected constructor

+ new AssetRotationHelper(asset: MakerAsset, anchor: IOrientedPositioningAnchor): AssetRotationHelper

Defined in src/model/data/Concepts/MakerAsset/AssetRotationHelper.ts:44

You should use AssetRotationHelper.getPossibleRotations() to retrieve instances. ToDo: define interface on new asset branch depending what knowledge is needed

Parameters:

Name Type Description
asset MakerAsset the asset to be rotated
anchor IOrientedPositioningAnchor the anchor to be used for the rotation (as an asset may use multiple anchors)

Returns: AssetRotationHelper

Properties

Private anchorToBeUsed

anchorToBeUsed: IOrientedPositioningAnchor

Defined in src/model/data/Concepts/MakerAsset/AssetRotationHelper.ts:44


Private asset

asset: MakerAsset

Defined in src/model/data/Concepts/MakerAsset/AssetRotationHelper.ts:42

Methods

getAngle

getAngle(): number

Defined in src/model/data/Concepts/MakerAsset/AssetRotationHelper.ts:60

Returns: number

a user-readable rotation in radians


getReferenceTransforms

getReferenceTransforms(): Transforms

Defined in src/model/data/Concepts/MakerAsset/AssetRotationHelper.ts:78

Returns the transforms (assembly space) in which the rotation lies in. For interaction, one can assume that the rotation angle can be mapped to a around-z-axis-rotation in the local coordinate system, with the angle's value being the relative rotation delta to the x=1 vector. Thus, the coordinate system stays the same when updating the angle.

Returns: Transforms


setAngle

setAngle(newAngle: number): void

Defined in src/model/data/Concepts/MakerAsset/AssetRotationHelper.ts:68

Updates the user-readable rotation specified by getAngle()

Parameters:

Name Type Description
newAngle number the new angle to be set, in radians

Returns: void


Static getPossibleRotations

getPossibleRotations(asset: MakerAsset): AssetRotationHelper[]

Defined in src/model/data/Concepts/MakerAsset/AssetRotationHelper.ts:13

Parameters:

Name Type
asset MakerAsset

Returns: AssetRotationHelper[]