Changed default for fill pitch (equal to cell's bbox w/h). Updated doc.

This commit is contained in:
Matthias Koefferlein 2021-03-29 22:57:20 +02:00
parent 47a845884d
commit 6971048d28
3 changed files with 110 additions and 6 deletions

View File

@ -4287,9 +4287,10 @@ CODE
#
# Without a reference point given, the lower left corner of the fill pattern's bounding box will be used
# as the reference point. The reference point will also defined the footprint of the fill cell - more precisely
# the lower left corner. The fill cell's foot print is taken to be a rectangle having the horizontal and vertical
# step pitch for width and height respectively. The dimension can be changed however so that the fill cells
# can overlap or there can be spacing between the cells. To change the dimensions use the "dim" method.
# the lower left corner. When step vectors are given, the fill cell's footprint is taken to be a rectangle
# having the horizontal and vertical step pitch for width and height respectively. This way the fill cells
# will be arrange seamlessly. However, the cell's dimensions can be changed, so that the fill cells
# can overlap or there is a space between the cells. To change the dimensions use the "dim" method.
#
# The following example specifies a fill cell with an active area of -0.5 .. 1.5 in both directions
# (2 micron width and height). With these dimensions the fill cell's footprint is independent of the
@ -4329,7 +4330,7 @@ CODE
end
# %DRC%
# @name fill
# @name fill_with_left
# @brief Fills the region with regular pattern of shapes
# @synopsis layer.fill_with_left([ options ])
#
@ -4390,10 +4391,10 @@ CODE
end
if !row_step
row_step = RBA::DVector::new(pattern.bbox.width, 0)
row_step = RBA::DVector::new(pattern.default_xpitch, 0)
end
if !column_step
column_step = RBA::DVector::new(0, pattern.bbox.height)
column_step = RBA::DVector::new(0, pattern.default_ypitch)
end
dbu_trans = RBA::VCplxTrans::new(1.0 / @engine.dbu)

View File

@ -207,6 +207,14 @@ module DRC
RBA::DBox::new(o, o + d)
end
def default_xpitch
@dim ? @dim.x : self.bbox.width
end
def default_ypitch
@dim ? @dim.y : self.bbox.height
end
def _computed_origin
b = self.bbox
return b.empty? ? RBA::DPoint::new : b.p1

View File

@ -1027,6 +1027,101 @@ The following images show the effect of the extents method:
<keyword name="fill"/>
<p>Usage:</p>
<ul>
<li><tt>layer.fill([ options ])</tt></li>
</ul>
<p>
This method will attempt to fill the polygons of the layer with a regular pattern
of shapes.
</p><p>
The fill function currently is not available in deep mode.
</p><p>
Options are:
<ul>
<li><b>hstep(x) </b>or <b>hstep(x, y) </b>: specifies the horizontal step pitch of the pattern. x must be
a positive value. A vertical displacement component can be specified too, which results in a skewed pattern. </li>
<li><b>vstep(y) </b>or <b>vstep(x, y) </b>: specifies the vertical step pitch of the pattern. y must be
a positive value. A horizontal displacement component can be specified too, which results in a skewed pattern. </li>
<li><b>origin(x, y) </b>: specifies a fixed point to align the pattern with. This point specifies the location
of the reference point for one pattern cell. </li>
<li><b>auto_origin </b>: lets the algorithm choose the origin. This may result is a slightly better fill coverage
as the algorithm is able to determine a pattern origin per fill island. </li>
<li><b>fill_pattern(..) </b>: specifies the fill pattern. </li>
</ul>
</p><p>
"fill_pattern" generates a fill pattern object. This object is used for configuring the fill pattern
content. Fill pattern need to be named. The name will be used for generating the fill cell.
</p><p>
To provide a fill pattern, create a fill pattern object and add shapes to it. The following example creates
a fill pattern named "FILL_CELL" and adds a 1x1 micron box on layer 1/0:
</p><p>
<pre>
p = fill_pattern("FILL_CELL")
p.shape(1, 0, box(0.0, 0.0, 1.0, 1.0))
</pre>
</p><p>
See <a href="/about/drc_ref_global.xml#box">box</a> for details about the box specification. You can also add paths or polygons with <a href="/about/drc_ref_global.xml#path">path</a> or <a href="/about/drc_ref_global.xml#polygon">polygon</a>.
</p><p>
A more compact way of writing this is:
</p><p>
<pre>
p = fill_pattern("FILL_CELL").shape(1, 0, box(0.0, 0.0, 1.0, 1.0))
</pre>
</p><p>
The fill pattern can be given a reference point which is used for placing the pattern. The reference point
is the one which is aligned with the pattern origin. The following code will assign (-0.5, -0.5) as the reference
point for the 1x1 micron rectangle. Hence the reference point is a little below and left of the rectangle which
in turn shifts the rectangle fill pattern to the right and up:
</p><p>
<pre>
p = fill_pattern("FILL_CELL")
p.shape(1, 0, box(0.0, 0.0, 1.0, 1.0))
p.origin(-0.5, -0.5)
</pre>
</p><p>
Without a reference point given, the lower left corner of the fill pattern's bounding box will be used
as the reference point. The reference point will also defined the footprint of the fill cell - more precisely
the lower left corner. When step vectors are given, the fill cell's footprint is taken to be a rectangle
having the horizontal and vertical step pitch for width and height respectively. This way the fill cells
will be arrange seamlessly. However, the cell's dimensions can be changed, so that the fill cells
can overlap or there is a space between the cells. To change the dimensions use the "dim" method.
</p><p>
The following example specifies a fill cell with an active area of -0.5 .. 1.5 in both directions
(2 micron width and height). With these dimensions the fill cell's footprint is independent of the
step pitch:
</p><p>
<pre>
p = fill_pattern("FILL_CELL")
p.shape(1, 0, box(0.0, 0.0, 1.0, 1.0))
p.origin(-0.5, -0.5)
p.dim(2.0, 2.0)
</pre>
</p><p>
With these ingredients will can use the fill function. The first example fills the polygons
of "to_fill" with an orthogonal pattern of 1x1 micron rectangles with a pitch of 2 microns:
</p><p>
<pre>
pattern = fill_pattern("FILL_CELL").shape(1, 0, box(0.0, 0.0, 1.0, 1.0)).origin(-0.5, -0.5)
to_fill.fill(pattern, hstep(2.0), vstep(2.0))
</pre>
</p><p>
This second example will create a skewed fill pattern in auto-origin mode:
</p><p>
<pre>
pattern = fill_pattern("FILL_CELL").shape(1, 0, box(0.0, 0.0, 1.0, 1.0)).origin(-0.5, -0.5)
to_fill.fill(pattern, hstep(2.0, 1.0), vstep(-1.0, 2.0), auto_origin)
</pre>
</p><p>
The fill function can only work with a target layout for output.
It will not work for report output.
</p><p>
The layers generated by the fill cells is only available for input later in the
script if the output layout is identical to the input layouts.
If you need the area missed by the fill function, try <a href="#fill_with_left">fill_with_left</a>.
</p>
<a name="fill_with_left"/><h2>"fill_with_left" - Fills the region with regular pattern of shapes</h2>
<keyword name="fill_with_left"/>
<p>Usage:</p>
<ul>
<li><tt>layer.fill_with_left([ options ])</tt></li>
</ul>
<p>