You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
642B

  1. import pya
  2. #amount to shift in units of distance between images
  3. shift_x = 0
  4. shift_y = 0.1
  5. #vars on current sizes
  6. shift_mult = 5
  7. pixel_size = 20
  8. image_dist = (shift_mult * 3 * 2 + 2) * pixel_size * 100
  9. print(image_dist)
  10. #shift and take the overlap returning a 3rd layer
  11. ly = pya.CellView.active().layout()
  12. l10 = ly.layer(1, 0)
  13. l20 = ly.layer(2, 0)
  14. r10 = pya.Region(ly.top_cell().begin_shapes_rec(l10))
  15. r20 = pya.Region(ly.top_cell().begin_shapes_rec(l20))
  16. r10.move(image_dist * shift_x, image_dist* shift_y)
  17. ly.delete_layer(ly.layer(3, 0))
  18. ly.top_cell().shapes(ly.layer(3, 0)).insert(r10 & r20)
  19. pya.LayoutView.current().add_missing_layers()