• 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 to check the 90 degree angle on the route

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 142
  • Views 11182
  • 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 to check the 90 degree angle on the route

yankunRen
yankunRen over 4 years ago

Hi all

      I have a problem at work. I use virtuoso 6.1.6-64b.

      As shown below. How can I use skill to check the 90 degree angle on the path (or pathSeg、polygon、rect).

      Hope you can give me some ideas, or some skill functions. 

      Or use other methods or tools to check. 

      

Thank All.

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

    You can use this code below (I just quickly wrote this, so hopefully you can see the approach to use). 

    Given a set of selected objects, using abCheckObjectsOrthogonal(geGetSelSet()) will return t if all objects only have 90 degree angles, or nil if any do not.

    Regards,

    Andrew

    /* abCheckObjectsOrthogonal.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Jul 09, 2021 
    Modified   
    By         
    
    Function to determine whether an object or list of objects
    are all orthogonal (i.e. have 90 degree angles only)
    
    ***************************************************
    
    SCCS Info: @(#) abCheckObjectsOrthogonal.il 07/09/21.11:03:43 1.1
    
    */
    
    /*****************************************************************
    *                                                                *
    *               abCheckObjectsOrthogonal(objects)                *
    *                                                                *
    *      Given an object (or list of objects) return whether       *
    *  all objects are orthogonal (if any object is not orthogonal   *
    * then return nil). Only checks rect (which must be orthogonal), *
    *      polygon, path, line and pathSeg - everything else is      *
    *  orthgonal (perhaps ellipses, donuts and arcs should not be,   *
    *         but these don't appear in layout that often!)          *
    *                                                                *
    *****************************************************************/
    
    procedure(abCheckObjectsOrthogonal(objects)
        let((points closed orthogonal lastPt)
            unless(listp(objects)
                objects=list(objects)
            )
            forall(object objects
                {
                    orthogonal=nil
                    ;--------------------------------------------------------
                    ; Determine the point list and whether the point list
                    ; is for a closed shape
                    ;--------------------------------------------------------
                    case(object~>objType
                        ("rect"
                            orthogonal=t
                        )
                        ("polygon"
                            points=object~>points
                            closed=t
                        )
                        (("path" "line")
                            points=object~>points
                            closed=nil
                        )
                        ("pathSeg"
                            points=list(object~>beginPt object~>endPt)
                            closed=nil
                        )
                        (t
                            points=nil
                            closed=nil
                        )
                    )
    		;--------------------------------------------------------
    		; Successive points either have the same x or same y
    		; to be orthogonal
    		;--------------------------------------------------------
                    unless(orthogonal
                        lastPt=car(points)
                        orthogonal=forall(point cdr(points)
                            prog1(
                                xCoord(point)==xCoord(lastPt) ||
                                    yCoord(point)==yCoord(lastPt)
                                lastPt=point
                            )
                        )
                        when(closed && orthogonal
                            orthogonal=
                                xCoord(car(points))==xCoord(lastPt) ||
                                    yCoord(car(points))==yCoord(lastPt)
                        )
                    )
                    orthogonal
                }
            )
        )
    )
    
    

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 4 years ago

    You can use this code below (I just quickly wrote this, so hopefully you can see the approach to use). 

    Given a set of selected objects, using abCheckObjectsOrthogonal(geGetSelSet()) will return t if all objects only have 90 degree angles, or nil if any do not.

    Regards,

    Andrew

    /* abCheckObjectsOrthogonal.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Jul 09, 2021 
    Modified   
    By         
    
    Function to determine whether an object or list of objects
    are all orthogonal (i.e. have 90 degree angles only)
    
    ***************************************************
    
    SCCS Info: @(#) abCheckObjectsOrthogonal.il 07/09/21.11:03:43 1.1
    
    */
    
    /*****************************************************************
    *                                                                *
    *               abCheckObjectsOrthogonal(objects)                *
    *                                                                *
    *      Given an object (or list of objects) return whether       *
    *  all objects are orthogonal (if any object is not orthogonal   *
    * then return nil). Only checks rect (which must be orthogonal), *
    *      polygon, path, line and pathSeg - everything else is      *
    *  orthgonal (perhaps ellipses, donuts and arcs should not be,   *
    *         but these don't appear in layout that often!)          *
    *                                                                *
    *****************************************************************/
    
    procedure(abCheckObjectsOrthogonal(objects)
        let((points closed orthogonal lastPt)
            unless(listp(objects)
                objects=list(objects)
            )
            forall(object objects
                {
                    orthogonal=nil
                    ;--------------------------------------------------------
                    ; Determine the point list and whether the point list
                    ; is for a closed shape
                    ;--------------------------------------------------------
                    case(object~>objType
                        ("rect"
                            orthogonal=t
                        )
                        ("polygon"
                            points=object~>points
                            closed=t
                        )
                        (("path" "line")
                            points=object~>points
                            closed=nil
                        )
                        ("pathSeg"
                            points=list(object~>beginPt object~>endPt)
                            closed=nil
                        )
                        (t
                            points=nil
                            closed=nil
                        )
                    )
    		;--------------------------------------------------------
    		; Successive points either have the same x or same y
    		; to be orthogonal
    		;--------------------------------------------------------
                    unless(orthogonal
                        lastPt=car(points)
                        orthogonal=forall(point cdr(points)
                            prog1(
                                xCoord(point)==xCoord(lastPt) ||
                                    yCoord(point)==yCoord(lastPt)
                                lastPt=point
                            )
                        )
                        when(closed && orthogonal
                            orthogonal=
                                xCoord(car(points))==xCoord(lastPt) ||
                                    yCoord(car(points))==yCoord(lastPt)
                        )
                    )
                    orthogonal
                }
            )
        )
    )
    
    

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • yankunRen
    yankunRen over 4 years ago in reply to Andrew Beckett

    Thank you for your help, I have made progress.

    Regards

    yankun

    • 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