Finding points in a voxel

Viewed 112
1 Answers

I found a solution if anyone wondering

def findPointsInAVoxel(pc,lenght,ss):
    voxels={}
    for i in range (0,lenght,ss):
        for j in range (0,lenght,ss):
            for k in range (0,lenght,ss):
                voxels[(i,j,k)]=pc[((pc[:,0]>=i) & (pc[:,0]<=i+ss-1)) & \
                   ((pc[:,1]>=j) & (pc[:,1]<=j+ss-1)) & \
                   ((pc[:,2]>=k) & (pc[:,2]<=k+ss-1))]
    return voxels
Related