I would like to list the vertices of line, grouped by spline to file. I know I can output data to file with format % ... to: file
, but I have to do one more thing.
My line looks like this (the outer spline is selected/red and the hole is white):
I want to output the outer spline first (the order is important to me), and then list all the holes (as vertices' lists). How to determine (in MaxScript) which line's spline is the "outer one"?
A simple (but probably not the most effective) way would be to do a length comparrison between the two (since the inner will probably always be shortest).
You use the following method:
getSegLengths <splineShape> <spline_index> [cum:<boolean>] /
[byVertex:<boolean>] [numArcSteps:<integer>]
You could do something like:
if ((getSegLengths $YourSpline 2 cum:true) > (getSegLengths $YourSpline 1 cum:true) then (setFirstSpline $YourSpline 2)
You will of course need to iterate over alle the sub splines of the splineshape, to identify the longest.
Alternatively, you can calculate some vounding box around them, in case your inner spline is curled up, and thus are longer than the outer.