An array modifier remade for the specific needs of my curve-based fence.
I made this curve geometry node for making the fence in my last toy house. I tested the same modifier on a randomly created curve, and I ended up with some unplanned and unforeseen outcome like this…
After trying many ways to fix the orientation, I ended up with results like these…
Finally, I decided to start thinking like a modern-day detective(No offence to Sherlock), one with technology to aid his mission. My First step was to properly try to understand the idea of Tangents, Normals and Binormals.
I reverted to using the rotation supplied by the Curve to Points node, but it still resulted in the same crazy kind of twists and turns.
But at this point, I knew I was close to solving my problems.
I brought out my linear algebra gear, calculated my normal by cross-product-ing the XY-plane projected tangent with my world up forced-aligned binormal… Made a Rotation Matrix out of it and Voila… Problem solved.
The simplicity of the solution is the reason why I love linear algebra so much. I am looking forward to the crazy solutions it will bring me in Shader Programming.
Here is the final spiral stairs railing with no weird orientation problem…