Grasshopper

algorithmic modeling for Rhino

Hello,

i have a list of points lying on a curve.

i need to evaluate the distances between each consecutive point.

the points are 6 so i have to find 6 distances.  is there a way to do it, without taking out every single item from the list? maybe with a series component or something similar?

thank you.

Views: 2226

Replies to This Discussion

Hi.

Sometimes 6 points will yield  7 distance list.

Attachments:

thank you!! i get the same result also drawing a polyline between points and then exploding it and with the component relative differences. thank you for yor help :)

NOTE: Both of Hyungsoo Kim's methods measure distance along the curve, which isn't the same as the distance between points unless the "curve" is a straight line (as it is in his example).  Andrea's polyline method measures linear distance between points, which will give different results when the curve is not a straight line.

The polyline results can also be calculated like this ("Linear Distance Between Points"):

Attachments:

P.S.  To complete and clarify...  One more 'Shift List' to remove the superfluous "0" at the end:

Attachments:

thanks joseph!

i have another question.

i got two lists of points created from intersection of multiple curves. Some of these points are really close but they are on different lists. is there a way to merge two points really close into just one point?

i know i should open a new discussion, but if you know the answer, this will be faster.

thanks in advance :)

By "merge two points", I assume you mean to use the point half way between them?

Where there's a will there is a way but that point won't necessarily be on either one of the curves anymore so there might be unwanted consequences.  How you do it depends very much on the nature of your data/tree lists and code so off hand, I can't think of any generic solution.

i meant to use one of them instead of both..however i resolved it using cull duplicates..first it wasn't working because i didn't click on flatten data!

How about this?  (close_points_2015Dec21a.gh)

Oops, just read you want to use one of them instead of the mid-point between them...  Which one?

Here you go:  (close_points_2015Dec21b.gh)

P.S.  I suppose a third possibility is to use the one closest to their mid-point?  I'll leave that to you.

Attachments:

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