Class: Geom::Vertex
- Inherits:
-
Object
- Object
- Geom::Vertex
- Extended by:
- Forwardable
- Defined in:
- lib/geom/vertex.rb
Instance Attribute Summary collapse
-
#normal ⇒ Object
Returns the value of attribute normal.
-
#position ⇒ Object
Returns the value of attribute position.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #clone ⇒ Object
- #eql?(other) ⇒ Boolean
- #equal?(other, snap) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(x = 0.0, y = 0.0, z = 0.0, normal = nil) ⇒ Vertex
constructor
A new instance of Vertex.
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#normal ⇒ Object
Returns the value of attribute normal.
5 6 7 |
# File 'lib/geom/vertex.rb', line 5 def normal @normal end |
#position ⇒ Object
Returns the value of attribute position.
5 6 7 |
# File 'lib/geom/vertex.rb', line 5 def position @position end |
Instance Method Details
#==(other) ⇒ Object
23 24 25 |
# File 'lib/geom/vertex.rb', line 23 def == (other) @position == other.position end |
#eql?(other) ⇒ Boolean
19 20 21 |
# File 'lib/geom/vertex.rb', line 19 def eql?(other) self == other end |
#equal?(other, snap) ⇒ Boolean
27 28 29 30 31 |
# File 'lib/geom/vertex.rb', line 27 def equal?(other,snap) @position.x-snap < other.x && @position.x+snap > other.x && @position.y-snap < other.y && @position.y+snap > other.y && @position.z-snap < other.z && @position.z+snap > other.z end |
#hash ⇒ Object
15 16 17 |
# File 'lib/geom/vertex.rb', line 15 def hash @position.hash end |
#to_s ⇒ Object
37 38 39 |
# File 'lib/geom/vertex.rb', line 37 def to_s "#<Geom::Vertex:#{@position.to_s}>" end |