@@ -5460,8 +5460,17 @@ def output(*args)
54605460 # as the reference point. The reference point will also defined the footprint of the fill cell - more precisely
54615461 # the lower left corner. When step vectors are given, the fill cell's footprint is taken to be a rectangle
54625462 # having the horizontal and vertical step pitch for width and height respectively. This way the fill cells
5463- # will be arrange seamlessly. However, the cell's dimensions can be changed, so that the fill cells
5463+ # will be arrange seamlessly.
5464+ #
5465+ # However, the cell's dimensions can be changed, so that the fill cells
54645466 # can overlap or there is a space between the cells. To change the dimensions use the "dim" method.
5467+ # This example will use a fill cell footprint of 1x1 micrometers, regardless of the step pitch:
5468+ #
5469+ # @code
5470+ # p = fill_pattern("FILL_CELL")
5471+ # p.shape(1, 0, box(0.0, 0.0, 1.0, 1.0))
5472+ # p.dim(1.0, 1.0)
5473+ # @/code
54655474 #
54665475 # The following example specifies a fill cell with an active area of -0.5 .. 1.5 in both directions
54675476 # (2 micron width and height). With these dimensions the fill cell's footprint is independent of the
@@ -5474,6 +5483,18 @@ def output(*args)
54745483 # p.dim(2.0, 2.0)
54755484 # @/code
54765485 #
5486+ # Finally, the fill cell can be given a margin: this is a space around the fill cell which needs
5487+ # to be inside the fill region. Hence, the margin can be used to implement a distance, the fill
5488+ # cells (more precisely: their footprints) will maintain to the outside border of the fill region.
5489+ # The following example implements a margin of 200 nm in horizontal and 250 nm in vertical direction:
5490+ #
5491+ # @code
5492+ # p = fill_pattern("FILL_CELL")
5493+ # p.shape(1, 0, box(0.0, 0.0, 1.0, 1.0))
5494+ # p.dim(1.0, 1.0)
5495+ # p.margin(0.2, 0.25)
5496+ # @/code
5497+ #
54775498 # With these ingredients will can use the fill function. The first example fills the polygons
54785499 # of "to_fill" with an orthogonal pattern of 1x1 micron rectangles with a pitch of 2 microns:
54795500 #
@@ -5574,6 +5595,7 @@ def _fill(with_left, *args)
55745595 fill_cell = pattern . create_cell ( @engine . _output_layout , @engine )
55755596 top_cell = @engine . _output_cell
55765597 fc_box = dbu_trans * pattern . cell_box ( row_step . x , column_step . y )
5598+ fill_margin = dbu_trans * pattern . fill_margin
55775599 rs = dbu_trans * row_step
55785600 cs = dbu_trans * column_step
55795601 origin = origin ? dbu_trans * origin : nil
@@ -5604,6 +5626,7 @@ def _fill(with_left, *args)
56045626 tp . var ( "rs" , rs )
56055627 tp . var ( "cs" , cs )
56065628 tp . var ( "origin" , origin )
5629+ tp . var ( "fill_margin" , fill_margin )
56075630 tp . var ( "fc_index" , fc_index )
56085631 tp . var ( "repeat" , repeat )
56095632 tp . var ( "with_left" , with_left )
@@ -5616,8 +5639,8 @@ def _fill(with_left, *args)
56165639 tile_box = tile_box & tc_box;
56175640 var left = with_left ? Region.new : nil;
56185641 repeat ?
5619- (region & tile_box).fill_multi(top_cell, fc_index, fc_box, rs, cs, Vector.new , left, _tile.bbox) :
5620- (region & tile_box).fill(top_cell, fc_index, fc_box, rs, cs, origin, left, Vector.new , left, _tile.bbox);
5642+ (region & tile_box).fill_multi(top_cell, fc_index, fc_box, rs, cs, fill_margin , left, _tile.bbox) :
5643+ (region & tile_box).fill(top_cell, fc_index, fc_box, rs, cs, origin, left, fill_margin , left, _tile.bbox);
56215644 with_left && _output(#{ result_arg } , left)
56225645 )
56235646END
@@ -5639,9 +5662,9 @@ def _fill(with_left, *args)
56395662
56405663 @engine . run_timed ( "\" #{ m } \" in: #{ @engine . src_line } " , self . data ) do
56415664 if repeat
5642- self . data . fill_multi ( top_cell , fc_index , fc_box , rs , cs , RBA :: Vector :: new , result )
5665+ self . data . fill_multi ( top_cell , fc_index , fc_box , rs , cs , fill_margin , result )
56435666 else
5644- self . data . fill ( top_cell , fc_index , fc_box , rs , cs , origin , result , RBA :: Vector :: new , result )
5667+ self . data . fill ( top_cell , fc_index , fc_box , rs , cs , origin , result , fill_margin , result )
56455668 end
56465669 end
56475670
0 commit comments