Class: Lightwave::LightwaveObject::Polygons

Inherits:
Object
  • Object
show all
Defined in:
lib/lightwave.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePolygons

Returns a new instance of Polygons.



334
335
336
337
# File 'lib/lightwave.rb', line 334

def initialize
  @surface_groups = Hash.new(){|h,k| h[k] = []}
  @faces = []
end

Instance Attribute Details

#bonesObject

Returns the value of attribute bones.



331
332
333
# File 'lib/lightwave.rb', line 331

def bones
  @bones
end

#curvesObject

Returns the value of attribute curves.



328
329
330
# File 'lib/lightwave.rb', line 328

def curves
  @curves
end

#facesObject

Returns the value of attribute faces.



327
328
329
# File 'lib/lightwave.rb', line 327

def faces
  @faces
end

#latestObject

Returns the value of attribute latest.



332
333
334
# File 'lib/lightwave.rb', line 332

def latest
  @latest
end

#metaballsObject

Returns the value of attribute metaballs.



330
331
332
# File 'lib/lightwave.rb', line 330

def metaballs
  @metaballs
end

#patchesObject

Returns the value of attribute patches.



329
330
331
# File 'lib/lightwave.rb', line 329

def patches
  @patches
end

#surface_groupsObject

Returns the value of attribute surface_groups.



333
334
335
# File 'lib/lightwave.rb', line 333

def surface_groups
  @surface_groups
end

Instance Method Details

#<<(strio) ⇒ Object



338
339
340
341
342
343
344
345
346
347
348
349
# File 'lib/lightwave.rb', line 338

def <<(strio)
  label = strio.read_type
  lookup = {'FACE' => @faces, 'PTCH' => @faces}
  target = lookup[label]
  points = []
  while !strio.eof?
    poly_set = strio.read_poly_set
    points << Polygon.new(poly_set)
  end
  target.concat points
  @latest = points # Need to keep this hanging around for the surface assignments
end