Skip to content
shairontoledo edited this page Sep 13, 2010 · 3 revisions

Draws a circle to the current point (or current row by default).
Options

  • :x and :y – as center of the circle.
  • :radius – as radius(in points).
  • :ang1 – the angle of a vector from (:x , :y ) of length :radius to the first endpoint of the circle.
  • :ang2 – the angle of a vector from (:x, :y) of length :radius to the second endpoint of the circle.
  • :content – facade to ShapeConent with same parameters.
  • :border – facade to Border with same parameters.
  • :use – :arc draws counterclockwise and :arcn (arc negative) clockwise direction.

Examples using facade circle method inside Document.


  d=RGhost::Document.new
  d.circle :x => 5, :y => 2.5 , :radius => 40



  d=RGhost::Document.new
  d.circle :x => 5, :y => 2.5 , :radius => 40, :content => {:fill => false}
 



  d=RGhost::Document.new
  d.circle :x => 5, :y => 2.5 , :radius => 40, :content => {:color => "#FF0000"}
 



  d=RGhost::Document.new
  d.circle :x => 5, :y => 2.5 , :radius => 40, :content => {:color => "#FF0000"} ,:border => {:color => "#FFFFFF"}


 
  d=RGhost::Document.new
  d.circle :x => 5, :y => 2.5 , :radius => 40, :content => {:color => :yellow} ,:border => {:color => :orange, :dash => [1,2,1,2], :width => 20}



   d=RGhost::Document.new
   colors=%w[#98AE09 #AFE099 #A971FF #CC1010 #FF7201 #34FEE1]
   6.downto(1) do |v|
     d.circle :x => 5, :y => 2.5 , :radius => v*10, :content =>{:color => colors[v]}
   end



 d=RGhost::Document.new
 d.circle :x => 5, :y => 2.5 , :ang1 => 90, :radius => 50, :content => {:fill => false }



 d=RGhost::Document.new
 d.circle :x => 5, :y => 2.5 , :ang2 => 90, :radius => 50, :content => {:fill => false }


 
 d=RGhost::Document.new
 d.circle :x => 5, :y => 2.5 , :ang2 => 90, :radius => 50, :content =>{:color => :green}



 d=RGhost::Document.new
 d.circle :x => 5, :y => 2.5 , :ang2 => 90, :use => :arcn, :radius => 50, :content =>{:color => :green}
 

Examples using Circle class


   d=RGhost::Document.new
   d.scale(3,1)
   d.set Circle.new(:x => 1.5, :y => 1.5 , :ang2 => 180, :radius => 25)