Draw a tangent line from a circle


#1

Hello,

I have a circle which I want to draw a tangent line from.
Desired angle is 30.

I can drag the line to some point, but can’t fix the angle.

Angle constraint doesn’t work.
While I think it should…


And yes, I can draw the line from the center and then offset it.

There must be a smarter way.
Anyone knows?

-C-H-A-R-L-E-S-


#2

30 degrees from where…? The tangent line is touching the circle but you’d have to specify the line length and from what base point you’d like the angle to start from etc.

In this instance you could draw the base curve along the x axis and the desired curve/length at 30 degrees and then use the tan tan radius command to draw your circle?

There are other commands _TangentFrom if you press ctrl over the object snap tick boxes.

Andy


#3

Yes, it would be good if it worked like this:

Line Tangent, pick the circle, then <120 - which should constrain the snap point to a one of two places on the circle. You would then need to click to choose which of the two points you want for the line start, then type a distance or pull out the line and click to fix the end point…

–Mitch


#4

I used , one time tangent from. Made line, then rotated it from circle center 30 degrees.—fwiw. Mark


#5

The several workarounds for a tangent line from a circle are easy.
In fact we wouldn’t need the tangent snap.

And what to do if it is not a circle but an arbitrary curve?
Then the angle constraint would help…


#6

That exactly could be calculated from the angle constraint…
Now we can move the prospected line free or snap the endpoint to somewhere.
The tangent point is calculated while moving.
This could be also done when a constraint kicks in.

Or?


#7

Yeah I can see that now. I was thinking of the problem based purely on the circle example you gave but it would be a bit more user friendly based on your proposal/question.

Andy


(David Cockey) #8

A method which works for arbitray curves:

Draw a line with the desired angle.Position it near the apparent tangent point on the curve.

CurveDeviation with KeepMarks=Yes for the line and curve. The tangent point will be the

Move the line to the tangent point, or draw a new line at the desired angle starting from the tangent point.

Tangent line at angle DC.3dm (40.1 KB)
.


(Pascal Golay) #9

Hi All - Is this request/suggestion only for angles relative to the CPlane X? What would happen on non-planar curves or planar curves not parallel to the CPlane?

-Pascal


#10

Nice!


(Pascal Golay) #11

ClosestPt will also help here… same idea.

Here’s a quick Python to move the line to the curve to the target tangent in cases where that is possible.

 import rhinoscriptsyntax as rs   

def test():

crvId1 = rs.GetObject("Select the curve to move", 4, preselect=True)
if crvId1 is None: return

crvId2 = rs.GetObject("Select the target object", 4+8+16, preselect=False)
if crvId2 is None: return

Id, p1, p2 = rs.CurveClosestObject(crvId1, crvId2)
rs.MoveObject(crvId1, p1-p2)

test()

Works with surfaces & polysurfaces as the target as well, bonus!

A smarter way would be to check if the closest point on the target curve has a tangent parallel to the moved curve at its end of the closest point line, and not move the curve if the tangents are not parallel. And if it’s a line move the end point not the closest point…etc.
Later.

-Pascal


#12

Isn’t it true that ANY curve has at any given point on it an infinitesimal local 3D direction which a tangency constraint MUST obey? Enforcing tangency at a joint on the line would thus, in the general case, also restrict the direction of the tangent line. Devising a tangent-point seeking technique in the scenario where the designer would like to specify the (general) curve to be tangent to and then place the other end of the line interactively might be pretty challenging, but really cool if implemented.


#13

That is already there, we can move the endpoint of the line as we like.


#14

On a general 3D curve, or just a planar curve? I must admit I’ve only used it on planar curves like circles and arcs.


(David Cockey) #15

The method using CurveDeviation or ClosestPt only finds the tangent point when the line and curve are coplanar.


#16

I’m also struggling with this at times.

3D Arcs
I experience problems also when trying to draw arcs in 3D. I’m probably missing something but if anyone has a hint to a straightforward way to draw an arc in two planes simultaneously it’d be very helpful.

// Rolf


#17

I wonder if (crv from 2 views ) this could be a begining point. — Mark


(Pascal Golay) #18

Hi Rolf - there is a Tilted option in the Arc command line after the center has been set. Dunno if that would help with what you are doing.

-Pascal


(David Cockey) #19

@RIL Do you want the curve in 3d to be a circular arc? If so the projections to two planes will not be circular arcs.

Or do you want the projections to be circular arcs? If so the composite curve will not be a circular arc and may not be planar?

Or am I mis-interpreting what you want to do?


#20

I sometimes want to draw a circular arc from a center point in any direction (i.e., in two planes). I’m doing some experiments with spheres and universal joints, and angles drawn in two planes are not the same as when measured in one plane, so I have rotated the CPlane as to make the arc in that one plane instead. So, recently I found out that I have reasons for reading up on spherical trigonometry ( https://en.wikipedia.org/wiki/Spherical_trigonometry ) :slight_smile:

// Rolf