Length Of A Spline

How to find length of a spline in C4D via Xpresso?

0

This post has already been read 1393 times!

Here is a simple C4D C.O.F.F.E.E. Xpresso node snippet that finds length of a spline…

In this quick setup we are calculating the first and last point of a spline then printing their length XYZ values to output which might be useful for your Cinema 4D Xpresso Projects

main() { var doc = GetActiveDocument(); var arr = spline->GetPoints(); // Gets the array of the spline's points var lengthx = arr[1].x - arr[0].x;// Subtract the last point from the first point var lengthy = arr[1].y - arr[0].y; var lengthz = arr[1].z - arr[0].z; println(lengthx); println(lengthy);println(lengthz); x = lengthx; y = lengthy;z = lengthz; } 

Leave a Reply