• 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. Required skill help to create circle, triangle, square,...

Stats

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

Required skill help to create circle, triangle, square, pentagon, hexagon donut creation

jpraveen
jpraveen over 2 years ago

Hi,

I am looking forward to draw a triangle, square, pentagon, hexagon with donut using path segment. Any help will be helpful.

Thanks,

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago

    This is really not clear. By "path segment" do you mean "pathSeg" objects? Because if you do, it won't work because pathSegs are only supported on 45-degree multiples. If you don't mean that, what do you mean? A screenshot of manually drawn shapes would help.

    Andrew

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

    Hi Andrew,

    Thanks for reply. Please find the image for the shapes which i need help to develop skill code.

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

    Well, this is just usage of dbCreateDonut, dbCreatePathSeg and a bit of maths. I threw together the code below as an illustration. First of all, the CCFcreateDiagPathSeg is just using the suggested approach for creating diagonal pathSegs with octagonal ends as described in the documentation for dbPathSeg. The rest of the functions are each creating the other objects - and all have been written to return a list of the resulting objects. Of course, change the maths to suit your needs - this was just an illustration.

    This does seem a rather strange thing to want to do, but I'm sure you have your reasons!

    procedure(CCFcreateDiagPathSeg(cv layer width beginPt endPt)
      let((mfgGrid diagWidth halfDiag halfWidth)
        mfgGrid=techGetMfgGridResolution(techGetTechFile(cv))
        diagWidth=round(width*sqrt(2)/mfgGrid)*mfgGrid
        halfDiag=diagWidth/2.0
        halfWidth=width/2.0
        dbCreatePathSeg(cv layer beginPt endPt diagWidth "custom" "custom" 
          list(halfDiag halfDiag list(halfWidth halfWidth halfDiag halfWidth halfWidth halfDiag)))
      )
    )
    
    procedure(CCFcreateRing(layer radius width @optional (origin 0:0) (cv geGetEditCellView()))
      ; assume that the radius is the radius of the centre line (there isn't really a centre
      ; line since it's a donut, but the centre of the ring path)
      list(dbCreateDonut(cv layer origin radius+width/2.0 radius-width/2.0))
    )
    
    procedure(CCFcreateTriangle(layer bottomLength width @optional (origin 0:0) (cv geGetEditCellView()))
      let((halfBottom)
        destructuringBind((origX origY) origin
          halfBottom=bottomLength/2.0
          list(
            CCFcreateDiagPathSeg(cv layer width origin origX+halfBottom:origY+halfBottom)
            CCFcreateDiagPathSeg(cv layer width origX+halfBottom:origY+halfBottom origX+bottomLength:origY)
            dbCreatePathSeg(cv layer origin origX+bottomLength:origY width "truncate" "truncate")
          )
        )
      )
    )
    
    procedure(CCFcreateSquare(layer edge width @optional (origin 0:0) (cv geGetEditCellView()))
      destructuringBind((origX origY) origin
        ; mapcon is like mapcan (it concatenates), but behaves like map (gets the remaining list)
        ; allows us to see the first two points in the remaining list to create the side
        foreach(mapcon remSide list(origin origX:origY+edge origX+edge:origY+edge origX+edge:origY origin)
          when(cdr(remSide)
            list(dbCreatePathSeg(cv layer car(remSide) cadr(remSide) width "extend" "extend"))
          )
        )
      )
    )
    
    procedure(CCFcreatePentagon(layer bottomLength sideLength width 
        @optional (origin 0:0) (cv geGetEditCellView()))
      let((halfBottom)
        halfBottom=bottomLength/2.0
        destructuringBind((origX origY) origin
          list(
            CCFcreateDiagPathSeg(cv layer width 
              origX:origY+sideLength origX+halfBottom:origY+sideLength+halfBottom)
            CCFcreateDiagPathSeg(cv layer width 
              origX+halfBottom:origY+sideLength+halfBottom origX+bottomLength:origY+sideLength)
            dbCreatePathSeg(cv layer origin origX:origY+sideLength width "extend" "truncate")
            dbCreatePathSeg(cv layer 
              origX+bottomLength:origY origX+bottomLength:origY+sideLength 
              width "extend" "truncate")
            dbCreatePathSeg(cv layer origin origX+bottomLength:origY width "truncate" "truncate")
          )
        )
      )
    )
    
    procedure(CCFcreateHexagon(layer bottomLength sideLength topLength width 
        @optional (origin 0:0) (cv geGetEditCellView()))
      let((topOffset)
        topOffset=(bottomLength-topLength)/2.0
        destructuringBind((origX origY) origin
          list(
            CCFcreateDiagPathSeg(cv layer width 
              origX:origY+sideLength origX+topOffset:origY+sideLength+topOffset)
            CCFcreateDiagPathSeg(cv layer width 
              origX+bottomLength-topOffset:origY+sideLength+topOffset origX+bottomLength:origY+sideLength)
            dbCreatePathSeg(cv layer
              origX+topOffset:origY+sideLength+topOffset
              origX+bottomLength-topOffset:origY+sideLength+topOffset
              width "truncate" "truncate")
            dbCreatePathSeg(cv layer origin origX:origY+sideLength width "extend" "truncate")
            dbCreatePathSeg(cv layer 
              origX+bottomLength:origY origX+bottomLength:origY+sideLength 
              width "extend" "truncate")
            dbCreatePathSeg(cv layer origin origX+bottomLength:origY width "truncate" "truncate")
          )
        )
      )
    )
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • jpraveen
    jpraveen over 2 years ago in reply to Andrew Beckett

    Thank you Andrew for sharing. 

    • 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