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

## Email

Recipients email * (separate multiple addresses with commas)

Message *

 Send yourself a copy

## Subscribe

Intro copy of the newsletter section here, some intro copy of the newsletter. Instruction of how to subscribe to this newsletter.

First Name *

Last Name *

Email *

Company / Institution *

 Send Yourself A Copy

# 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 1333 views
• #### Thu, Nov 1 2012 10:02 PM

• SkilSiao
• Joined on Wed, Oct 12 2011
• Posts 38
• Points 565
Detect interception between line and arc or arc and arc
 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
• Joined on Tue, Jul 29 2008
• Posts 7
• Points 95
Re: Detect interception between line and arc or arc and arc
 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 pointline-arc   --  nil or 1 or 2 i-pointsarc-line   --  nil or 1 or 2 i-pointsarc-arc    --  nil or 1 or 2  i-points  Chris Waltersrusty former Cadence guru
• Post Points: 20
• #### Sat, Nov 3 2012 7:01 PM

• SkilSiao
• Joined on Wed, Oct 12 2011
• Posts 38
• Points 565
Re: Detect interception between line and arc or arc and arc
 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
• Joined on Thu, Jul 17 2008
• ., AK
• Posts 277
• Points 4,535
Re: Detect interception between line and arc or arc and arc
 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
• Joined on Sun, Jul 13 2008
• Christchurch, 00-NZ
• Posts 668
• Points 14,135
Re: Detect interception between line and arc or arc and arc
 See attached.DEFn_arcLineSegmentIntersections - find the intersection points between an arc and a line segmentDEFn_arcArcIntersections - find the intersection points of two arcsDEFn_circleLineIntersections - find the intersection points of an circle and a lineDEFn_circleCircleIntersections - find the intersection points of two circles  DE_arcIntersections.zip Dave Elder, Tait Communications
• Post Points: 20
• #### Sun, Nov 4 2012 5:00 PM

• SkilSiao
• Joined on Wed, Oct 12 2011
• Posts 38
• Points 565
Re: Detect interception between line and arc or arc and arc
 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 nilyou 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
• Joined on Sun, Jul 13 2008
• Christchurch, 00-NZ
• Posts 668
• Points 14,135
Re: Detect interception between line and arc or arc and arc
 Frank's suggestion works well if you pass line segments, not lines. Dave Elder, Tait Communications
• Post Points: 5