Class: CrystalScad::Render
- Inherits:
-
Primitive
- Object
- CrystalScadObject
- Primitive
- CrystalScad::Render
- Defined in:
- lib/crystalscad/CrystalScad.rb
Instance Attribute Summary
Attributes inherited from Primitive
Attributes inherited from CrystalScadObject
Instance Method Summary collapse
-
#initialize(object, attributes) ⇒ Render
constructor
A new instance of Render.
- #to_rubyscad ⇒ Object
Methods inherited from Primitive
#mirror, #rotate, #rotate_around, #scale, #transform, #translate, #union
Methods inherited from CrystalScadObject
#method_missing, #save, #walk_tree, #walk_tree_classes
Constructor Details
#initialize(object, attributes) ⇒ Render
Returns a new instance of Render.
428 429 430 431 432 |
# File 'lib/crystalscad/CrystalScad.rb', line 428 def initialize(object, attributes) @operation = "render" @children = [object] super(object, attributes) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class CrystalScad::CrystalScadObject
Instance Method Details
#to_rubyscad ⇒ Object
434 435 436 437 438 439 440 441 442 443 |
# File 'lib/crystalscad/CrystalScad.rb', line 434 def to_rubyscad layer = "" if @layer layer = ",layer=\"#{@layer}\"" end res = "" self.children.map{|l| res += l.walk_tree} res += RubyScadBridge.new.render res end |