Extract path length

edited April 2015 in Layout
Hi
What is the easest way to extract the length of a path polygon?
Thanks
shirly

Comments

  • edited April 2015

    shirly,

    You say "length of a path polygon". I assume you mean "path". If it has been converted from a path to a polygon already, the problem is harder.

    There is a script http://klayout.de/forum/comments.php?DiscussionID=540 but it say it is precise only for 'thin' wires. I have not tried it.

    In my opinion, you should just get all the points of a path using Path.each_point and then for each pair of points you calculate the cartesian xy distance. Then keep a running sum. If you get stuck, let us know.

    Note that to get each pair of points you should use Ruby's "each_cons" method.

    If you get it working, post the script here for others' benefit!

    David

Sign In or Register to comment.