PDA

View Full Version : applyoffset only to certain splines of a shape


edgy_k
12-12-2008, 11:36 AM
Hi,

I have shapes made of many closed splines.
I need to offset all those splines and only keep the new offset ones.
To do that I would need to cycle through each spline, offset it and delete the old one.

I tried using applyoffset on the whole shape. But then I don't know how to sort what are the indexes of the old splines and the new offset ones.

Is there another way to do that ?

Maybe detach all the splines first, offset them, then reassemble the shape ?

ZeBoxx2
12-12-2008, 12:21 PM
the offset splines are added to the existing splines.. so their index number is always higher than the highest index number -before- you offset the splines...

sooo...


myShape = $
splinesCount = myShape.numSplines
applyoffset myShape 5.0
for i = splinesCount to 1 by -1 do (
deleteSpline myShape i
)
updateShape myShape


Except that you would loop over the shapes, instead of the static myShape assignment

edgy_k
12-12-2008, 12:54 PM
Ah ! That's so easy
Thank you very much

Such important information should be mentioned in the help

CGTalk Moderation
12-12-2008, 12:54 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.