• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. RAVEL DRC Programming for IC Packaging and…
  3. How do I get a line's Angle?

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 23
  • Views 10769
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How do I get a line's Angle?

Rian
Rian over 10 years ago

How to you get at the angle of a line in Ravel land? Here's a snapshot of what I am after. We need to make sure the line is around 30 degrees. i.e. Between MIN=29.9 and MAX=30.1

  • Cancel
Parents
  • Bjoern L
    Bjoern L over 10 years ago

    There are a couple of different measurements for working with angles, depending on which angle you are looking for. The angle measurement returns the counter-clockwise angle between two linear objects in the range [0, 360]. The principal_value measurement can be used to normalize this angle to the range [-180, 180]. There is also axis_angle, which treats two linear objects as directionless axes and returns the smallest angle between them, which is going to be in the range [0, 90].

    I was not familiar with this "normalized" segment angle displayed in the Show Element window, but it seems to be the counter-clockwise angle within the quadrant from x or y coordinate axis to the segment. This angle will be the same regardless of segment direction, it will just shift the quadrant. If we have the angle from a unit vector [1, 0] to the segment, the normalized angle na can be expressed as a mod 90, or the reminder after dividing a with 90. Like in many programming languages, mod only works on integer numbers in Ravel, so we will have to express this a bit more convoluted as na = a - 90(floor(a/90)).

    Suppose that you have a relation mysegment with the segments that you want to check. You could then find this angle by:

    (define mysegment_angle
      (transform (s) mysegment
        (s (angle (CREATE_VECTOR 1 0) s))))

    (define mysgement_normalized
      (transform (s a) mysegment_angle
        (s a - 90.0*(floor a/90.0))))

    You would then subtract this from your constraint value and compare the absolute value with some epsilon.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Bjoern L
    Bjoern L over 10 years ago

    There are a couple of different measurements for working with angles, depending on which angle you are looking for. The angle measurement returns the counter-clockwise angle between two linear objects in the range [0, 360]. The principal_value measurement can be used to normalize this angle to the range [-180, 180]. There is also axis_angle, which treats two linear objects as directionless axes and returns the smallest angle between them, which is going to be in the range [0, 90].

    I was not familiar with this "normalized" segment angle displayed in the Show Element window, but it seems to be the counter-clockwise angle within the quadrant from x or y coordinate axis to the segment. This angle will be the same regardless of segment direction, it will just shift the quadrant. If we have the angle from a unit vector [1, 0] to the segment, the normalized angle na can be expressed as a mod 90, or the reminder after dividing a with 90. Like in many programming languages, mod only works on integer numbers in Ravel, so we will have to express this a bit more convoluted as na = a - 90(floor(a/90)).

    Suppose that you have a relation mysegment with the segments that you want to check. You could then find this angle by:

    (define mysegment_angle
      (transform (s) mysegment
        (s (angle (CREATE_VECTOR 1 0) s))))

    (define mysgement_normalized
      (transform (s a) mysegment_angle
        (s a - 90.0*(floor a/90.0))))

    You would then subtract this from your constraint value and compare the absolute value with some epsilon.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information