Sign in to follow this  
MrDeathStar

Flatten() Function Trouble

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

 

 

 

 

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this