Hello all, I am looking for a way in which I might measure a line or set of lines against a provided vector direction.
For Context, my ultimate goal is to create a perfect sound-reflecting surface projecting from any relatively flat surface I choose, though I am currently limited to using surfaces built in the x-y-z planes, like in this examples here. If I were trying to generate a reflecting ceiling surface, for example, I take the distance between panels in the z direction and move them towards each other to close the distance, which is my process of creating a smooth reflecting surface. To get that Z-distance, I can use the deconstruct points component to take two points’ given z heights and subtract them from each other. The reason why it is important to measure against the z-axis in this case and not simply use the distance component is because it gives me up/down directionality of the distance, whereas the distance component only gives the absolute value of the distance. That directionality with the positives/negatives is important since some panels need to be adjusted either upwards or downwards.
So now that brings me to needing to measure distance like this relative to the direction of any provided vector. If we subtract given points a and b, for example, I need the resulting distance to be either positive or negative, depending on whether point b was in front of or behind point a relative to the directionality of my provided vector. This would allow me to generate the type of surface I am looking for, using plane surfaces of any orientation I choose. The script for my workup of sound reflections is quite large and messy, but I’m providing here a sample of the type of data I am trying to measure/organize. it has a provided vector and a set of curves which I would need to measure the distance of according to their directionality.
I could probably logic this out and come up with a complex working solution that will bog down the speed at which my script works, but I was first wanting to see if anyone had any ideas on how to do this in a fairly straightforward way that I’m missing. As a note, I would appreciate assistance with doing this with grasshopper components, given that I am not familiar with Python coding. If you need any other information, please let me know.
sample.gh (15.3 KB)