Class: DXF::Circle
Constant Summary
Constants inherited from Entity
Instance Attribute Summary collapse
- #center ⇒ Object readonly
-
#radius ⇒ Object
Returns the value of attribute radius.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
-
#z ⇒ Object
Returns the value of attribute z.
Attributes inherited from Entity
Instance Method Summary collapse
Methods inherited from Entity
Methods included from ClusterFactory
Instance Attribute Details
#center ⇒ Object (readonly)
61 62 63 64 65 |
# File 'lib/dxf/entity.rb', line 61 def center a = [x, y, z] a.pop until a.last Geometry::Point[*a] end |
#radius ⇒ Object
Returns the value of attribute radius.
46 47 48 |
# File 'lib/dxf/entity.rb', line 46 def radius @radius end |
#x ⇒ Object
Returns the value of attribute x.
45 46 47 |
# File 'lib/dxf/entity.rb', line 45 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
45 46 47 |
# File 'lib/dxf/entity.rb', line 45 def y @y end |
#z ⇒ Object
Returns the value of attribute z.
45 46 47 |
# File 'lib/dxf/entity.rb', line 45 def z @z end |
Instance Method Details
#parse_pair(code, value) ⇒ Object
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/dxf/entity.rb', line 48 def parse_pair(code, value) case code when '10' then self.x = value.to_f when '20' then self.y = value.to_f when '30' then self.z = value.to_f when '40' then self.radius = value.to_f else super # Handle common and unrecognized codes end end |