DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Drawing a line tangent to two curves (or two points on one curve)

Started by DavidKeasey, February 01, 2016, 06:53:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DavidKeasey

Ok, either this is fiddly trial and error approximation, or it's something really simple that I've missed.

I can draw lines that are tangent to circles and circular arcs.  I can draw a line which has an endpoint tangent to a circle, arc, or curve.
What I can't figure out how to do is to draw a line that is tangent to two different curve or arc (circle) objects.  I can get close by trial and error, but it's not exact, and is really a pain.

Any suggestions?  I've looked through threads, but haven't yet found the answer to this problem.

bdeck

Lookup: Tangent between Circles in the help file.

The command is accessible from the main toolbox.

Also from the menu   Draw/line/tangent between circles

bd


DavidKeasey

Oops, sorry, my mistake....  I don't have a problem with tangents between two circle objects.  It's the problem of setting a tangent line between points on non-circular curves.  The only way I can figure out how to do it is to replace a small segment of the curve with an arc, and that doesn't seem to be a trivial process.  When I have arc-sections to work with, the tangent-between-two-circles command works just fine.

The tangent snap feature works just fine on non-circular curves, but that only helps at the endpoint, not the origin of the tangent line.


bdeck

No commands available, afaik.

DavidKeasey

That's what I was afraid of.  The only "good" solution I've found seems to be to figure out the approximate tangent point, then convert that little segment to an arc before setting the tangent.

You'd think this would be a simple thing, since they already have the tangent-line and tangent-snap tools.   Oh, well, it's not something I have to do very often, thank goodness.

DrollTroll

Can you post an image of a typical case where you want to do this? I'm not getting a good picture in my head.

Thanks.
25 years with DesignCAD

Dr PR

Tangent to a circle or circular arc is pretty trivial because these have constant radius. From any given external point P there is one and only one tangent point, and the tangent line is perpendicular to the radius. Therefore, it it one side of a right angle triangle with one side the length of the circle/arc radius, one point (angle) at the circle/arc center and the third point (angle) at point P (the hypotenuse passes from the circle/arc center to the external point P). So you know the length of two sides and one angle.

Tangent from a point to a variable radius curve is much more complex. There may be multiple solutions. There is no one arc center and radius length to start with. So you do not know the length of any sides and only one angle. Consequently you have to examine all possible tangents (lines that pass through only one point of the curve) and find the one (if any) that also passes through point P. But if the curve recurves upon itself (like an "S") the tangent line may touch the curve in multiple points.

So here is a geometrical puzzle for those who enjoy solving such things. Hint: You must ignore places that the tangent line crosses the curve.

Phil

PS: I do believe there is a solution to this - and an elegant one. I think I had this problem in a geometry or trigonometry class. But that would have been more than half a century ago, and the answer hasn't percolated up to the top yet.
DesignCAD user since 1987

DrollTroll

25 years with DesignCAD

DavidKeasey

Quote from: DrollTroll on February 02, 2016, 06:57:59 AM
Can you post an image of a typical case where you want to do this? I'm not getting a good picture in my head.

Thanks.

Easier to just describe it:  Draw an arbitrarily curved line with two "humps" at different heights above the x-axis.  Next, draw a line that is tangent to those two humps.   In 3D, it would be like resting a board on three eggs of differing sizes.

DrollTroll

OK, that's easy enough to visualize. *Solving it* may be a different question, but at least I have some context now. Thanks.
25 years with DesignCAD

Dr PR

So it isn't just a tangent from a predefined point to an arbitrary variable radius curve, but a tangent from a tangent point on an arbitrary curve to a tangent point on an arbitrary curve.

Tricky!

But, can you do it?

Yes! I can do it!

You mean there is an answer?

There is an answer ... 

But I'll have to think about it.

Phil (AKA Deepthought)
DesignCAD user since 1987

Dr PR

A tangent line is parallel to the slope of the curve at the tangent point.

For the double tangent problem the slope at both tangent points is equal. So it is a problem of finding all points on the curve that have the same slope.

If you know the equation of the curve you can find the slope at any point by calculating the derivative.

Geometrically there are an infinite number of points in any curve, and infinity complicates the calculations. So (if you want to solve the problem before the end of the universe) you must select a finite number of points on the curve and use the line between neighboring points as the slope of the curve between the points.

Project a line from the midpoint of the slope line between two neighboring points, at the slope of the line between the points, and see if this potential tangent line intersects the curve at any other point. If it doesn't, move to the next point on the curve and repeat.

If the potential tangent line does intersect the curve, calculate the slope at the intersection. If the slope of the curve at the intersection matches the slope of the intersecting line (to within some minimum allowable error) the line is approximately tangent to the curve at both points.

Where you find lines that are almost tangent to the curve the average of the slopes at the two potential tangent points can be used for the slope of the tangent line.

Once the slope of the tangent line is known the actual tangent points on the curve can be determined.

Repeat from all points along the curve until you find all potential tangent lines.

Phil

DesignCAD user since 1987

DavidKeasey

Or, to just get really, really close:

Convert curves to lines;
For each curve, find the very short section where the tangent will fall, and replace that short section with a circular arc;
Run the "Tangent Between Two Circles" command; and
Done.

It would be nice if this could be done for an inserted elliptical arc, too, but that may be asking too much.

Lar

Hey, I tried a method and was about to post it when I saw David's last post. I tried his suggestion, with 3-point arcs, in the areas where my tangent line fell and his tangent fell exactly on mine. Here's what I did:

The tangent would fall where lines perpendicular to the curve (at the 2 humps) are parallel to each other... :

1] Starting in 2d mode, 'vector convert' the Curve (maybe make a copy off to the side first). This would produce a vector (line) with many points...
2] Make a 'Parallel' of the vector-curve below it, but above where the parallel would loop. This would produce the parallel with the same amount of points, each perpendicular to the first vector-curve...
3] Switch to 3d, 'Surface Connect' the 2 v-curves (activate 'normal', 'use original points' and 'retain point order'). This would produce a Grid Surface with all the perpendicular lines visible, like a train track...
4] Select the Grid and 'Duplicate' it on top of itself...
5] With the Grid still selected, put a handle in the area where you think one end of the tangent line would be. Click on the handle (to 'pick-up' the Grid) and Move it (with ghost preview on) to the area where you think the other end of the tangent would be (zoom into this 2nd area)...
5a] Move the grid around until you find a line of the ghost that is near-parallel to a line of the original. Rest the grid down so the lines are together (don't have to be exactly together)...
6] Draw 2 new lines to mark the endpoints of these two perpendicular-and parallel lines, and shift+select one of these marker lines (with the Grid still selected)...
7] Now snap a handle on one of the ends of the selected Grid and move it (and the selected marker line) to the relative end of the unselected grid (so the 2 Grids line up exactly)...
8] Now draw the tangent from one marker line to the other. Zoom in on each area and if the tangent line crosses the curve move the endpoint to other points on the v-curve until the tangent no longer crosses the curve.

To employ David's arc suggestion> at step 8: draw two 3-point arcs in the areas of the tangent endpoints, by snapping to any 3 points in each area, then use the 'Tangent between Circles' command.

Lar

Dr PR

Here is a thought for a manual method - inspired by Lar's last post. See the attached picture.

Step 1. Use "Draw/Tickmark" to generate lots of lines (red) perpendicular to the curve (black). To simplify things you might use short sections of the original curve.

Step 2. Now use the "Draw/Lines/Perpendicular to a Line" function to create a line perpendicular from the tick mark where you think one tangent point might be (red arrow) to a tick mark where you think the other tangent point might be. Start at the end of the first tick mark that is on the curve. Look for the perpendicular to the other tic marks that ends closest to the curve. The blue and green arrows mark two possible solutions.

Step 3. To refine the solution, start at the place where the second tick mark lies on the curve (black arrow) and draw a line (black) back to the first tick mark (black arrow).

****

This isn't a perfect solution, but you can use successive approximation to repeat the process with denser tick marks in the areas of interest until you find two parallel tick marks where the ends of the perpendicular line in Step 2 are both on the curve. This would be a good solution.

Phil
DesignCAD user since 1987