Does klayout has a function somewhat like snap to point?

Hi,

I want to ask could klayout has a function somewhat like "snap to point", which can quickly move layout?
Could anyone know?

Thank you in advance!

Comments

  • Could you explain in more detail what you're looking for?

    Matthias

  • Hi,

    1) snap to grid: you can set your snapping grid via menu:

    Edit > Editor Options > Snapping > Grid "Global grid" (or "Other grid")

    I normally define a wide range of default grids (global grid) in the setup, something like:

    1250.0,1000.0,250.0,125.0,100.0,50.0,25.0,5.0,2.5,1.0,0.5,0.25,0.1,0.05,0.025,0.01,0.005,0.001,0.0005,0.00025,0.0001,0.00005

    and select the one I need via menu View > Grid.

    2) move to point: you can move selected structures via menu:

    Edit > Selection > Move To (or Move By)

    Cheers,

    Tomas

  • If you want to touch only one point, I believe Partial
    (stretch) will move a vertex to the next grid-snap by
    hand. Not sure about multiple-selected vertices, you
    would have to play to see whether it does what you
    want.

    A "snap all vertices to grid" could be cool, but also
    risky (you might, say, change your 90 / 45 /45 degree
    polygon to 90 / 44.8 / 45.2 or something like that if
    the "where's my best snap?" algorithm gets tricked?).

  • Because of such behaviors I often find it better to
    "over-stretch" the polygon, and use an on-grid
    "cutter" shape with "Subtract, others from first"
    to shave off any off-grid "material".

  • @Matthias,

    Sorry for the late reply.
    I mean, the layout region full with vertices whose spacing is 0.001um.
    And we can drag the polygon/shape to the specified vertice.
    Could this be achieved more quickly?

    Currently, I can move the shape to speified point by "move by" function or drag several times to get to specified point finally.

    Is there some way more quickly to drag the shape to specified vertice which I see by eye?

  • @tomas2004 ,

    Thank you very much for your respond. I always choose the second way you mentioned.

    But I don't understand the first way you mentioned.
    You mean, I can set the snap like this?

    But, it seems that there is slight improvement for speed.

    Best regards!
    Weiling

  • @dick_freebird ,
    Thank you very much for your respond.
    My original goal is not to find vertice which isn't on grid.
    Your reminder is very helpful. It is true that the shapes formed from angles may not be displayed on the grid, but it cannot be placed on the grid at will.

    The botton " Subtract, others from first"you provide will be very helpful to shave off any off-grid "material" in some cases.
    I wonder, does this "snap all vertices to grid" and "over-stretch" are function in klayout or just explanatory nouns which not exist in klayout?

  • Those were my attempt to explain how I do things.

    If they were klayout functions, they might be useful but
    I also anticipated some risky behaviors (such as a 45
    turning into a not-exactly-45 due to rounding errors or
    something like that). Or circles becoming "toothed
    gear" vertex by vertex as snapping pulls them inward
    or outward depending on each vertex's round-off.

  • Hi Weiling,

    The snapping grid is used when drawing new shapes or moving existing shapes. Normally it is the global grid, but you can quickly override it by defining an "Other grid...". Putting the "Other grid..." to 0.001 does not make much sense if your DBU is also 0.001 because all structure snap to DBU by default even if snap to grid is disabled.

    If your layout contains a lot of 0.001 gaps (spacing) the only way to correct it fast is by layer operations:

    1) size all shapes with 0.001/side
    2) merge all shapes
    3) size all shapes with -0.001/side

    Note that the new layers will be fully flattened...

    Cheers,

    Tomas

  • @dick_freebird,
    Thank you for your detailed respond.
    Your worries are possible and justified.
    I got it.
    Thank you again.

  • @tomas2004 ,

    Thank you for your respond.

    For a layout with many gaps of 0.001um, I followed your method, but It didn't make function, does it only take effect when the space is smaller than 0.001um for shapes formed by angle?

    The original shape:

    1) size all shapes with 0.001/side
    The generated shape is shown in Layer 2/0:

    2) merge all shapes
    The merged shape is shown in Layer3/0:

    3)size all shapes with -0.001/side
    The sized shape is shown in Layer 4/0:

    It seems that it doen't take effect for space of 0.001um.
    So maybe it’s my understanding or operation wrong?

    Best regards!
    Weiling

  • If space is exactly 0.001, and snap is 0.001, does
    that leave it "nothing to do"?

Sign In or Register to comment.