Grasshopper

algorithmic modeling for Rhino

Finding the furthest point from curves, or from the points on curves

Hey guys,

Currently I have a problem.

Suppose I have a collection of points in space, I am trying to find a way for finding the single furthest point from the curves or from the points on curves. 

For example:

In the picture below, red points are on the 3 curves. The white points are on space. There are also white points on those curves but overlapped with the red points, so for those overlapping points the distances are 0.

I want to find the single white point that is the furthest from all those 3 curves, or from those red points. 

What would be the best way for doing this?

Please suggestion, thanks in advance.

Views: 1623

Replies to This Discussion

join the 3 red curves into 1

calculate distance from list of points to curve

sort ascending

use list item, at index = -1, to get last item in list

Hey Mark,

Thanks a lot for your reply.

I am very glad that it works for the case when the curves are all can be joined.

 

However I still cannot figure out for the case when the curves are not connected to each other, which means they cannot be joined using the "join curve" component in grasshopper.

I tried that method and it did not work since the curves could not be joined, and thus give the wrong answer.

Here is the screenshot of the problem:

Please suggestion.

Thanks much again for your help.

no worries, well, the idea is still the same. take distance from a point to both curves, which will give 2 values for each point. take the largest of those distances, then take the list of this largest distances, sort them, take the largest, and you are done. 

Hey Mark,

Thanks again for your quick reply.

I may understand you wrong. But from what I understood, that way would create a problem. Please see picture below.

Above I label curve A and curve B . 

I also label a point in Blue point and Orange point as an example. 

" take distance from a point to both curves, which will give 2 values for each point. take the largest of those distances"

For the Blue point, I think in this case that largest distance would be the distance between Blue point to curve B. 

For the Orange point, I think in this case that the largest distance would be almost just the same from Orange point to curve A or from Orange point to curve B

If I sort the largest distance in each point, the Blue point will have a larger value than Orange point.

But I think this will give an incorrect solution. Since actually the Orange point should be more preferable than the Blue point. Its because Orange point is further to both curves compared to the Blue point (since Blue point is close to curve A, which make it not satisfy to requirement).

Apologize for my bad english.

Please suggestion and let me know if I understand it wrongly.

Thanks again in advance.

Hello Earth, Mark,

I believe the correct would be:

"take distance from a point to both curves, which will give 2 values for each point. take the largest smallest of those distances, then take the list of this largest smallest distances, sort them, take the largest, and you are done."

Wow, you right nikos!!Problem solved and it works perfectly now, many thanks for the help.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service