• 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. Allegro X Scripting - Skill
  3. Expand/Contract -> Shape Boundary Segments

Stats

  • Replies 7
  • Subscribers 19
  • Views 2529
  • Members are here 0
More Content

Expand/Contract -> Shape Boundary Segments

SambaKantipudi
SambaKantipudi 10 months ago

Hello All, 

I would like to select Cutout Shape(s) and then create a new shape on "ROUTE KEEPOUT/ALL", with an expansion value of 0.4mm. Now I would like to contract the horizontal line segments/paths of the newly created "ROUTE KEEPOUT/ALL" excluding the arc segments with -0.15mm.

Unfortunately, I cannot attach an image to better illustrate.

I would like to achieve the above result using Skill.

Requesting someone for help.

Thanks in advance

Samba

  • Cancel
  • Sign in to reply
Parents
  • DavidJHutchins
    DavidJHutchins 10 months ago

    ;;The first step would be to convert the existing shape into a polygon:

    (ShapeList = (axlGetSelSet))
    foreach(shape ShapeList
    if(((shape->objType) == "shape") then
       (PolyList = axlPolyExpand( axlPolyFromDB( shape ?layer (shape->layer) ?padType "REGULAR") Radius 'ACU_BLUNT))

    ;;then contract the outline & build the new shape

      (Offset = (axlMKSConvert -0.15 "MM")

      (layer = "ROUTE KEEPOUT/ALL")

      foreach( poly PolyList
         (RectList = axlPolyExpand(poly Offset 'ACU_BLUNT)) 

         foreach( result RectList
            (dbids = (axlDBCreateShape result t layer nil nil))
        )

      )

    )

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • DavidJHutchins
    DavidJHutchins 10 months ago

    ;;The first step would be to convert the existing shape into a polygon:

    (ShapeList = (axlGetSelSet))
    foreach(shape ShapeList
    if(((shape->objType) == "shape") then
       (PolyList = axlPolyExpand( axlPolyFromDB( shape ?layer (shape->layer) ?padType "REGULAR") Radius 'ACU_BLUNT))

    ;;then contract the outline & build the new shape

      (Offset = (axlMKSConvert -0.15 "MM")

      (layer = "ROUTE KEEPOUT/ALL")

      foreach( poly PolyList
         (RectList = axlPolyExpand(poly Offset 'ACU_BLUNT)) 

         foreach( result RectList
            (dbids = (axlDBCreateShape result t layer nil nil))
        )

      )

    )

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • SambaKantipudi
    SambaKantipudi 10 months ago in reply to DavidJHutchins

    Hello David,
    Thankyou.
    My requirement is not fulfilled. Maybe, I could not explain my requirement as a professional understands!
    This portal doesn't allow me to upload an image.
    Can I have your Email ID, so I could share the image of my requirement??
    Thanks in advance

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • DavidJHutchins
    DavidJHutchins 10 months ago in reply to SambaKantipudi

    my email is:

    mtnhomecadservices@gmail.com

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • DavidJHutchins
    DavidJHutchins 9 months ago in reply to DavidJHutchins

    After looking at the image you provided, below is how I would attempt to code this:

    First, create 2 temp layers ( temp_lines & temp_arcs )

    Then use 'Shape>Decompose Shape' to expand the 'board geometry/cutout' shape by 0.15mm to temp_lines
    Then delete any 'arc' data on temp_lines

    Then use 'Shape>Decompose Shape' to expand the 'board geometry/cutout' shape by 0.40mm to temp_arcs
    Then delete any 'line' data on temp_arcs

    Then for each arc endpoint, find the closest line endpoint by searching within the arc radius for endpoints & create a line segment between the arc & line endpoints on temp_arcs

    Finally construct the 'route keepout/all' shape from the segments on temp_arcs

    Post-process by deleting everything on temp_lines & temp_arcs and deleting those layers

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • eDave
    eDave 9 months ago in reply to DavidJHutchins

    This was my solution for him. I would prefer to use maths than do it with polygons but this was easier:

    poly = car(axlPolyFromDB(cutoutDBID))
    routePoly = car(axlPolyExpand(poly, 0.4, 'ALL_ARC)); Expand polygon by 0.4
    lineSegments = setof(seg, cutoutDBID ->segments, seg ->objType == "line")

    end1Pt1 = car(car(lineSegments) ->startEnd)
    end1Pt2 = cadr(cadr(lineSegments) ->startEnd)
    end2Pt1 = cadr(car(lineSegments) ->startEnd)
    end2Pt2 = car(cadr(lineSegments) ->startEnd)

    end1Pt1 = axlMUniVector(end2Pt1, end1Pt1, axlDistance(end1Pt1, end2Pt1) - 0.1)
    end1Pt2 = axlMUniVector(end2Pt2, end1Pt2, axlDistance(end1Pt2, end2Pt2) - 0.1)

    end2Pt1 = axlMUniVector(end1Pt1, end2Pt1, axlDistance(end1Pt1, end2Pt1) - 0.1)
    end2Pt2 = axlMUniVector(end1Pt2, end2Pt2, axlDistance(end1Pt2, end2Pt2) - 0.1)

    pt1a1 = axlMUniVector(end1Pt2, end1Pt1, axlDistance(end1Pt1, end1Pt2) + 0.15)
    pt1b1 = axlMUniVector(end1Pt2, end1Pt1, axlDistance(end1Pt1, end1Pt2) + 0.41)

    pt2a1 = axlMUniVector(end1Pt1, end1Pt2, axlDistance(end1Pt1, end1Pt2) + 0.15)
    pt2b1 = axlMUniVector(end1Pt1, end1Pt2, axlDistance(end1Pt1, end1Pt2) + 0.41)

    pt1a2 = axlMUniVector(end2Pt2, end2Pt1, axlDistance(end2Pt1, end2Pt2) + 0.15)
    pt1b2 = axlMUniVector(end2Pt2, end2Pt1, axlDistance(end2Pt1, end2Pt2) + 0.41)

    pt2a2 = axlMUniVector(end2Pt1, end2Pt2, axlDistance(end2Pt1, end2Pt2) + 0.15)
    pt2b2 = axlMUniVector(end2Pt1, end2Pt2, axlDistance(end2Pt1, end2Pt2) + 0.41)

    path = axlPathStart(list(pt1a1, pt1b1, pt1b2, pt1a2, pt1a1))
    rectPoly1 = car(axlPolyFromDB(path))

    path = axlPathStart(list(pt2a1, pt2b1, pt2b2, pt2a2, pt2a1))
    rectPoly2 = car(axlPolyFromDB(path))

    routePoly = car(axlPolyOperation(routePoly, list(rectPoly1, rectPoly2), 'ANDNOT))

    shp = car(axlDBCreateShape(routePoly, t, "ROUTE KEEPOUT/ALL"))

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Cadence Guidelines

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