• 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. Is there a way to get outer points of selected polygons...

Stats

  • Locked Locked
  • Replies 14
  • Subscribers 144
  • Views 21531
  • 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

Is there a way to get outer points of selected polygons?

kbhow
kbhow over 14 years ago

Hi,

Is there any SKILL codes which able to get the outer points of selected objects?

I was trying to create a new function which may required to get the outer points of selected objects (polygon/rectangle/instances and etc). I want to get a list of points where i can use it to create a polygon which cover all selected objects.

Example, let say i have selected 10 polygons, and i want a function to return me a list of outer points of my selected object. Can someone help?

Thanks

How

  • Cancel
  • babji
    babji over 14 years ago

     You can do a union of all the selected objects bboxes. trBBoxUnion( geGetSelSet()~>bBox )

     

     procedure( trBBoxUnion( bBoxList )
    let( ( llxList llyList
    urxList uryList
    minllx minlly
    maxurx maxury
    )
    llxList = foreach( mapcar bBox bBoxList
    xCoord( lowerLeft( bBox )))
    llyList = foreach( mapcar bBox bBoxList
    yCoord( lowerLeft( bBox )))
    urxList = foreach( mapcar bBox bBoxList
    xCoord( upperRight( bBox )))
    uryList = foreach( mapcar bBox bBoxList
    yCoord( upperRight( bBox )))
    minllx = apply( 'min llxList )
    minlly = apply( 'min llyList )
    maxurx = apply( 'max urxList )
    maxury = apply( 'max uryList )
    list( minllx:minlly maxurx:maxury )
    ) ; let
    ) ; procedure
    trBBoxUnion( list( list(0:0 100:100) list(50:50 150:150)))

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 14 years ago

    Hi How,

    I presume that you are asking for the actual points of the resultant combined shape, rather than the overall bounding box?  I think that the easiest way to get this would be to use something like dbLayerAnd on the input shapes to create a temporary shape, get the points from this shape and then delete it when you're done with it. It may be a little clunky, but it would be simpler than other methods that I can think of. 

    Hope this helps,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • kbhow
    kbhow over 14 years ago

    Hi Pradesh,

    Thanks for your propose solution but this function only able to get the bounding box( bBox) of the selected objects. Thanks a lot.

    I was looking for a function which able to get the outer shape (polygon) for a selected object. It works similar like mark net, when you mark a net, it will highlight only the outer shape of the net, looks like big highlighted polygon. My intention to get the this big highlighted polygon's points and proceed for next step.

    Thanks :)

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • kbhow
    kbhow over 14 years ago

    Hi Lawrewnce,

    Thanks for your propose solution. I did try several approach including dbLayerAnd but it doesn't work when selected shapes is not overlapping each other. As a result, this function only creates individual shapes.

    Any idea? I can't figure out any way in getting this done. Hoping there are ideas from anyone in this forum. Thanks a bunch.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • StefanSL
    StefanSL over 14 years ago
    Hi kbhow,

    regarding the boolean operation, i assume dbLayerOR should be more useful than ANDcause you want to combine all your selected objects; of course, just ORing the shapes will result in a shape covering all your shapes but you might get more than one shape and your shape might have holes in it.

    If i understand your needs correctly, the keyword "convex hull" might be what you are looking for:  the minimum convex polygon including all your shapes.

    Starting point would be a list of all points of all your selected shapes; searching for "convex hull", "computational geometry" should lead to an algorithm to get the convex hull from this set of points; possibly you should export the problem to a perl-script for better performance and access to trigonometric functions.

    If the convex hull is too large, the problem will become much more complicated cause you'd have to define how concave, how "deep" concave the polygon may be.

    Kind regards

    Stefan
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • kbhow
    kbhow over 14 years ago

    Hi Stefan,

    Sorry that i can't really get what you means. Any where thanks.

    I was trying to get outer shape of selected objects as below.

                        ___                                                             _ _ _

                       |_ _|                                                           |       |

             ____        ___                                                ___ |       |___

     ___|        |     |      |____                            _ __|                         |____

    |__  ___  |      |_______|           =>           |______________________|

     

    Hoping this help to make my question clear. Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • StefanSL
    StefanSL over 14 years ago

    Hi kbhow,

    the "convex hull" would look like this:

                        ___                                                        _ _ _
                      
    |_ _|                                                    /         \

             ____        ___                                               /             \

     ___|        |     |      |____                                  /                   \

    |__  ___  |      |_______|           =>                 |_ ________  |

     

    just the outer points are connected in a way that all points are inside the new
    polygon; an interesting geometrical problem, there are some algorithms available.

    Possibly you could achieve a result similar to your drawing by upsizing all shapes
    to an intermediate layer by an amount that's sufficient to close all gaps, the shapes will merge,
    then downsizing by the same amount, the outlines should look like your drawing but
    the gaps will stay closed.

    Size resp. leHiSize() will not merge the shapes,
    dbLayerSize() or "Tools - Layer generation ... GROW" should do the job.

     kind regards

    Stefan

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    How,

    A good place to start would be with http://en.wikipedia.org/wiki/Convex_hull and  http://en.wikipedia.org/wiki/Convex_hull_algorithms

    That said, I'm not sure it's quite a convex hull you want, because I suspect you want it to follow the outer edges rather than being like an elastic band around all the outermost points.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • kbhow
    kbhow over 14 years ago

     Hi Andrew,

    Thanks for the sharing.

    Ya, you're right.I actually want the outer edge rather than convex. Do you have any idea? At the same time, i'll go through the link the you share, hoping can get some hint or inspiration from that.

    Regards,

    How

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • StefanSL
    StefanSL over 14 years ago

    Hello How,

    besides of the convex hull approach, my second proposal was to apply a
    upsizing-/downsizing-cycle to your shapes, did you already try if this fulfills your needs?

    si=geGetSelectedSet()
    cvid = geGetEditCellView()
    stmp=dbLayerSize(cvid "TMPLAYER" si 3.5)
    so=dbLayerSize(cvid "TGTLAYER" stmp -3.5)

    applying a suitable sizing instead of 3.5um will merge your
    shapes, even from more than one layer, into one shape;
    downsizing this shape by the same amount will result in
    a shape that should do what you want...

    kind regards

    Stefan

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
>

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