I'm writing some code (just for fun so far) in Python that will store some data on every point in a 3d space. I'm basically after a 3d matrix object that stores arbitary objects that will allow me to do some advanced selections, like:
- Get the point where x=1,y=2,z=3.
- Getting all points where y=2.
- Getting all points within 3 units of position x=1,y=2,z=3.
- Getting all points where point.getType() == "Foo"
In all of the above, I'd need to end up with some sort of output that would give me the original position in the space, and the data stored at that point.
Apparently numpy can do what I want, but it seems highly optimised for scientific computing and working out how to get the data like I want above has so far eluded me.
Is there a better alternative or should I return to banging my head on the numpy wall? :)
EDIT: some more info the first three answers made me realise I should include: I'm not worried about performance, this is purely a proof-of-concept where I'd prefer clean code to good performance. I will also have data for every point in the given 3d space, so I guess a Spare Matrix is bad?