Class: Rectangle

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

Direct Known Subclasses

Square

Instance Attribute Summary collapse

Attributes inherited from Polygon

#paths, #points

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, #ycenter, #zcenter, #zsize, #~@

Constructor Details

#initialize(xsize, ysize) ⇒ Rectangle

Returns a new instance of Rectangle.



431
432
433
434
435
436
# File 'lib/rcad.rb', line 431

def initialize(xsize, ysize)
  @xsize = xsize
  @ysize = ysize

  super([[0,0], [xsize,0], [xsize,ysize], [0,ysize]])
end

Instance Attribute Details

#xsizeObject (readonly)

These override Shape.xsize etc.



429
430
431
# File 'lib/rcad.rb', line 429

def xsize
  @xsize
end

#ysizeObject (readonly)

These override Shape.xsize etc.



429
430
431
# File 'lib/rcad.rb', line 429

def ysize
  @ysize
end