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

#method_missing, #save, #walk_tree, #walk_tree_classes

Constructor Details

#initialize(*list) ⇒ CSGModelling

Returns a new instance of CSGModelling.



281
282
283
284
# File 'lib/crystalscad/CrystalScad.rb', line 281

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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class CrystalScad::CrystalScadObject

Instance Method Details

#to_rubyscadObject



286
287
288
289
290
291
292
293
294
295
296
297
298
# File 'lib/crystalscad/CrystalScad.rb', line 286

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