Home > Community > Forums > PCB SKILL > Detect interception between line and arc or arc and arc

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Detect interception between line and arc or arc and arc 

Last post Sun, Nov 4 2012 5:16 PM by eDave. 6 replies.
Started by SkilSiao 01 Nov 2012 10:02 PM. Topic has 6 replies and 1366 views
Page 1 of 1 (7 items)
Sort Posts:
  • Thu, Nov 1 2012 10:02 PM

    • SkilSiao
    • Top 200 Contributor
    • Joined on Wed, Oct 12 2011
    • Posts 38
    • Points 565
    Detect interception between line and arc or arc and arc Reply

    Hi All, 

    is there a function to detect any intersection between straight line and arc?

    Given that both of the objects are Lines... 

    the axl_ol_ol2 function is able to detect straight line and straight line intersection only. 

    • Post Points: 50
  • Fri, Nov 2 2012 11:54 AM

    • knuhcrek
    • Not Ranked
    • Joined on Tue, Jul 29 2008
    • Posts 7
    • Points 95
    Re: Detect interception between line and arc or arc and arc Reply

    That function merely fixes axl_ol_ol, as you have found. What is needed is more robust function that can compare any two segments and return nil (if there is no intersection) or a list of intersection points, after you screened out the special cases where the lines or arcs are identical. Should easily be handled by basic trigonometry  and some equation-solving.

    line-line  --  nil or 1 intersection point

    line-arc   --  nil or 1 or 2 i-points

    arc-line   --  nil or 1 or 2 i-points

    arc-arc    --  nil or 1 or 2  i-points

     

    Chris Walters

    rusty former Cadence guru

     

    • Post Points: 20
  • Sat, Nov 3 2012 7:01 PM

    • SkilSiao
    • Top 200 Contributor
    • Joined on Wed, Oct 12 2011
    • Posts 38
    • Points 565
    Re: Detect interception between line and arc or arc and arc Reply

    Hi Christ,

    Thanks for the suggestion. 

    It seems like no existing function can achieve that and we need to write our own.

    one of the algo i am thinking of is like this:

    break the arcs into multiple (i) segments, then write a for i loop to:

    1. get the start and end point of each segment.

    2. use axl_ol_ol2 to get the intersection point and distance with the line or another arc's line segment.

    3. store the interception points or distances (if no intersection). 

    after the for loop, we can have the intersection points or min distance.

    larger the i, more accurate the result.

    • Post Points: 5
  • Sat, Nov 3 2012 11:17 PM

    • fxffxf
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • ., AK
    • Posts 283
    • Points 4,525
    Re: Detect interception between line and arc or arc and arc Reply
    If both objects are dbids then try axlAirGap; the 'enhanced option should provide additional info.
    • Post Points: 5
  • Sun, Nov 4 2012 4:52 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 687
    • Points 14,555
    Re: Detect interception between line and arc or arc and arc Reply

    See attached.

    DEFn_arcLineSegmentIntersections - find the intersection points between an arc and a line segment

    DEFn_arcArcIntersections - find the intersection points of two arcs

    DEFn_circleLineIntersections - find the intersection points of an circle and a line

    DEFn_circleCircleIntersections - find the intersection points of two circles

     

    Dave Elder, Tait Communications
    • Post Points: 20
  • Sun, Nov 4 2012 5:00 PM

    • SkilSiao
    • Top 200 Contributor
    • Joined on Wed, Oct 12 2011
    • Posts 38
    • Points 565
    Re: Detect interception between line and arc or arc and arc Reply

    Hi eDave, Thank you very much. (I haven't tried out though)

    you have always been very helpful.  =) 

    Hi fxffxf, axlAirGap does NOT support lines dbid and always returns nil

    you may want to tried out, assume aa and bb are two dbids of Lines on Etch/Surface,

    Skill>axlAirGap(aa bb nil 'enhanced)

    nil

     

    • Post Points: 20
  • Sun, Nov 4 2012 5:16 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 687
    • Points 14,555
    Re: Detect interception between line and arc or arc and arc Reply
    Frank's suggestion works well if you pass line segments, not lines.
    Dave Elder, Tait Communications
    • Post Points: 5
Page 1 of 1 (7 items)
Sort Posts:
Started by SkilSiao at 01 Nov 2012 10:02 PM. Topic has 6 replies.