class Shape def component( splitType, position, rotation, scope ) end end class Box < Shape def componentBottom( position, rotation, scope ) SubShape.new( Rectangle, position, rotation, Scope.new(scope.x,scope.y,0) ) end def component( splitType, position, rotation, scope ) [ componentBottom( position, rotation, scope ) ] end end class Cylinder < Shape end class Component < GenerativePart attr_accessor :splitType attr_accessor :ids def initialize( splitType, ids ) self.splitType = splitType self.ids = ids end def apply( shapeType, position, rotation, scope ) subNode = [] shapeType.component( splitType, position, rotation, scope ).each{ |subShape| if ids != [] then id = ids.shift() end subNode << Node.new( id, nil, subShape.shapeType, subshape.position, subShape.rotation, subShape.scope ) } end end