[Solved] How do I retrieve Spline Points?

dermont

08-01-2014 13:49:51

As the subject title suggests how do I easily retrieve the Spline points. From python I'm using an ugly hack with safeGetPoint something along the lines of:


p = procedural.CatmullRomSpline3()
p.setNumSeg(8)
p.addPoints([(0,0,0), (0,0,10), (10,0,10), (20,0,0)])
p.close()
path = p.realizePath()
path.scale(2)

pt = p.safeGetPoint(0)
i=1
while pt!=p.safeGetPoint(i):
print p.safeGetPoint(i)
i+=1


Is there an easier way to do this in C++. Thanks.

mikachu

08-01-2014 22:40:14

Hacky, indeed :wink:

It was missing from the API, I just fixed it (now, each shape and path generator based on control points has a getPointCount method)

dermont

09-01-2014 05:15:39

Perfect, thanks.