mirror of https://github.com/KLayout/klayout.git
Supporting LayerInfo objects in fill pattern generation, doc updates
This commit is contained in:
parent
131745433d
commit
f67b28c52a
|
|
@ -1125,6 +1125,25 @@ A more compact way of writing this is:
|
|||
p = fill_pattern("FILL_CELL").shape(1, 0, box(0.0, 0.0, 1.0, 1.0))
|
||||
</pre>
|
||||
</p><p>
|
||||
The "shape" method takes several forms:
|
||||
</p><p>
|
||||
<ul>
|
||||
<li><tt>shape(layer, object, object ...) </tt>(1) </li>
|
||||
<li><tt>shape(layer, datatype, object, object ...) </tt>(2) </li>
|
||||
<li><tt>shape(name, object, object ...) </tt>(3) </li>
|
||||
<li><tt>shape(layer_info, object, object ...) </tt>(4) </li>
|
||||
</ul>
|
||||
</p><p>
|
||||
The first form takes a GDS2 layer number. The datatype is assumed to be 0.
|
||||
The second form takes a GDS layer and datatype number.
|
||||
The third form takes a layer name for layout systems with named layers
|
||||
(like Magic, CIF or DXF).
|
||||
The forth form takes a <class_doc href="LayerInfo">LayerInfo</class_doc> object to specify the layer.
|
||||
All forms take one to many geometry objects which are written to the respective layer.
|
||||
Geometry objects can either be created using the generator functions
|
||||
(<a href="/about/drc_ref_global.xml#box">box</a>, <a href="/about/drc_ref_global.xml#polygon">polygon</a>, <a href="/about/drc_ref_global.xml#path">path</a>). The core classes <class_doc href="DBox">DBox</class_doc>, <class_doc href="DPolygon">DPolygon</class_doc>, <class_doc href="DPath">DPath</class_doc> or
|
||||
<class_doc href="DText">DText</class_doc> are also accepted as geometry objects.
|
||||
</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
|
||||
|
|
|
|||
|
|
@ -4712,6 +4712,25 @@ CODE
|
|||
# p = fill_pattern("FILL_CELL").shape(1, 0, box(0.0, 0.0, 1.0, 1.0))
|
||||
# @/code
|
||||
#
|
||||
# The "shape" method takes several forms:
|
||||
#
|
||||
# @ul
|
||||
# @li @tt shape(layer, object, object ...) @/tt (1) @/li
|
||||
# @li @tt shape(layer, datatype, object, object ...) @/tt (2) @/li
|
||||
# @li @tt shape(name, object, object ...) @/tt (3) @/li
|
||||
# @li @tt shape(layer_info, object, object ...) @/tt (4) @/li
|
||||
# @/ul
|
||||
#
|
||||
# The first form takes a GDS2 layer number. The datatype is assumed to be 0.
|
||||
# The second form takes a GDS layer and datatype number.
|
||||
# The third form takes a layer name for layout systems with named layers
|
||||
# (like Magic, CIF or DXF).
|
||||
# The forth form takes a RBA::LayerInfo object to specify the layer.
|
||||
# All forms take one to many geometry objects which are written to the respective layer.
|
||||
# Geometry objects can either be created using the generator functions
|
||||
# (\global#box, \global#polygon, \global#path). The core classes RBA::DBox, RBA::DPolygon, RBA::DPath or
|
||||
# RBA::DText are also accepted as geometry objects.
|
||||
#
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -256,6 +256,10 @@ module DRC
|
|||
else
|
||||
raise("Argument ##{ai+1} not understood for FillCell#shape")
|
||||
end
|
||||
elsif a.is_a?(RBA::LayerInfo)
|
||||
layer = a.layer
|
||||
datatype = a.datatype
|
||||
name = a.name
|
||||
elsif a.is_a?(String)
|
||||
if !name
|
||||
name = a
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@ to_fill = extent - l1
|
|||
fp1 = fill_pattern("FP1").shape(10, 0, box(0, 0, 800.nm, 800.nm)).origin(-100.nm, -100.nm)
|
||||
to_fill = to_fill.fill_with_left(fp1, hstep(1.um), vstep(200.nm, 1.um), multi_origin)
|
||||
|
||||
fp2 = fill_pattern("FP2").shape(10, 0, box(0, 0, 400.nm, 400.nm)).origin(-50.nm, -50.nm)
|
||||
fp2 = fill_pattern("FP2").shape(10, box(0, 0, 400.nm, 400.nm)).origin(-50.nm, -50.nm)
|
||||
to_fill = to_fill.fill_with_left(fp2, hstep(0.5.um), vstep(100.nm, 0.5.um), multi_origin)
|
||||
|
||||
fp3 = fill_pattern("FP3").shape(10, 0, box(0, 0, 200.nm, 200.nm)).origin(-25.nm, -25.nm)
|
||||
fp3 = fill_pattern("FP3").shape(RBA::LayerInfo::new(10, 0), box(0, 0, 200.nm, 200.nm)).origin(-25.nm, -25.nm)
|
||||
to_fill = to_fill.fill_with_left(fp3, hstep(0.25.um), vstep(50.nm, 0.25.um), multi_origin)
|
||||
|
||||
to_fill.output(100, 0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue