All pastes #795850 Raw Edit

Stuff

public ruby v1 · immutable
#795850 ·published 2007-11-24 14:55 UTC
rendered paste body
class Shape	def component( splitType, position, rotation, scope )	endendclass 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 ) ]	endendclass Cylinder < Shapeendclass 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 )		}	endend