Class: CrystalScad::CSGModelling

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

Direct Known Subclasses

Difference, Hull, Intersection, Union

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(*list) ⇒ CSGModelling

Returns a new instance of CSGModelling.



305
306
307
308
# File 'lib/crystalscad/CrystalScad.rb', line 305

def initialize(*list)
	@transformations = []
	@children = list
end

Instance Method Details

#to_rubyscadObject



310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/crystalscad/CrystalScad.rb', line 310

def to_rubyscad
	@children ||= []			
	ret = "#{@operation}(){"
	@children.each do |child|	
		begin
			ret +=child.walk_tree
		rescue NoMethodError	
		end
	end
	#puts @children.map{|l| l.walk_tree_classes}.inspect

	ret +="}"			
end