Sha256: c4e04404edf4fb475675d5e8f8fe193f98064cb56e2a9fd340a86fba7fd8a9f6

Contents?: true

Size: 600 Bytes

Versions: 12

Compression:

Stored size: 600 Bytes

Contents

require 'rays/ext'


module Rays


  class Polygon


    class Line < Polyline

      def initialize(*points, loop: true, hole: false)
        setup points, loop, hole
      end

      def transform(matrix = nil, loop: loop?, hole: hole?, &block)
        points = to_a
        points = points.map {|point| matrix * point} if matrix
        points = block.call points if block
        self.class.new(*points, loop: loop, hole: hole)
      end

      def inspect()
        "#<Rays::Polygon::Line #{to_a.join ', '}, loop: #{loop?}, hole: #{hole?}>"
      end

    end# Line


  end# Polygon


end# Rays

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rays-0.1.47 lib/rays/polygon_line.rb
rays-0.1.46 lib/rays/polygon_line.rb
rays-0.1.45 lib/rays/polygon_line.rb
rays-0.1.44 lib/rays/polygon_line.rb
rays-0.1.43 lib/rays/polygon_line.rb
rays-0.1.42 lib/rays/polygon_line.rb
rays-0.1.40 lib/rays/polygon_line.rb
rays-0.1.39 lib/rays/polygon_line.rb
rays-0.1.38 lib/rays/polygon_line.rb
rays-0.1.37 lib/rays/polygon_line.rb
rays-0.1.36 lib/rays/polygon_line.rb
rays-0.1.35 lib/rays/polygon_line.rb