Code Red > AutoLISP (Vanilla / Visual)

Create ARC with TAN-TAN-RAD

<< < (3/3)

kirby:
Update that handles the C curve option (all arcs in same direction). 

Hopefully can solve the S curve option and add some commentary/feedback on which transition of radii will or will not work, after another lunchtime or two.

Command is 'AAT'

New routine 'ArcRay' added that can help visualize the radials.  Transition arc will have centre point on the circle at endpoints of these radials.

BIGAL:
The C W S was just random idea for using with Initget. Bit shorter than 3CCCIC  :2funny:

The solution used by the old software was to pick a approximate center point for the new arc so implying a direction for the arc.

kirby:
Hi

I think I might have it figured out after 3 lunchbreaks (aka think-breaks).

Testing Routine 'ArcRay' simply draws radial lines (projections from centre point to arc) at a given transition radius length along the arc at small degree increments.

Testing Routine 'ArcRadials' does the next step of fitting 3 point circles to the ends of radials.  Each arc will have two of these circles, one on the side towards the centre point (inside, drawn in colour red) and the other beyond the arc (outside, drawn in green).  The outer circle will simply be the original arc radius plus transition radius.  The inner circle will be the arc radius minus the transition radius, however if the transition radius is greater than the arc radius, then the radial will extend beyond the centre point.  The inner circle will have radius abs(arc rad - trans rad).  One of the attached images below shows the result of running both ArcRay and ArcRadials on 2 pairs of arcs.  If none of the circles intersect, then there are no possible transition arcs with the selected radius.

Since you have 2 arcs (or circles) that you want to draw a transition arc between, you will have 4 circles total (2 inside and 2 outside for each).  The intersection points of the circles will be the potential centre points of your transition arc.  2 circles can have 0, 1 of 2 points of intersection, based on the position of the circles w.r.t. each other.  Testing routine 'TestCCI' will show these intersections.  With 4 circles, you can have between 0 and 8 potential transition arcs.

Main routine 'ArcArcTrans' or shortcut 'AAT' uses the above to calculate each transition arc.  My original 20+ year old routine simply used the transition arc with the midpoint closest the the midpoint between the selection points of both original arcs, but this can return one of the arcs that you don't want.  The updated routine cycles through each of the transition arcs, draw them (with optional radials from centre point) and ask the user if they want to keep or discard.  I tried to come up with a new method of identifying the best transition arc, but sometimes there are a few valid options so just deleted this work in progress.

Note that for compound curves (curves in the same direction, C-Curves in BagAl's parlance, e.g. nn vs. nu or un, or Inside+Inside circle intersection), there is a defininte minimum and maximum transition radius that will work and these relate to the smallest and largest radii of the original arcs and the distance between the arc centre points.  For reverse curves (curves in opposite directions, S-curves, e.g. nu and un), there is a lower bound on the transition radius related to the smallest radius of the original arcs but no upper limit.  Alternate would be to do something like BigAl remembered and select an arc based on a selection point closest to the arc centre point.

Input can be ARC or CIRCLE entities only; I didn't want to deal with the complications of CW polyarc segments until I had something working.

All routines set an undo point.  Just use 'Undo' 'Back' to reset.

Outcome showing the resultant transition arcs for Peter's 2 cases are shown on the second image below.  Not the most elegant tool and (optionally) leaves a lot of messy circles to help the user understand the situation, etc. but it seems to work for a number of different combinations of arcs.  Please let me know if there are any problems.

Cheers!

Navigation

[0] Message Index

[*] Previous page

Go to full version