• 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. To shrink/grow the rectangle or polygon by factor and by...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 3864
  • 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

To shrink/grow the rectangle or polygon by factor and by specified direction (x or y)

Kevin Li
Kevin Li over 2 years ago

Hi, 

I am looking for the skill command or script to shrink/grow the rectangle or polygon by factor and by specified direction (x or y).

For example, I want a poly to shrink 90% only in x-direction.

I only found Edit-Advanced-Size-Increase Size By Direction can shrink/grow the poly/rect by direction but only in specified value.

Can anybody help me on this ?

Thanks,

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago

    There's no built-in function to do this - most commonly in layout you want to size rather than scale shapes (leSizeShape allows you to do a directional sizing of shapes, which is the SKILL equivalent of the UI command). So it would need some SKILL code to do what you want. A simplistic approach would be to scale just the x-coordinates of any object - easy enough for rectangles and polygons (and other rectangle-like and polygon-like objects) but for paths and pathSegs you might want to adjust the width depending on the direction of the path/pathSeg. You might want the object to be scaled around its centre. All of this would typically require some function that has a case statement to deal with each object type specifically.

    Hopefully that gives you some suggestions as to how to achieve this.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Kevin Li
    Kevin Li over 2 years ago in reply to Andrew Beckett

    Hi Andrew,

    Thanks for the reply.

    You mention that a simplistic approach would be to scale just the x-coordinates of any object, does this refer to using the leSizeShape command?
    I tried leSizeShape, but I found that it can only make the selected object expand/shrink in the X,Y direction at the same time. There is no parameter in the reference manual where can specify the direction, can you tell more about the solution to this problem?

    leSizeShape(
    d_shapeId
    g_resize
    )
    I also tried leStretchShape, but found that it needs to specify Boolean list so it can't be generalized to different shapes of poly.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to Kevin Li
    Kevin Li said:
    You mention that a simplistic approach would be to scale just the x-coordinates of any object, does this refer to using the leSizeShape command?

    No - because leSizeShape sizes (i.e. increases/decreases the dimension by an offset distance) rather than scales by a factor. As I said, there's no built-in function to scale an object (either with a single scale factor or a per-dimension scale factor).

    Kevin Li said:

    I tried leSizeShape, but I found that it can only make the selected object expand/shrink in the X,Y direction at the same time. There is no parameter in the reference manual where can specify the direction, can you tell more about the solution to this problem?

    leSizeShape(
    d_shapeId
    g_resize
    )

    The function was changed in IC6.1.8/ICADVM18.1 but it took a while for the documentation to catch up. If you look at the current documentation at Virtuoso Layout Suite SKILL Reference -- leSizeShape - leSizeShape you'll see that the second argument can be given as a list of four numbers to allow a directional size to be performed.

    Here's some ancient code that I wrote to scale uniformly (normally this would be done using the XScale UNIX utility these days) which might at least give you a starting point:

    /* abScale.il
    
    Author     A.D.Beckett
    Group      Structured Custom, Cadence Design Systems Ltd
    Machine    SUN
    Date       Oct 25, 1995 
    Modified   
    By         
    
    Various scaling routines to aid change of DBUPerUU
    
    ***************************************************
    
    SCCS Info: @(#) abScale.il 03/11/22.16:37:27 1.1
    
    */
    
    /***************************************************************
    *                                                              *
    *                (abScaleNumber number factor)                 *
    *                                                              *
    *             Scale a number by the scale factor.              *
    *                                                              *
    ***************************************************************/
    
    (procedure (abScaleNumber number factor)
      (times number factor))
    
    /***************************************************************
    *                                                              *
    *                     (abScalePoint point)                     *
    *                                                              *
    *  Scale a point. Note that it inherits the variable factor.   *
    *                                                              *
    ***************************************************************/
    
    (procedure (abScalePoint point)
      (list (times (xCoord point) factor)
    	(times (yCoord point) factor)))
    
    /***************************************************************
    *                                                              *
    *               (abScalePointList points factor)               *
    *                                                              *
    *           Scale a list of points by a scale factor           *
    *                                                              *
    ***************************************************************/
    
    (procedure (abScalePointList points factor)
      (mapcar 'abScalePoint points))
    
    /***************************************************************
    *                                                              *
    *                  (abScaleObject obj factor)                  *
    *                                                              *
    *              Scale an object by a scale factor               *
    *                                                              *
    ***************************************************************/
    
    (procedure (abScaleObject obj factor)
      (case (dbGetq obj objType)
    	("arc" 
    	 (dbSetq obj (abScalePointList (dbGetq obj ellipseBBox) factor) ellipseBBox)
    	 )
    	("dot" 
    	 (dbSetq obj (abScaleNumber (dbGetq obj height) factor) height)
    	 (dbSetq obj (abScaleNumber (dbGetq obj width) factor) width)
    	 (dbSetq obj (abScalePoint (dbGetq obj xy)) xy)
    	 )
    	("donut" 
    	 (dbSetq obj (abScaleNumber (dbGetq obj outerRadius) factor) outerRadius)
    	 (dbSetq obj (abScaleNumber (dbGetq obj innerRadius) factor) innerRadius)
    	 (dbSetq obj (abScalePoint (dbGetq obj xy)) xy)
    	 )
    	("ellipse"
    	 (dbSetq obj (abScalePointList (dbGetq obj bBox) factor) bBox)
    	 )
    	("label" 
    	 (dbSetq obj (abScaleNumber (dbGetq obj height) factor) height)
    	 (dbSetq obj (abScalePoint (dbGetq obj xy)) xy)
    	 )
    	("line"
    	 (dbSetq obj (abScalePointList (dbGetq obj points) factor) points)
    	 )
    	("path"
    	 (dbSetq obj (abScalePointList (dbGetq obj points) factor) points)
    	 (dbSetq obj (abScaleNumber (dbGetq obj width) factor) width)
    	 (dbSetq obj (abScaleNumber (dbGetq obj beginExt) factor) beginExt)
    	 (dbSetq obj (abScaleNumber (dbGetq obj endExt) factor) endExt)
    	 )
    	("polygon"
    	 (dbSetq obj (abScalePointList (dbGetq obj points) factor) points)
    	 )
    	("rect"
    	 (dbSetq obj (abScalePointList (dbGetq obj bBox) factor) bBox)
    	 )
    	("mosaic"
    	 (dbSetq obj (abScalePoint (dbGetq obj xy)) xy)
    	 (dbSetq obj (abScaleNumber (dbGetq obj maxExtension) factor) maxExtension)
    	 (dbSetq obj (abScaleNumber (dbGetq obj uX) factor) uX)
    	 (dbSetq obj (abScaleNumber (dbGetq obj uY) factor) uY)
    	 )
    	("inst"
    	 (dbSetq obj (abScalePoint (dbGetq obj xy)) xy)
    	 )
    	))
    
    /***************************************************************
    *                                                              *
    *              (abScaleObjectList objList factor)              *
    *                                                              *
    *          scale a list of objects by a scale factor           *
    *                                                              *
    ***************************************************************/
    
    (procedure (abScaleObjectList objList factor)
      (foreach object objList (abScaleObject object factor)))
    
    /***************************************************************
    *                                                              *
    *               (abScaleAllObjects view factor)                *
    *                                                              *
    *             scale all the objects in a cellview              *
    *                                                              *
    ***************************************************************/
    
    (procedure (abScaleAllObjects view factor)
      (abScaleObjectList (dbGetq view instances) factor)
      (abScaleObjectList (dbGetq view shapes) factor)
      (abScaleObjectList (dbGetq view mosaics) factor)
      )
    
    • Cancel
    • Vote Up +2 Vote Down
    • Cancel
  • Kevin Li
    Kevin Li over 2 years ago in reply to Andrew Beckett

    Thank you so much!  Andrew

    the update of leSizeShape may help accomplish what I need.

    Have a good day.

    • 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