Class: VectorSalad::StandardShapes::Exclusion

Inherits:
Clip show all
Defined in:
lib/vector_salad/standard_shapes/exclusion.rb

Overview

Exclude the contained shapes.

Instance Attribute Summary

Attributes inherited from BasicShape

#options

Instance Method Summary collapse

Methods inherited from Clip

#canvas, #to_path

Methods inherited from BasicShape

#flip, #flip_x, #flip_y, #jitter, #move, #rotate, #scale, #to_a, #to_bezier_path, #to_cubic_path, #to_multi_path, #to_path, #to_simple_path, #to_svg

Constructor Details

#initialize(**options, &block) ⇒ Exclusion

The first path is used as the subject, subsequent paths are excluded from the first.

Examples:

Exclusion.new do
  canvas << Path.new([0,0], [90,90], [0,90])
  canvas << Path.new([50,0], [95,0], [50, 70])
end

Using DSL:

exclusion do
  path([0,0], [90,90], [0,90])
  path([50,0], [95,0], [50, 70])
end


22
23
24
# File 'lib/vector_salad/standard_shapes/exclusion.rb', line 22

def initialize(**options, &block)
  super(:xor, **options, &block)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class VectorSalad::DSL