• 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 Design
  3. Virtuoso Layout XL/GXL -- rasterizing an anyAngle polygon...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 126
  • Views 2905
  • 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

Virtuoso Layout XL/GXL -- rasterizing an anyAngle polygon onto a grid

jack.holloway
jack.holloway over 10 years ago

Greetings all,

I'm laying out some complex metal structures in a backend process who's design rules only allow metal at multiple of 45 degree angles. Several of my structures utilize other angles, on the gross macroscopic level -- i.e. tapers, etc.

Is there a method (including a SKILL solution) to rasterize a drawn or defined polygon utilizing anyAngle for the snap mode (versus diagonal, horizontal, or vertical) or a microwave taper on to a process grid? It's understood that the edges would necessarily be jagged on the resolution of the grid size.

I am, admittedly, inexperienced with SKILL.

I was able to find a solution to rasterize a circle (http://community.cadence.com/cadence_technology_forums/f/38/t/22352), but it doesn't address my requirement. The alternative is to rasterize these shapes in MATLAB, generate a set of vertices and create a simple SKILL script to generate a polygon.

Any advice would be greatly appreciated.

-J 

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    Jack,

    I just wrote this - I didn't thoroughly test it, but hopefully it does what you want. For example, select the polygon, and do:

    abConvertPolygonToSteppedEdge(car(geGetSelSet()) 0.01)

    Regards,

    Andrew.

    /* abConvertPolygonToSteppedEdge.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Jul 28, 2015 
    Modified   
    By         
    
    Convert a non-orthogonal edged polygon to a stepped
    polygon (with grid-sized steps)
    
    ***************************************************
    
    SCCS Info: @(#) abConvertPolygonToSteppedEdge.il 07/28/15.10:40:52 1.1
    
    */
    
    /***************************************************************
    *                                                              *
    *         (abConvertPolygonToSteppedEdge polygon grid)         *
    *                                                              *
    *   Take a polygon object and update any non-orthonal edges    *
    *                 to be stepped in grid steps.                 *
    *                                                              *
    ***************************************************************/
    
    (defun abConvertPolygonToSteppedEdge (polygon grid)
      (let (newPoints lastPoint beginX endX beginY endY)
        (unless (equal (getq polygon objType) "polygon")
          (error "abConvertPolygonToSteppedEdge: %L is not a polygon - %L\n"
                 polygon (getq polygon objType)))
        (setq lastPoint (car (last (getq polygon points))))
        (foreach point (getq polygon points)
                 (if (or
                       (equal (setq endX (xCoord point)) 
                              (setq beginX (xCoord lastPoint)))
                       (equal (setq endY (yCoord point))
                              (setq beginY (yCoord lastPoint))))
                   (setq newPoints (tconc newPoints point))
                   (let (steps incrX incrY curX curY newX newY)
                     ;-------------------------------------------------------
                     ; Calculate the number of steps on the edge and the
                     ; increments to use
                     ;-------------------------------------------------------
                     (setq steps 
                           (max 
                             (ceiling (abs (quotient (difference endX beginX) grid)))
                             (ceiling (abs (quotient (difference endY beginY) grid)))))
                     (setq incrX (quotient (difference endX beginX) steps))
                     (setq incrY (quotient (difference endY beginY) steps))
                     (setq curX beginX)
                     (setq curY beginY)
                     (for step 1 (sub1 steps)
                          ;--------------------------------------------------
                          ; Calculate new points and put on grid
                          ;--------------------------------------------------
                          (setq newX 
                                (times (round (quotient 
                                                (plus beginX (times incrX step))
                                                grid)) grid))
                          (setq newY 
                                (times (round (quotient 
                                                (plus beginY (times incrY step))
                                                grid)) grid))
                          ;--------------------------------------------------
                          ; Only add the point if both the X and Y value changed
                          ; otherwise it's colinear
                          ;--------------------------------------------------
                          (unless (or (equal newX curX) (equal newY curY))
                            (setq newPoints (tconc newPoints (list curX curY)))
                            (setq newPoints (tconc newPoints (list newX curY)))
                            (setq newPoints (tconc newPoints (list newX newY)))
                            (setq curX newX)
                            (setq curY newY)
                            )
                          )
                     ;-------------------------------------------------------
                     ; Always add the final step
                     ;-------------------------------------------------------
                     (setq newPoints (tconc newPoints (list curX curY)))
                     (setq newPoints (tconc newPoints (list xCoord(point) curY)))
                     (setq newPoints (tconc newPoints point))
                     ))
                 (setq lastPoint point)
                 )
        ;--------------------------------------------------------------------
        ; Finally update the point list on the polygon and return it
        ;--------------------------------------------------------------------
        (putpropq polygon (car newPoints) points)
        polygon
        )
      )
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    Jack,

    I just wrote this - I didn't thoroughly test it, but hopefully it does what you want. For example, select the polygon, and do:

    abConvertPolygonToSteppedEdge(car(geGetSelSet()) 0.01)

    Regards,

    Andrew.

    /* abConvertPolygonToSteppedEdge.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Jul 28, 2015 
    Modified   
    By         
    
    Convert a non-orthogonal edged polygon to a stepped
    polygon (with grid-sized steps)
    
    ***************************************************
    
    SCCS Info: @(#) abConvertPolygonToSteppedEdge.il 07/28/15.10:40:52 1.1
    
    */
    
    /***************************************************************
    *                                                              *
    *         (abConvertPolygonToSteppedEdge polygon grid)         *
    *                                                              *
    *   Take a polygon object and update any non-orthonal edges    *
    *                 to be stepped in grid steps.                 *
    *                                                              *
    ***************************************************************/
    
    (defun abConvertPolygonToSteppedEdge (polygon grid)
      (let (newPoints lastPoint beginX endX beginY endY)
        (unless (equal (getq polygon objType) "polygon")
          (error "abConvertPolygonToSteppedEdge: %L is not a polygon - %L\n"
                 polygon (getq polygon objType)))
        (setq lastPoint (car (last (getq polygon points))))
        (foreach point (getq polygon points)
                 (if (or
                       (equal (setq endX (xCoord point)) 
                              (setq beginX (xCoord lastPoint)))
                       (equal (setq endY (yCoord point))
                              (setq beginY (yCoord lastPoint))))
                   (setq newPoints (tconc newPoints point))
                   (let (steps incrX incrY curX curY newX newY)
                     ;-------------------------------------------------------
                     ; Calculate the number of steps on the edge and the
                     ; increments to use
                     ;-------------------------------------------------------
                     (setq steps 
                           (max 
                             (ceiling (abs (quotient (difference endX beginX) grid)))
                             (ceiling (abs (quotient (difference endY beginY) grid)))))
                     (setq incrX (quotient (difference endX beginX) steps))
                     (setq incrY (quotient (difference endY beginY) steps))
                     (setq curX beginX)
                     (setq curY beginY)
                     (for step 1 (sub1 steps)
                          ;--------------------------------------------------
                          ; Calculate new points and put on grid
                          ;--------------------------------------------------
                          (setq newX 
                                (times (round (quotient 
                                                (plus beginX (times incrX step))
                                                grid)) grid))
                          (setq newY 
                                (times (round (quotient 
                                                (plus beginY (times incrY step))
                                                grid)) grid))
                          ;--------------------------------------------------
                          ; Only add the point if both the X and Y value changed
                          ; otherwise it's colinear
                          ;--------------------------------------------------
                          (unless (or (equal newX curX) (equal newY curY))
                            (setq newPoints (tconc newPoints (list curX curY)))
                            (setq newPoints (tconc newPoints (list newX curY)))
                            (setq newPoints (tconc newPoints (list newX newY)))
                            (setq curX newX)
                            (setq curY newY)
                            )
                          )
                     ;-------------------------------------------------------
                     ; Always add the final step
                     ;-------------------------------------------------------
                     (setq newPoints (tconc newPoints (list curX curY)))
                     (setq newPoints (tconc newPoints (list xCoord(point) curY)))
                     (setq newPoints (tconc newPoints point))
                     ))
                 (setq lastPoint point)
                 )
        ;--------------------------------------------------------------------
        ; Finally update the point list on the polygon and return it
        ;--------------------------------------------------------------------
        (putpropq polygon (car newPoints) points)
        polygon
        )
      )
    • 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