This is similar to some of my own attempts, and it does run after a few minor fixes (missing a ] bracket on the first if, replacing 'continue' with 'next'), but this attempt has an unusual bug that I can't quite identify that makes it impossible to call it iteratively. The source data contains ten arrayrefs, if you run that array through this function, the return value succesfully merges those ten sections into five, so it worked, but that isn't all the return data contains, it also contains thirty-one copies of those five elements. The second iteration will contain the same five merged elements, along with 625 copies. The third iteration will have 198,130 copies, since my actual source data may contain thousands of points, you can imagine this has a negative impact on memory consumption. :)
As for your other concerns, the actual code does deal with floats in a reasonable manner, and I have other code in another part of the application that checks to make sure I don't have multiple segments with the same starting or ending point.
In reply to Re: Re: AoA data merging
by jasonk
in thread AoA data merging
by jasonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |