Drawing a polygon - not getting it, about ending. Malformed.

Docs say to double-click to end a polygon, but when
I try to draw a 45-90-45 triangle I get either nothing,
or a 2-point polygon. Vertex 1, OK. Vertex 2, OK.
Vertex 3, OK. Go back to Vertex 1 and double-click,
I do not get a triangle - just a line between Vertex 1
and Vertex 2. No mater how many times I single-
click on Vertex 1 it seems I cannot complete the

Now if I draw a -square-, it fails similarly and I get
a -triangle-. Not what I drew but a triangle anyhow.

Seems like the final vertex (which should be the start,
right?) is "getting lost" and the shape is drawn with
the N-1 vertices it "has in pocket".

Anybody else seeing this behavior, or can tell me what
I'm missing in the (should be) simple instructions?


  • Hi Jim,

    you actually don't need to go back - just click at vertex 1 to start drawing, click at vertex 2 and then double-click at the third vertex. This will finish the triangle. The closing line will be indicated as a dotted line while you move the third point.

    If you move while keeping shift pressed, the edges you create are confined to horizontal/vertical only and polygon completion is done with such edges. This way you will get a square instead of a triangle when you set three points while keeping shift pressed.

    But even if you close the polygon as you explained by making the last point the first, it should still work. I'm a bit puzzled - polygon drawing essentially is pretty straightforward.

    Please check your settings in "Edit/Editor Options". Connections and Movements should be "Any Angle" and "Any Direction" respectively.

    Another pitfall is the "background combination mode" (the drop-down box right of "Ruler"). If it isn't "Add" the results may be a bit unexpected.

    Kind regards,


  • Hi, Matthias,

    Thank you. The function works as you say. I guess it was another case of "muscle memory does not apply", from other tools where end-closure happens when last and first point coincide, and polygons don't "close themselves".

    I am working with 45-degree angle / direction and the polygons draw fine, "any/any" does not appear to be necessary.

    But I can still make the "runt polygon" thing happen pretty much at will. At least now I know how not to, and that's enough (for me).

  • Hi Jim,

    it took me some time to figure out how to reproduce your problem ...

    I can reproduce it by: click at vertex 1 to start - go to vertex 2 and click - go to vertex 3 and click - go back to vertex 1 and single-click - then double click again at vertex 1.

    It never occured to me to use it this way ... but I guess it's not hard to fix -> https://github.com/KLayout/klayout/issues/363


Sign In or Register to comment.