class VectorBeWinding::Shape

Public Instance Methods

bounding_rect() click to toggle source

Each subclass must override it

# File lib/vector_be_winding/shape.rb, line 4
def bounding_rect
  raise 'implment this'
end
containingness(shape1) click to toggle source

Very naive definition. Each subclass is expected to override it negative: no containing, 0: containing with border, positive: inside

# File lib/vector_be_winding/shape.rb, line 24
def containingness(shape1)
  bounding_rect.containingness(shape1.bounding_rect)
end
contains?(shape1) click to toggle source
# File lib/vector_be_winding/shape.rb, line 18
def contains?(shape1)
  containingness(shape1) >= 0
end
intersectedness(shape1) click to toggle source

Very naive definition. Each subclass is expected to override it negative: no intersected, 0: touched, positive: intersected

# File lib/vector_be_winding/shape.rb, line 14
def intersectedness(shape1)
  bounding_rect.intersectedness(shape1.bounding_rect)
end
intersects?(shape1) click to toggle source
# File lib/vector_be_winding/shape.rb, line 8
def intersects?(shape1)
  intersectedness(shape1) >= 0
end