Grasshopper

algorithmic modeling for Rhino

Hi, im trying to figure out how to make a tangent line to a curve, starting at a point

Thank you in advance

Views: 5981

Replies to This Discussion

Here's one way

Thank you, 

as shown in the image, the tangent must start in the point (EXTERIOR, PLANAR)

Start at a specific point, and end at the tangent point, thank you in advance

this is a crude way (if you don't mind error factors) . I am sure there is a more scientific (mathematical) way to resolve this. 

cheers

M

thank you, that error factor is ok, can you attach, please gh file?

When you didn't post any file in the first place?  Your screen shot appears to show a polyline (straight segments) so the concept of tangent doesn't make much sense anyway.

I should have attacked a file, but since the elements used in rhino are so easy to create I thought it would save time drawing them instead of downloading a file

apologies I didn't even save the previous one. refer to my new reply

Gotcha, I didn't see that little point in the corner of the pic. 

Marios' solution will work. He's effectively dividing the curve up into lots of points, measuring the angle between the vector from your starting point to each of the division points, with the tangent vector at that point on the curve. He's then finding the smallest angle, and using the point on the curve that is associated with that small angle. 

Without a file from him, we don't know if the curve and point are in the same plane?  Or if the curve is a polyline?

This yellow line is an approximation, depending on the number of 'Divide' points - likely not the best way at all:

The other issue (assuming everything is in the same plane) is that depending on the curve, there could be multiple lines tangent to different points on the curve.

But it sounds like both of these solutions are fine with him.

http://www.grasshopper3d.com/forum/topics/how-to-get-help-when-you-...

3. Attach minimal versions of all the relevant files

If you have a GH/GHX file you have a question about, attach it to the post. Don't expect that people will recreate a file based on a screen-shot because that's a lot of pointless work. It's also a good idea to remove everything non-essential from a GH file. You can use the 'Internalise Data' menu option to cut everything to the left of a parameter:

If you're importing curves or Breps or meshes from Rhino, you can also internalise them so you won't have to post a 3DM file as well as a GH file. If you do attach large files, consider zipping them first. Do not use RAR, Ning doesn't handle it.

It is especially a good idea to post files that don't require any non-standard components if at all possible. Not everyone has Kangaroo or Hoopsnake or Geco installed so if your file relies on those components, it might not open correctly elsewhere.

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service