module GreinerHormann
Constants
- VERSION
Public Class Methods
clip(poly_a, poly_b, source_forwards, clip_forwards)
click to toggle source
# File lib/greiner_hormann.rb, line 6 def self.clip(poly_a, poly_b, source_forwards, clip_forwards) source = Polygon.new(poly_a) clip = Polygon.new(poly_b) source.clip(clip, source_forwards, clip_forwards) end
difference(poly_a, poly_b)
click to toggle source
# File lib/greiner_hormann.rb, line 20 def self.difference(poly_a, poly_b) clip(poly_a, poly_b, false, true) end
intersection(poly_a, poly_b)
click to toggle source
# File lib/greiner_hormann.rb, line 16 def self.intersection(poly_a, poly_b) clip(poly_a, poly_b, true, true) end
union(poly_a, poly_b)
click to toggle source
# File lib/greiner_hormann.rb, line 12 def self.union(poly_a, poly_b) clip(poly_a, poly_b, false, false) end