Sha256: 3b83ac59d03d920a48d4da6ee91cda849d240f9103f2c540d9bf9b960c5e2a05

Contents?: true

Size: 626 Bytes

Versions: 13

Compression:

Stored size: 626 Bytes

Contents

# -*- coding: utf-8 -*-


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

13 entries across 13 versions & 1 rubygems

Version Path
rays-0.1.34 lib/rays/polygon_line.rb
rays-0.1.33 lib/rays/polygon_line.rb
rays-0.1.32 lib/rays/polygon_line.rb
rays-0.1.31 lib/rays/polygon_line.rb
rays-0.1.30 lib/rays/polygon_line.rb
rays-0.1.29 lib/rays/polygon_line.rb
rays-0.1.28 lib/rays/polygon_line.rb
rays-0.1.27 lib/rays/polygon_line.rb
rays-0.1.26 lib/rays/polygon_line.rb
rays-0.1.25 lib/rays/polygon_line.rb
rays-0.1.24 lib/rays/polygon_line.rb
rays-0.1.23 lib/rays/polygon_line.rb
rays-0.1.22 lib/rays/polygon_line.rb