Class: SkippyLib::Line
- Inherits:
-
Array
- Object
- Array
- SkippyLib::Line
- Defined in:
- modules/line.rb
Overview
Instance Method Summary collapse
- #direction ⇒ Geom::Vector3d
-
#initialize(point, vector) ⇒ Line
constructor
A new instance of Line.
- #inspect ⇒ String
- #to_a ⇒ Array(Geom::Point3d, Geom::Vector3d)
- #valid? ⇒ Boolean
Constructor Details
#initialize(point, vector) ⇒ Line
Returns a new instance of Line.
10 11 12 13 14 15 |
# File 'modules/line.rb', line 10 def initialize(point, vector) super() # Not making type check or type conversion due to performance. push(point) push(vector) end |
Instance Method Details
#direction ⇒ Geom::Vector3d
19 20 21 |
# File 'modules/line.rb', line 19 def direction @direction ||= direction_internal end |
#inspect ⇒ String
36 37 38 |
# File 'modules/line.rb', line 36 def inspect "#{self.class.name}#{super}" end |
#to_a ⇒ Array(Geom::Point3d, Geom::Vector3d)
25 26 27 |
# File 'modules/line.rb', line 25 def to_a [at(0).clone, direction] end |
#valid? ⇒ Boolean
30 31 32 |
# File 'modules/line.rb', line 30 def valid? valid_point3d?(at(0)) && (valid_point3d?(at(1)) || valid_vector3d?(at(1))) end |