Flatten() Function Trouble


MrDeathStar

Recommended Posts

I was working with some point arrays (for drawing functions) and came across this puzzle with Flatten.  It seems that I get different results depending upon how the source array has been previously manipulated (e.g. applying constants vs variables).  The code is very short and outputs to the console window.  It is particularly visible if the offsets chosen are negative.  Could I be making some error with array allocation, etc.?

 

v5.91 / 2203

 

TestFlatten.ctl

 

 

 

 

 

Link to comment
Share on other sites

Thanks for pointing that out.  The problem is only partially with Flatten.  In fact, if you did ? flatten(arrayB) instead of assigning it you'd see you get the correct array.  The problem has to do with time stamps.  In ArrayB, you have time stamps associated with the data.  Those timestamps were probably introduced by your posOffset assignments.  Anyhow, you only have two rows of timestamps, and flatten was making four rows.  When you went to do the assignment the system tried to fix that problem and in doing so messed with the array.  We've changed the code to clear time data when you do flatten() and that solves the issue.  A new build is available at the same link you have already.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.