Class: CrystalScad::Render

Inherits:
Primitive show all
Defined in:
lib/crystalscad/CrystalScad.rb

Instance Attribute Summary

Attributes inherited from Primitive

#children

Attributes inherited from CrystalScadObject

#args, #transformations

Instance Method Summary collapse

Methods inherited from Primitive

#mirror, #rotate, #rotate_around, #scale, #transform, #translate, #union

Methods inherited from CrystalScadObject

#save, #walk_tree, #walk_tree_classes

Constructor Details

#initialize(object, attributes) ⇒ Render

Returns a new instance of Render.



452
453
454
455
456
# File 'lib/crystalscad/CrystalScad.rb', line 452

def initialize(object, attributes)
	@operation = "render"
	@children = [object]
	super(object, attributes)
end

Instance Method Details

#to_rubyscadObject



458
459
460
461
462
463
464
465
466
467
# File 'lib/crystalscad/CrystalScad.rb', line 458

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