I have followed a tutorial (https://www.youtube.com/watch?v=Ih70TE85o48) to create a script for a perforated surface but I got an error which I have not been able to solve.
The error is: “solution execption: index was out of range. Must be non-negative and less than the size of the collection”.
I would really appreciate it if someone could help me.
PS: IMO, your surfaces don’t have a uniform square patch of UV grids, so following your reference tutorial will be difficult to get the results you want.
It seems better to create the UV curves of your surfaces on the XYplane, and apply circle packing algo or some sort… and map them back to the original surface.
The left-most Srf param should probably be grafted and PShift(Shift Paths) is needed after SDivide to preserve the same data tree path structure. You can’t arbitrarily flatten inputs and outputs without understanding data trees.
Even so, three of eleven paths (surfaces) have zero length after Jitter, which probably causes the “Index out of range” error in SubSet.
Actually, the empty paths happen earlier in the code… after Clean Tree. Replacing your Split Tree with the one from @HS_Kim and moving the PShift I added after Clean Tree seems to fix the “Index out of range” error.
Srf CP then hangs miserably, probably due to the un-grafted and mismatched Srf param? Using the original param that I grafted allows the model to complete without error or hanging.
The circle radius was insanely small, I had to increase it from 0.25 to ~64 (256%) just to see them!
It looks like there is a duplicate or overlapping surface in the first Srf param so I tried the second one instead (Srf2). I disabled Scale NU and other parts after that because they don’t make sense.