Method: RADMesh::STL#rotate!

Defined in:
lib/radmesh/stl.rb

#rotate!(axis, angle) ⇒ STL

Note:

There is also the same method without ! working as expected. It is not in this reference guide, because it is automatically generated.

Rotate the entire mesh about the given axis by the given number of degrees.

The rotation is counter-clockwise about the axis as seen by looking along the positive axis towards the origin.

Parameters:

  • axis (Symbol)

    :x, :y or :z

  • angle (Float)

    angle in degrees

Returns:

  • (STL)

    returns itself

Raises:

  • (ArgumentError)

    when the axis is invalid

[View source]

467
468
469
470
471
# File 'lib/radmesh/stl.rb', line 467

def rotate!(axis, angle)
  send("rotate_#{axis}!", angle)
rescue
  raise ArgumentError, "invalid axis #{axis}"
end