class CrystalScad::Cube
Attributes
x[RW]
y[RW]
z[RW]
Public Class Methods
new(*args)
click to toggle source
Calls superclass method
# File lib/crystalscad/CrystalScad.rb, line 97 def initialize(*args) super(args) @x,@y,@z = args[0][:size].map{|l| l.to_f} end
Public Instance Methods
center()
click to toggle source
# File lib/crystalscad/CrystalScad.rb, line 122 def center @transformations << Translate.new({x:-@x/2,y:-@y/2,z:-@z/2}) self end
center_x()
click to toggle source
# File lib/crystalscad/CrystalScad.rb, line 107 def center_x @transformations << Translate.new({x:-@x/2}) self end
center_xy()
click to toggle source
# File lib/crystalscad/CrystalScad.rb, line 102 def center_xy @transformations << Translate.new({x:-@x/2,y:-@y/2}) self end
center_y()
click to toggle source
# File lib/crystalscad/CrystalScad.rb, line 112 def center_y @transformations << Translate.new({y:-@y/2}) self end
center_z()
click to toggle source
# File lib/crystalscad/CrystalScad.rb, line 117 def center_z @transformations << Translate.new({z:-@z/2}) self end
to_rubyscad()
click to toggle source
# File lib/crystalscad/CrystalScad.rb, line 127 def to_rubyscad return RubyScadBridge.new.cube(@args) end