• 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. Custom IC SKILL
  3. How do I find the intersection of a list within a range

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 14546
  • 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 find the intersection of a list within a range

johntling
johntling over 13 years ago
I want to find out whether my pin text coordinates is contained within a given rectangle pin coordinates (i.e. contained within the pin), how would I do this if I got the centerBox of the pin text coordinate, and then try to see whether that falls within the range of the pin coordinates.
  • Cancel
Parents
  • skillUser
    skillUser over 13 years ago

     Hi John,

    I'm not sure if there is a generic point-based function for this, there are the various dbLayer* prefix functions, like dbLayerInside, and there is also a leIsPointInsideFig function, but these work on shapes.  However, having said this, I would have thought that the test is relatively simple, the point's X has to be >= the box lower left X, and <= the box upper right X AND the point's Y has to be >= the box lower left Yand <= the box upper right Y.  Something like the following I think:

    
    
    procedure(CCSisPointInBox(pt box "ll")
      when(geCoordp(pt) && isBBox(box)
        when( xCoord(pt) >= xCoord(lowerLeft(box))  && 
              xCoord(pt) <= xCoord(upperRight(box)) &&
              yCoord(pt) >= yCoord(lowerLeft(box))  &&
              yCoord(pt) <= yCoord(upperRight(box))
            t
        ); when
      ); when
    ); procedure CCSisPointInBox
    
    
    

    I think that the above code does the trick?  It returns 't' if the conditions are all met, and nil otherwise, or if either the point is not a valid point, or the box is not a valid bounding box, as decided by the geCoordp and isBBox functions respectively.  The isLocation function could be used for the point, but I think that geCoordp is slightly more descriptive of what the function is used for.

    Best regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • skillUser
    skillUser over 13 years ago

     Hi John,

    I'm not sure if there is a generic point-based function for this, there are the various dbLayer* prefix functions, like dbLayerInside, and there is also a leIsPointInsideFig function, but these work on shapes.  However, having said this, I would have thought that the test is relatively simple, the point's X has to be >= the box lower left X, and <= the box upper right X AND the point's Y has to be >= the box lower left Yand <= the box upper right Y.  Something like the following I think:

    
    
    procedure(CCSisPointInBox(pt box "ll")
      when(geCoordp(pt) && isBBox(box)
        when( xCoord(pt) >= xCoord(lowerLeft(box))  && 
              xCoord(pt) <= xCoord(upperRight(box)) &&
              yCoord(pt) >= yCoord(lowerLeft(box))  &&
              yCoord(pt) <= yCoord(upperRight(box))
            t
        ); when
      ); when
    ); procedure CCSisPointInBox
    
    
    

    I think that the above code does the trick?  It returns 't' if the conditions are all met, and nil otherwise, or if either the point is not a valid point, or the box is not a valid bounding box, as decided by the geCoordp and isBBox functions respectively.  The isLocation function could be used for the point, but I think that geCoordp is slightly more descriptive of what the function is used for.

    Best regards,

    Lawrence.

    • 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