Is possible to recreate this code without using curve.normal and geometry.transform?

In this topic I discover how to recreate the curve.normal, basically the curve normal is a cross of the vector obtained by the curve.direction and a Zaxis vector.