Class: SolidRuby::Transformations::Translate
- Inherits:
-
Transformation
- Object
- Transformation
- SolidRuby::Transformations::Translate
- Defined in:
- lib/solidruby/transformations/translate.rb
Instance Attribute Summary
Attributes inherited from Transformation
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Translate
constructor
A new instance of Translate.
- #to_rubyscad ⇒ Object
Methods inherited from Transformation
Constructor Details
#initialize(args = {}) ⇒ Translate
Returns a new instance of Translate.
19 20 21 22 23 24 |
# File 'lib/solidruby/transformations/translate.rb', line 19 def initialize(args={}) super(args) @x = args[:x] || 0 @y = args[:y] || 0 @z = args[:z] || 0 end |
Instance Method Details
#to_rubyscad ⇒ Object
26 27 28 29 30 |
# File 'lib/solidruby/transformations/translate.rb', line 26 def to_rubyscad #ignore empty transformations return '' if @x == 0 && @y == 0 && @z == 0 RubyScadBridge.new.translate({x: @x, y: @y, z: @z}).delete('"') end |