I'm trying to write out the coordinates of a 3d object, but I'm not sure how to list it.
so far I have:
class threed:
def __init__(self,length,width,height):
self.h =height
self.l = length
self.w = width
self.f=0
self.lwh = (length,width,height)
for i in range(1,3):
for j in range(1,3):
for k in range(1,3):
coordinates=threed(i,j,k)
The problem is my function rewrites the variable coordinates each time so that I can't ever access coordinate (1,1,1) for example.
Note the above is for a 2x2x2 object.
How do I write it efficiently so that I can reference any coordinate as I need?
self.hsupposed to beself.w? And do you mean you want a multidimensional array? If it's in a multidimensional array, why even bother, since you can just create a new class instance based on the position you would have fetched it in in the array? If it's not a multidimensional array, what are you trying to do?threedclass other than the fact that it doesn't really do anything. Your loops don't accomplish much, but it's not clear what you're aiming for..fand see if it's empty or not.