Skip to content

Added getArray() python API method to get all particle attribute data in a single python tuple#31

Closed
mattebb wants to merge 6 commits intowdas:masterfrom
mattebb:master
Closed

Added getArray() python API method to get all particle attribute data in a single python tuple#31
mattebb wants to merge 6 commits intowdas:masterfrom
mattebb:master

Conversation

@mattebb
Copy link

@mattebb mattebb commented Oct 10, 2012

This is a much faster way of getting the particle attribute data than iterating over particles in python using .get(). In my test case, loading a large point cloud for display in openGL, it's around a factor of 10 speedup.

…e python tuple

This is a much faster way of getting the particle attribute data than
iterating over particles in python using .get(). In my test case,
loading a large point cloud for display in openGL, it's around a factor
of 10 speedup.
@aselle
Copy link
Contributor

aselle commented Oct 11, 2012

This is nice! It would probably be even faster if you used the particle iterator. It would also be cool to add a setArray() function to do the opposite as well.

@mattebb
Copy link
Author

mattebb commented Oct 11, 2012

Ah yes, thanks, I should take a look at both of those.

Also may have been a bit hasty with this pull request, I'm now looking into other things like generating numpy arrays directly - I tried loading up a 2GB ptc (50M points) and all the copying that had to be done brought memory usage up quite high - without colour I could display it ok at 5fps, but with colour it went over 20GB of memory and hit swap. I know python's not designed to be ideal for this sort of thing, but I think it can be pushed a little bit further too :)

@mattebb
Copy link
Author

mattebb commented Jan 4, 2013

Hi,

I've reworked this substantially to use NumPy and it's going quite well! I've re-forked off the redpawfx repo though, so I've added a new pull request here:

redpawfx#21

cheers

@mattebb mattebb closed this Jan 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants