Class: SolidRuby::Primitives::Render

Inherits:
Primitive show all
Defined in:
lib/solidruby/primitives/render.rb

Instance Attribute Summary

Attributes inherited from SolidRubyObject

#attributes, #children, #siblings, #transformations

Instance Method Summary collapse

Methods inherited from SolidRubyObject

#&, alias_attr, #debug, #debug?, #mirror, #place, #rotate, #rotate_around, #save, #scale, #translate, #union, #walk_tree, #walk_tree_classes

Constructor Details

#initialize(object, attr = {}) ⇒ Render

Returns a new instance of Render.



20
21
22
23
24
25
# File 'lib/solidruby/primitives/render.rb', line 20

def initialize(object, attr={})
  @operation = 'render'
  @children = [object]

  super(attr)
end

Instance Method Details

#to_rubyscadObject



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/solidruby/primitives/render.rb', line 27

def to_rubyscad
  ret = RubyScadBridge.new.render(@attributes) + "{\n"

  @children ||= []
  @children.each do |child|
    begin
      ret += child.walk_tree
    rescue NoMethodError
    end
  end
  ret += '}'
end