THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/10/2012 at 04:06, xxxxxxxx wrote:
Hy there,
the returned values of GetSegmentLength of the SplineLengthData seems to be wrong:
import c4d
from c4d import utils
#Welcome to the world of Python
def main() :
print op.GetObject().GetName()
spline = op.GetObject()
spd = utils.SplineLengthData()
spd.Init(spline)
scnt = spline.GetSegmentCount()
segLength = spd.GetSegmentLength(1,2)
print "Seg. Length: ", spd.GetSegmentLength(0,1)
print "Seg. Length: ", spd.GetSegmentLength(1,2)
print "Seg. Length: ", spd.GetSegmentLength(2,3)
This code put on a spline with three segments with different lengths, will return the following:
Spline
Seg. Length: 1.0
Seg. Length: 698.168987717
Seg. Length: 0.0
So, it seems that the second number is the length of the first segment. It seems one needs to Init the spline with the second argument set to a certain segment index (here the segment was implicitly 0). Then the second returned value seems to be the length. How should I interpret these results?
Thank you,
maxx