by Tuğrul Yazar | August 26, 2013 11:41
Today’s tip is about two-dimensional curve-point calculations. It is very handy to use “closest point” components in Grasshopper[1]. You can calculate distances and directions between curves, surfaces, and points. Then, place point objects in relation to the proximity of another object. However, there is no “farthest point” implemented yet. I tried to calculate the farthest point from a curve. First, I tried to translate the curve in a fashion that would result in the opposite of the closest point calculation. It is giving the farthest point. However, this idea has collapsed quickly because, in complex curves, you cannot determine the correct mirroring plane.
Then, the “Extremes “component seemed to be a solution. It finds the highest and lowest parts of an object on a given plane. Again I couldn’t determine the correct plane, especially in complex curves. Somehow, these experiments worked in some shapes but never guaranteed that they would work on every possible curve. Finally, a very simple solution appeared to me as you see below. I just placed a circle on the point with enough radius. Then, I find the closest points between the curve and the circle. This automatically gives the farthest one between the curve and the point. You can also put multiple curves to it.
However, the radius of the circle was another quick problem I love to study. The total length of the curve (so that the possible linear curve directly points towards to point counts) + the distance between the curve’s closest point (so that the curve might be far away from the point) seemed to be a solution. Of course, you can put a very big number to the radius also. Here is the Grasshopper definition of this simple trick:
Source URL: https://www.designcoding.net/curve-farthest-point/
Copyright ©2024 designcoding unless otherwise noted.