Method: RADMesh::STL#scale_versor!

Defined in:
lib/radmesh/stl.rb

#scale_versor!(*args) ⇒ STL

Note:

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

Scale the mesh by the given versor.

This scales the mesh in different dimensions.

Parameters:

  • args (Array<Float>)

    3 items array with scale factors

  • args (Float, Float, Float)

    3 floats with scale factors

  • args (Object)

    object responding to .x, .y and .z

  • args (Hash)

    hash with :x, :y and :z (some can be omitted to use 1 as default)

Returns:

  • (STL)

    returns itself

Raises:

  • (ArgumentError)

    when the arguments cannot be parsed


410
411
412
413
414
415
416
417
# File 'lib/radmesh/stl.rb', line 410

def scale_versor!(*args)
  vec = self.class.vector_probe args, 1
  FFI::MemoryPointer.new(:float, 3) do |p|
    p.write_array_of_float(vec)
    CADMesh.stl_scale_versor(@stl_ptr, p)
  end
  self
end