Hi. I have a group of vertical lines in different planes along the z-axis. I want to connect the end of each line to the beginning of the next with perpendicular lines.
perpendicular_lines_proximity.gh (10.0 KB)
Thanks Cumberland, you approcah i so nice. After your code I have joined the curves and made an interpolate to create a single curve but following the path of the segments. Now my difficulty is to create more bridges between the vertical lines but from a distance and an angle. I have tried to use a 3D proximity after dividing the curves and calculating the angle of these to filter the specific angle, but I have not succeeded, I have tried to use the method that you have used in the previous step.
perpendicular_lines_proximity_re.gh (18.7 KB)
if you are are fascinated by looking at stuff while it iteratively happens on screen as much as I am, here is a sort of Anemone looping thingy that does not produce very useful results but is nice to watch
before the loop starts, points are Jittered
you can chose how many iterations to do (iterations = number of tries, not necessarily {and very not probably} number of final connection lines it will produce)… so the name on the slider “total lines” is just plainly wrong… it’s “number of iterations”, sorry for that
you can chose how many iterations the loop will be forced to search for only “horizontal” lines {same Z} (let’s call this A)
then, each iteration, it takes the first point of the list (which is Jittered) and will look for its closest neighbor (if Count <= A the search happens at the very same Z, if Count >A can be any Z {also same Z, but not necessarily} )
once a closest point is found, it considers that candidate line and checks two things:
- if that candidate line intersect any previously created connection line
- if that candidate line is shorter or equal to the value set on this slider circled in red:
if both checks are passed, then the candidate line goes into the final list of connection lines D1, and the start/end point of that line are removed from the list of available points to be processed on next iterations (so the start/end point of this candidate lines that becomes final are both not available to receive connections anymore: 1 point = maximum 1 line)
if one or more check fails, the candidate line is discarded, and that start-point is moved at the end of the list for next iterations
{now that I think about that… meh, it doesn’t make much sense, because if it didn’t find a closest point with the right features now with n point remaining, then looking for it later with n or “less than n” available points won’t produce any effect… but hey, that’s matter for another day
I just like so much looking at my screen that does things on its own maybe it’s somehow inspiring to you
I think I have learned more with your script and Cumberland’s script than I have in the last 4 months.
I still have to assimilate and understand this algorithm because there are complements that I didn’t even know. I just need to do what you have done but starting from the curves I was talking about, although I think I could easily put it together. In my head what I want to try is to join the vertical curves with segments, but these have to be filtered by distance and angle with respect to the vertical lines, another important thing is that the segments do not begin in the ends of the curves.
I could try to adapt the structure of your code with the loop and filter the segments that have a particular angle or are within a range. However you may think that there are less complex methods.
Anyway, thanks for everything, it’s amazing.