Hello!
My name is Samson and I have some trouble with grasshopper. I would really appreciate if you could offer some help!
As demonstrated in the screenshot, the Perp Frame component build frames perpendicular to a curve. However, in this case, I wish the first and last frames could be at certain set angles, and all other frames will be arranged accordingly. Is there any way for me to achieve something like that?
The above image shows the ideal situation where the first frame is horizontal and last is vertical. I imagine the middle frames angle can be created with the Series component.
Rotate first and last frame or put vertical or horizontal frame where it is required. Use Cull index or list item component to select first and last frame.
EDIT: Well Spotted @akche001 yeah it should be -x.z though as @Joseph_Oster pointed out I solved the first part with the nice diagram and missed the additional request to also resolve the planes in-between. Doh.
Updated File, just incase someone downloads it on day. Align End Planes.gh (10.5 KB)
Yeah, I know the answer. I was trying to point out that the original question specified “all other frames will be arranged accordingly”, which to me says that the frames in between will be rotated as well, evenly distributing the difference between the first and last frame angles.
Yes, I get that point, thanks for pointing out. Yes, sometimes people are so eager just to reply that they don’t actually pay enough attention to what is asked. That goes to me too.
I am sure there is a more efficient way to deal with your plane rotation issue, but this (see attached gh definition) seems to work, so maybe it’s gonna be helpful.
That’s a special case. I haven’t looked at anyone’s code but @Lina’s solution looks correct to me, it’s what I would expect. And probably @Michael_Pryor’s solution as well.
The special case is what is needed. This time I carefully watched the question. Otherwise it makes no sense to make first and last frame horizontal and vertical and then to arrange in between frames accordingly.
The major issue without quats is when two planes exactly oppose each other you can get some harsh plane flipping which is called Gimball lock.
You could use a calculation of rotation values like @Lina in this case it’s a good solution. But if both x and y don’t align (in this case x aligns) it will be tedious (rotating multiple axes) but Quaternions can do it.
Thanks Matt! I also missed the in between planes part. Also it is not clear if in between planes should be rotated along x axis or both x and y. No response from Simon yet. Good to see that everybody put up their ideas in a different way.