how to change CellInstArray instances to region?

Hello
When I construct my layout,I find some troubles in changing CellInstArray(....)instances into Region,because I need to clip some CellInstArray instances in the corners,these cell need to delete by region bool operation,how to do this function ?could you give me some examples?
here show you my part scripts:
import pya
import math
.....
Box_main_hole=pya.Box(-Device_para["Active_length"]/2,-Device_para["Active_length"]/2,Device_para["Active_length"]/2,Device_para["Active_length"]/2)
Region_hole=pya.Region(Box_main_hole)
.....
Hex_cell_index=Hex_cell.cell_index()
new_instance_1=pya.CellInstArray(Hex_cell_index,
pya.Trans(pya.Point(-7951000,7951000)),
pya.Vector(Cell_pitch,0),
pya.Vector(0,-2Cell_pitchmath.cos(math.pi/6)),
(15901000/Cell_pitch)+1,
math.ceil(1590
1000/(2Cell_pitchmath.cos(math.pi/6)))+1)
new_instance_2=pya.CellInstArray(Hex_cell_index,
pya.Trans(pya.Point(-7951000+Cell_pitchmath.sin(math.pi/6),7951000-Cell_pitchmath.cos(math.pi/6))),
pya.Vector(Cell_pitch,0),
pya.Vector(0,-2Cell_pitchmath.cos(math.pi/6)),
(15901000/Cell_pitch)+1,
math.ceil(1590
1000/(2Cell_pitchmath.cos(math.pi/6))))
new_1_region=pya.Region(new_instance_1)
new_2_region=pya.Region(new_instance_2)
new_sum=new_1_region+new_2_region
region=new_sum-Region_hole
Hex_cell_instance.insert(region)
......
But l got a error message:Traceback (most recent call last):
File "c:/Users/dell/Desktop/SBD .py", line 320, in
new_1_region=pya.Region(new_instance_1)
RuntimeError: No overload with matching arguments in Region.new
How to make it work?
thank you very much

Comments

  • First: please format your code. This is hard to read. This forum supports Markdown and comes with a nice editor. So please use it (Paragraph Symbol - code).

    Second: you cannot just put instances into a region. A region is for polygons. You cannot "bool" instances.

    Manipulating cell array instances is tricky as you need to split the array. There is some editor support for this, but within scripts you need to manipulate the instances individually. Regions will not help you.

    Please submit a better description of your problem, ideally with a sample layout to demonstrate what you want to achieve.

    Matthias

Sign In or Register to comment.