It looks like you're new here. If you want to get involved, click one of these buttons!
Hello Matthias et al.,
I'm playing around with the DRC fill tool and got some questions (version 0.28.17):
1) I would like to fill a layer called "layer_to_fill" (green in the screenshots below) with a tile "tile_M1" (blue in the screenshots below):
tile_M1 = fill_pattern("TILE_M1").shape(20170, 0, box(-0.244, -0.240, 0.244, 0.240))
layer_to_fill.fill(tile_M1)
This works great:
If I redo this with an offset, I see that the tiles are shifted as expected, but there are now also tiles going outside the "layer_to_fill" shapes (ellipse)...
I would not expect this to happen or am I missing something???
tile_M1 = fill_pattern("TILE_M1").shape(20170, 0, box(-0.244, -0.240, 0.244, 0.240))
tile_M1.origin(-0.3, -0.3)
layer_to_fill.fill(tile_M1)
2) Is there a way to refer to an existing cell of the layout, instead of using the fill_pattern method and add shapes one by one via code???
Cheers,
Tomas
Comments
Hello,
Here's another example (with attachment): I would like to fill layer 3/0 (green) with two different tiles T1 and T2 and one out of three needs to be T2 and the T2's need to be placed diagonally, like:
T2 T1 T1
T1 T2 T1
T1 T1 T2
One way is to create a bigger 3X3 tile with the scheme above, but this will leave too much of the fill area empty so I was thinking about doing 9 (individual) tiling iterations.
The first one works fine:
But the other iterations (using .origin) create tiles outside of the layer 3/0 shape(s):
Is this like a kind of bug? (If not,) is there another way do this?
(For each iteration, a new cell is generated (TILE_T1$x, TILE_T2$x), hence my question to refer to an existing cell of the layout instead of using the fill_pattern method...)
Cheers,
Tomas
Hi @tomas2004,
That's not a bug. "origin" for the fill pattern does something else than what you expected.
First of all, this is my version:
Which gives this:
"fill_pattern.origin", together with "fill_pattern.dim" specifies the pattern bounding box (the "drawn area"). You tried to shift the pattern which basically works, but it will also specify a bounding box that is not the drawn area. The drawn area is given by the shapes you add - like "box" etc. - and it will not change when you set "origin". The effect is a shift, but after that the "drawn" shapes sit outside the box, hence the do not sit inside the fill area.
The solution is to set an origin in the "fill" function: this will decide where to place the first instance of the pattern. I had to switch the sign of the coordinates, as the effect is a positive shift then.
Regards,
Matthias
Hello Matthias,
Thank you for the detailed explanation. It is clear to me now.
For each iteration a new tile is generated, although TILE_T1 to TILE_T1$5 and TILE_T2 to TILE_T2$ are identical. This is not a problem, I can "clean up" with another script. It's actually useful to visualize each iteration individually.
Cheers,
Tomas
Very good
The fill feature will generate new cells when you feed it with "fill_pattern" things. Technically, the "fill_pattern" is just a collection of shapes, but as the fill feature internally needs a cell, it will make a cell from it, not knowing that the fill pattern did not change between the calls.
To avoid this, you can put the following code in front of your DRC script:
This monkey-patches the DRC engine to skip creating a new fill cell, assuming that same name means same content.
Matthias
Hi Matthias,
Awesome! Thank you for all your help, much appreciated!
Cheers,
Tomas