Grasshopper

algorithmic modeling for Rhino

How to get the tangent line passing a point outside of the curve if it exsit?

Views: 250

Replies to This Discussion

ok...nobody care...
In rhino we can snap a tangent point of a curve,so i think there may be a great method to achieve this.if we can use this in rhinoscript or grasshopper,it would be great...
It's not that nobody cares, nobody knows. There are functions in Rhino that solve these issues, but they are only used during picking operations, for example when you draw lines.

I have no idea how to solve this properly and quickly, but I can put in a request with the core team for a function that returns all the tangent parameters on a curve.

Sameers approach can be implemented in a VB or C# component, but it is liable to miss certain cases, or to be very slow.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
From what I understand, you have a curve and you have a point outside it. You want to find the line from this point to the curve that is tangent to the curve, right?

Firstly, there can be multiple lines that may meet the criteria. Secondly, depending on the tolerance you work with, you may find more or less lines that meet the criteria. The approach may be very similar to the one proposed by me in the following post:

http://www.grasshopper3d.com/forum/topics/line-from-point-normal-to

The logic is as follows:
1. Sub-divide the line to get several points on the line
2. Draw vectors from each point to the reference point outside the curve
3. Compare these vectors to the tanget vectors at each point
4. Cull the resulting list to narrow down the vectors that are identical or very close to each other; this is where you specify the tolerance of the similarity.

The more finely you divide the line, the more accurate your results will be. Let me know if this helps.

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service