Good afternoon ! I am a landscape architecture student new on grasshopper and stucked on the following task :
I have a few contours in the same plane.
I want to shatter each contour by 2 points, A and B
Point A on contour 1 is at distance n from point B on contour 1
Point A’ on contour 2 is the perpendicular projection of point B on contour 1
Point B’ on contour 2 is at distance n from point A’ on contour 2
… And so on till all contours are shattered.
This task is part of a larger script to draw lines of a constant slope on a 2D topography. (2D because in 3D the script I did was too expensive in computing time for big topographies.) The script already works well from contour to contour, but since the topography is huge, I can’t do the operation manually between each contour… I think this pre-task would help a lot to make the drawing of theese lines quicker !
If someone has any tips to help, I would really appreciate it !
Thanks a lot for reading.
Here attached my trial script and given contour file as well as a scheme for better understanding of what I am trying to do.
This is the detail of part of the script from contour to contour that already works well for info :
The perpendicularity constrain serves to join well each constrant slope curve.
if you want a way to do that without code, this might work (requires Anemone plugin for looping), and relies on the fact that the starting curves are sorted the right way
a Loop is the best way to do that, because now you have like 6 curves so you might thing of concatenating components 6 times… but if you find yourself using this on like 600 curves, then you can’t concatenate components 600 times
if I may, one note @dn.aur your solution is beautiful but I think it finds connection points perpendicular to the target curve instead of the sender curve:
Hi Dan !
Thank you very much for your anwer.
I definitly need to learn to code, looks to be a great tool !
I had a try on a more complex topography. It works, well but the distances of the segments are variable. I wonder if it is because the script calculates the length of the line from it’s begining, and since they are doing a lot of curves, start and end points of the segments get shifted.