Class: Rough::Fillers::ZigzagLine
- Inherits:
-
Object
- Object
- Rough::Fillers::ZigzagLine
- Defined in:
- lib/rough/fillers/zigzag_line.rb
Instance Method Summary collapse
- #fill_polygons(polygon_list, o) ⇒ Object
-
#initialize(helper) ⇒ ZigzagLine
constructor
A new instance of ZigzagLine.
Constructor Details
#initialize(helper) ⇒ ZigzagLine
Returns a new instance of ZigzagLine.
9 10 11 |
# File 'lib/rough/fillers/zigzag_line.rb', line 9 def initialize(helper) @helper = helper end |
Instance Method Details
#fill_polygons(polygon_list, o) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/rough/fillers/zigzag_line.rb', line 13 def fill_polygons(polygon_list, o) gap = (o.hachure_gap < 0) ? (o.stroke_width * 4) : o.hachure_gap zo = (o.zigzag_offset < 0) ? gap : o.zigzag_offset o2 = o.merge(hachure_gap: gap + zo) lines = ScanLineHachure.polygon_hachure_lines(polygon_list, o2) OpSet.new(type: :fillSketch, ops: zigzag_lines(lines, zo, o2)) end |