Class: Lightwave::LightwaveObject::Polygons
- Inherits:
-
Object
- Object
- Lightwave::LightwaveObject::Polygons
- Defined in:
- lib/lightwave.rb
Instance Attribute Summary collapse
-
#bones ⇒ Object
Returns the value of attribute bones.
-
#curves ⇒ Object
Returns the value of attribute curves.
-
#faces ⇒ Object
Returns the value of attribute faces.
-
#latest ⇒ Object
Returns the value of attribute latest.
-
#metaballs ⇒ Object
Returns the value of attribute metaballs.
-
#patches ⇒ Object
Returns the value of attribute patches.
-
#surface_groups ⇒ Object
Returns the value of attribute surface_groups.
Instance Method Summary collapse
- #<<(strio) ⇒ Object
-
#initialize ⇒ Polygons
constructor
A new instance of Polygons.
Constructor Details
#initialize ⇒ Polygons
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
#bones ⇒ Object
Returns the value of attribute bones.
331 332 333 |
# File 'lib/lightwave.rb', line 331 def bones @bones end |
#curves ⇒ Object
Returns the value of attribute curves.
328 329 330 |
# File 'lib/lightwave.rb', line 328 def curves @curves end |
#faces ⇒ Object
Returns the value of attribute faces.
327 328 329 |
# File 'lib/lightwave.rb', line 327 def faces @faces end |
#latest ⇒ Object
Returns the value of attribute latest.
332 333 334 |
# File 'lib/lightwave.rb', line 332 def latest @latest end |
#metaballs ⇒ Object
Returns the value of attribute metaballs.
330 331 332 |
# File 'lib/lightwave.rb', line 330 def @metaballs end |
#patches ⇒ Object
Returns the value of attribute patches.
329 330 331 |
# File 'lib/lightwave.rb', line 329 def patches @patches end |
#surface_groups ⇒ Object
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 |