• 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. Allegro X PCB Editor
  3. Finding if a Cline is fully inside a Polygon(shape)

Stats

  • Replies 5
  • Subscribers 159
  • Views 2657
  • Members are here 0
More Content

Finding if a Cline is fully inside a Polygon(shape)

vramananx
vramananx over 11 years ago

Hi Guys

I have an unique problem to solve

 Imagine that your BGA ball has multiple dogbones connected to vias (through clines) and a bigger shape of same net overlapes it

 w.r.to Allegro this is fine and no DRC or warning since they are same-net, I want to delete/find only those clines which are completly inside the bBox of the larger shape

 I already have the  logic to narrow down the clines where both the startEnd of clinesegs are inside the bBox of a shape dbid

(I am using axlGeoPointInShape)

and a way to isolate those clinesegs where atleast one point is in the bBox

But check the following link 

 http://www.codeproject.com/Articles/371959/A-brute-force-approach-to-check-if-a-line-segment

 There are situations where the 2 points of a clineseg can just touch the bBox of the shape and it will be flagged as inside the bBox by my routine

Any help or thoughts would be awesome

Here is the procdure I wrote

procedure( _ClInorOutbBox(_sHp _mOde)
 prog((_clineList _NotInBox)
 _NotInBox = list()
 axlClearSelSet()
 axlSetFindFilter(?enabled list("noall" "CLINESEGS"), ?onButtons list("noall" "CLINESEGS"))
 
 _clineList = setof(x axlGetSelSet(axlAddSelectBox(_sHp->bBox)) x->net->name == _sHp->net->name)
 axlClearSelSet()
 case(_mOde
  ("OUT"
 _NotInBox = setof(y x
  and(axlGeoPointInShape(xCoord(xCoord(y->startEnd)):yCoord(xCoord(y->startEnd)) _sHp),
   axlGeoPointInShape(xCoord(yCoord(y->startEnd)):yCoord(yCoord(y->startEnd)) _sHp)) == nil
        )
   return(_NotInBox)
  );Outside
  ("IN"
 _NotInBox = setof(y x
  and(axlGeoPointInShape(xCoord(xCoord(y->startEnd)):yCoord(xCoord(y->startEnd)) _sHp),
   axlGeoPointInShape(xCoord(yCoord(y->startEnd)):yCoord(yCoord(y->startEnd)) _sHp)) == t
        )
   return(_NotInBox)
  );Inside 
  );case
 
 );prog
);procedure

  • Sign in to reply
  • Cancel
  • eDave
    eDave over 11 years ago

    It can be slow, but the method that I use for this type of thing is to use the axlPolyOperation command.

    Create a polygon for your bigger shape and "OR" it with a polygon created from each cline segment. If the result is multiple polygons, or the area of the resultant polygon is larger than the original, then the cline segment is not completely inside the shape.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • vramananx
    vramananx over 11 years ago

    Dave

    that is exactly the reason I am looking for other solution

     I have so many nodes it takes for ever, example 1000 nets/10 layers

     this is a small portion of a project I am working on, basically i want to flatten everything to static shapes and want to merge overlapping shpes of same net

     I though I can save some time by deleting the enveloped clines and avoiding their process time(polygon from db and polygon OR)

    I think I have a solution (but the above issue remains a clineseg touching the boundary of a shape)

     I will update the findings

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • eDave
    eDave over 11 years ago

    Ok. I sympathise.

    I'm surprised with your idea to convert shapes to static. As a PCB Design manager I would be unhappy about my designers doing that.

    It is reasonably easy to write code to check  that clines are within a shape because shape and cline boundaries can only contain lines and circular arcs. Calculating crossing or touching points between these objects is relatively trivial. Of course, you could als use axlAirGap but you might run into speed problems again.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • vramananx
    vramananx over 11 years ago

    Dave

    This project is kind of complicated

    Flattening the design to shapes (convert all the copper to static shape) will enable me to use the axlDBGetConnect to get all the connected via/pins

    why flatten, DBGetConnect won't work if cline/shape mix

    I don't want to give everything away but its OK

    I am trying to find choke points in via distribution,

    I am sure you can understand my logic,

    a single net with multiple pin/via has 2 islands on layer 1 and on the adjacent layer depending upon the number of vias/pins I see if there is a proper ration maintianed and I do this similar loop and travel down

     regards

    Added

    a single shape passed on to axlDBGetconnect would give me all the vias/pins, but cline/shape mix won't work, because I want to group things w.r.to their proximity and connection

    on the second layer I would look for consolidating shapes and similar query

    I still haven't nailed the logic but I am working on it :-)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • eDave
    eDave over 11 years ago
    OK. Good luck. Let us know how you get on.
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Cadence Guidelines

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