Ruby DRC for taper

edited April 28 in Ruby Scripting

@Matthias Sorry, I did not make clear description before. I will modify my question. The orginal yellow polygon is not clear, so I changed it to black.

The problem I want to solve is like below:

First, let us make some convention.
1. Horizontal dimension: the width(length) of the taper.
2. Vertical dimension: the height of the taper, and the low-height we call it height_l, the high-height we call it height_h.

Here, we see the layer 118/120, this is a transition layer, normally is used to mark the taper when its height lower than a threshold value. For example, here. the height_l = 0.04 um, the height_h = 0.2 um. The layer 118/120 marks the part height < 0.1 um. The 171/0 layer is a waveguide layer.

Now, the overlap part of transition layer and waveguide layer is a small taper, and what I really to test is that:
1. The length of the this small taper. (Totally no idea)
2. The length of four edges of this small taper could be known is better. (I saw some function to get this in Documents, I just start to learn about this part)
3. The angle of this enclosed taper.(I saw some function to get this in Documents, I just start to learn about this part).

Hope you could give me some advice.

Comments

  • edited April 24

    I'm sorry, I don't understand.

    What do you mean exactly? Like you want to have only the part of the yellow polygon that overlaps with the blue one (that's a boolean AND). Or you want to know the dimension of the yellow polygon in some way?

    I'm fairly sure if I am looking at some AI generated problem.

    Matthias

  • Sorry I did not make clear description, for now, I re-new the description part.

  • edited May 4

    Hi @BigPanda,

    thanks for the explanation. I think I understand what you want to do.

    I think the solution is easier if you start from scratch.

    I have drawn a sample on layer 1/0:

    ![](https://www.klayout.de/forum/uploads/editor/81/3j966d5n6cry.png "")
    

    The following DRC script performs a width check to create edge pair markers where the width is less than 0.1 µm and iterates over these markers to derive the desired information:

    l1 = input(1, 0)
    
    # NOTE: the angle_limit of 80 (degree) avoids
    # corner violations at the right end. The value
    # is not really important - it should be small enough
    # so you capture the violations you want to see.
    eps = l1.width(0.1.um, angle_limit(80.0))
    
    eps.data.each do |ep|
      puts "Center: #{RBA::CplxTrans::new(1.dbu) * ep.bbox.center}"
      puts "Shortest distance: #{ep.distance * 1.dbu}"
      puts "Length (average): #{(ep.first.length + ep.second.length) * 0.5.dbu}"
    end
    

    You can learn about more features of the EdgePair objects here: https://www.klayout.de/doc-qt5/code/class_EdgePair.html

    Matthias

  • edited May 19

    @Matthias Thx, It cost me some time to learn Ruby and learn the DRC document. For now, I understand something. And I changed this a little bit. What I use is:

    l1 = input(171, 0)
    l2 = input(118, 120)
    
    ol= l1 & l2
    eps = ol.width(0.265.um, angle_limit(80.0))
    eps.data.each do |ep|
      puts "BBox length: #{RBA::CplxTrans::new(1.dbu) * ep.bbox.width}"  # length I want!
    end
    

    Besides, I find another solution:

    l1 = input(171, 0)
    l2 = input(118, 120)
    
    ol= l1 & l2
    eps = ol.width(0.265.um, angle_limit(80.0))
    puts "BBox: #{RBA::CplxTrans::new(1.dbu) * eps.data.bbox.width}"
    

    It seems that above one also works.
    Of course, the way you mentioned also works well for me.

    l1 = input(171, 0)
    
    eps = l1.width(0.265.um, angle_limit(80.0))
    
    # method 1
    puts "BBox: #{RBA::CplxTrans::new(1.dbu) * eps.data.bbox.width}"
    
    # method 2
    eps.data.each do |ep|
      puts "BBox: #{RBA::CplxTrans::new(1.dbu) * ep.bbox.width}"
    end
    

    The bbox is quite a cool stuff. Thank you for your help! Hope this one can also help who has same problem with me.

    By the way, I find that your figure is missed. And I need to copy it and paste it in my browser to view it. Maybe you can change it a little bit. :smile:

  • Your right. Something went wrong with the link.

    However, I can't edit it any longer.

    Let's try again:

    :)

    Thanks,

    Matthias

Sign In or Register to comment.