   How to get arc-length
  Hello, gurusI'm wondering if I can caculate catmull-rom spline's arc-length. I'm trying to write a program to plot points on a curve at a stable interval and I need to get their arc-length for each cubic function. Any one can evaluate its distance function? please tell me how to get integration of that.   
  general cubic hermite spline:arc length of parametric curve is given by:rearranging spline into a standard cubic (same for each x,y,z)which gives:replacing with variables to simplify everything:There is no way in hell i'm going to even attempt to sub them for each component and even attempt the integration, so i'll try using wolfram's integrator.... and i was told it couldn't complete it in the time allotted and i should get a trial version of mathematica to do it... oh well.I think you might be better off approximating it :P   ;  Thanks for your answer. But, can we use a numerical method to solve this integration? Any one be able to do that?   ;Quote:Original post by junjunyuThanks for your answer. But, can we use a numerical method to solve this integration? Any one be able to do that?Sure, adaptive subdivision works fine for this.def arclength(spline, alpha, beta):   gamma = (alpha+beta)/2   a = spline.eval(alpha)   b = spline.eval(beta)   c' = (a+b)/2   c = spline.eval(gamma)   if (c-c').dist() / (a-b).dist() > THRESHOLD:  return arclength(spline, alpha, gamma) + arclength(spline, gamma, beta)   else:  return (a-b).dist()arclength(myspline, 0, 1)Rearranging slightly can cut down on redundant computation, and you should put some iteration limits in there (as well as a minimum number of iterations).   ;  I have got arc-length by using numerical method. Thank you! One more problem I noticed is that the sampling points near each control point are much tight spaced. I'm going to put a balls stream on this curve, I also need to keep a distance between balls which will be the sum of two balls radius. Actually, the distance between balls is not the part of curves length. How can I precalculate sampling points under the balls' distance constraints.Any idea to get t to fit my needs?   ;  mapping a distance to a t-value for the correct segment of the splinestarting at segment 'n0', you want to find the position 's' along the splineint n = n0;while(s>arclength[n])   s -= arclength[n++];float t = s/arclength[n];from which you know the segment of the spline to use 'n' and the t-value for the position 't'   