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

#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_rubyscadObject



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