Class: Polygon

Inherits:
Shape show all
Defined in:
lib/rcad.rb

Direct Known Subclasses

Rectangle, RegularPolygon

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Shape

#*, #+, #-, #align, #back, #bbox, #bottom, #center, #cx, #cy, #cz, #extrude, #front, #left, #maxx, #maxy, #maxz, #minx, #miny, #minz, #mirror, #mirror_x, #mirror_y, #mirror_z, #move, #move_x, #move_y, #move_z, #render, #revolve, #right, #rot_x, #rot_y, #rot_z, #rotate, #scale, #scale_x, #scale_y, #scale_z, #top, #transform, #xcenter, #xsize, #ycenter, #ysize, #zcenter, #zsize, #~@

Constructor Details

#initialize(points, paths = nil) ⇒ Polygon

Returns a new instance of Polygon.



406
407
408
409
# File 'lib/rcad.rb', line 406

def initialize(points, paths=nil)
  @points = points
  @paths = paths || [(0...points.size).to_a]
end

Instance Attribute Details

#pathsObject (readonly)

Returns the value of attribute paths.



404
405
406
# File 'lib/rcad.rb', line 404

def paths
  @paths
end

#pointsObject (readonly)

Returns the value of attribute points.



404
405
406
# File 'lib/rcad.rb', line 404

def points
  @points
end