Appearance
Transform Tools
The snaptrude.tools.transform namespace provides functions to move and rotate components.
Functions
move(components: Component[], displacement: Vector3)
Moves a list of components by a specified displacement vector.
- Parameters:
components:Component[]- The components to move.displacement:Vector3- The distance and direction to move (in project units).
moveWithAnchor(components: Component[], anchor: Vector3, target: Vector3)
Moves components from an anchor point to a target point.
- Parameters:
components:Component[]- The components to move.anchor:Vector3- The start point of the move.target:Vector3- The end point of the move.
rotate(components: Component[], angle: number, axis: Vector3, pivot: Vector3)
Rotates components around a pivot point and axis.
- Parameters:
components:Component[]- The components to rotate.angle:number- The rotation angle in radians.axis:Vector3- The axis of rotation.pivot:Vector3- The point to rotate around.