Notifications
Clear all
[Closed] Distribute array of objects along spline lengthInterp
Sep 29, 2017 6:26 am
Hi there
Maybe so simple and i missed sth so basic but how to disterbute array of objects along spline path the way like this:
The first one be on 0 and last on 1 and other distributed evenly.
For example for the array of 7 elements teapot the first teapot on 0 and the last teapot on 1 and the 4th teapot on .5
delete objects
spline =Arc radius:100 from:314 to:225 pie:off reverse:off
convertToSplineShape spline
new_objAr = for i=1 to 7 collect (Teapot radius:15 pos:[i*15,-100,0])
--
for i=1 to new_objAr.count do (new_objAr[i].pos = lengthInterp spline 1 (i/(new_objAr.count) as float))
2 Replies
Sep 29, 2017 6:26 am
well your 1st one is 1/7 = 1 seventh…when logic tells you that it should be ZERO
so here’s my fix…I’m sure other mxs gurus can give much more elegant solution…but you get the gist with mine…
delete objects
spline =Arc radius:100 from:314 to:225 pie:off reverse:off
convertToSplineShape spline
new_objAr = for i=1 to 7 collect (Teapot radius:15 pos:[i*15,-100,0])
maxcount = new_objAr.count - 1
--
for i=0 to maxcount do (new_objAr[i+1].pos = lengthInterp spline 1 (i/maxcount as float))
Sep 29, 2017 6:26 am
I tried each part of your code except i= 0 and new_objAr.count – 1 TOGETHER.
Thanks you for the quick reply