How to generate all of coordinate of "path" geometry in OASIS file.

As we know, oasis file will use (halfwidth),(startextension)(endextention)(point-list) to describe the path.

what I want to know is how to use above information to generate the path real vertex.

example:
Input: point 1, point 2, point 3
output: point 4, point 5, point 6, point 7, point 8, point 9

https://www.dropbox.com/s/4080rtpen5wj4lu/path.jpg?dl=0

Do you have any formulation or skill to recommend me .

thanks a lot

Comments

  • edited May 2016

    Hi,

    nice picture :-)

    The sketched case is a very simple one. To compute points 4 and 9 from 1 compute the unit normal vector of the 1->2 vector, multiply with the half width and add/subtract to point 1 to get point 4 and 9.

    The unit normal vector of a vector (a,b) can be obtained by (-b,a)/sqrt(a^2+b^2).

    The same way you get points 7 and 6 from point 3.

    Points 8 and 5 can be computed by finding the intersection points of two lines. For the line intersection formula see https://en.wikipedia.org/wiki/Line%E2%80%93line_intersection for example.

    However, real-world cases include start/end extensions, short segments, twisted/self-intersection paths and so forth. A generic path hull generator will need a way to remove loops in the resulting polygon. KLayout employs the boolean merge algorithm for that purpose.

    Matthias

  • edited November -1
    hi Matthias

    thanks for your reply.

    I have another questions,
    (1) how to process truncate calculated number (ex: 23.568->23 or 23.568 ->23.6)
    which one did you process calculated number ? that is because I wanna align some result of
    View tool (such as Calibre or Lavis )
    https://www.mentor.com/products/ic_nanometer_design/verification-signoff/physical-verification/

    (2) the angle from line to line , we need to depend on "angle" to calculate ??, you seem to no need to

    consider the "angle"? it is amazing !!

    thanks in advances ^ ^
  • edited November -1

    Hello,

    I cannot specify precisely how the rounding is performed. That depends on many factors and finally may be different on different CPU models.

    What do you mean by "depend on angle"? The intersection between two lines can be computed using vector and scalar products alone. No angle value needed.

    Matthias

Sign In or Register to comment.