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

[fancy_code_box]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; } [/fancy_code_box]

[wpdm_file id=47]

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.