Adding points in between points

Hi all,

I want to know what is the best way of creating points in already created points. The issue is that the points that are already created are not sorted, so how would I make sure to get every point involved.
Here is what I am dealing with:
sporadic points
I want to add 5 points in between all consecutive points and I want to be able to do it quickly. I am open to the use of Grasshopper - I just haven’t been able to figure out a way of doing it.
Thanks!

Hm - the hard part will be determining what makes a point consecutive to another -
image

A are clearly consecutive but B are probably not… how do you tell?

-Pascal

@pascal - I agree this is what makes it very difficult. One way I was perhaps thinking is to check if it is in a straight line of points or not. If yes, then you should make a points in between the 2 points, if not then only if they are within a certain distance of each other should they have points in between. Unfortunately, this has some holes too and is difficult to execute.

Would it be OK to trace the desired path with a polyline?

-Pascal

@pascal- The issue is that the picture I sent is only a portion of the total situation. So, I think tracing it with a polyline would take too much time.

You could use Grasshopper’s Proximity2D component:


connect_the_dots.gh (8.3 KB)
(adjust the minimum and maximum radius and max number of connections to get the result you want)

1 Like

@DanielPiker - Thanks! Unfortunately, there are lines created that aren’t wanted. Here is what happens when I try using your code:


I can’t even cull these lines out (through determining the length of the line) because even the straight lines are really made up of a bunch of smaller lines. Any ideas?

It should be possible to clean these up.
Do you want to post the points you are working with?
also, how are these points originally being generated? we will be better able to help you if you give us more of a full picture of your process.

@DanielPiker - Here is a file with the points.
Points-example.3dm (652.6 KB)

I am provided the points from a colleague. I am not sure how he gets the points, unfortunately.

Joining the curves, splitting at discontinuities then removing short segments captures almost all the curves without extra connections if you tweak the thresholds right.


connect_the_dots2.gh (79.2 KB)

There’s potentially also a way to take the segments from the proximity component and join only the ones which share a direction.

mmm - grouping by direction works much better - this finds all the lines without any gaps or spurious segments:
connect_the_dots3.gh (79.4 KB)