THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/10/2012 at 18:48, xxxxxxxx wrote:
This one is driving me crazy.
I have the following code:
def plot_bits(op,size,ncells,bd) : size2=size/2.0 cellsizex=size.x/ncells.x cellsizey=size.y/ncells.y cellsizez=size.z/ncells.z startx=-size2.x+(cellsizex/2.0) starty=-size2.y+(cellsizey/2.0) startz=-size2.z+(cellsizez/2.0) bd.SetMatrix_Matrix(op,op.GetMg()) bd.SetPen(c4d.Vector(1)) for a in range(int(ncells.z)) : for b in range(int(ncells.y)) : for c in range(int(ncells.x)) : pz=a*(1.0/ncells.z)*size.z py=b*(1.0/ncells.y)*size.y px=c*(1.0/ncells.x)*size.x pos=c4d.Vector(startx+px,starty+py,startz+pz) bd.DrawLine(pos,pos+c4d.Vector(2,0,0),c4d.NOCLIP_D)
The size parameter is a vector with the size of a box. The ncell is also a vector and it stores the grid subdivisions of the box.
As long as ncell contains values that, multiplied with each other are lower than 512, it all plots fine. But, as soon as ncell.x*ncell.y*ncell.z is larger than 512, the plotting is ruined.
For example, if ncell is (7,7,10) it all works fine (7*7*10=490) but if ncell is (7,7,11) it doesn't plot all the cells (7*7*11=539)
What is wrong with this?!?