Skip to content

voxelization to 3D numpy.ndarray #5652

Answered by dveni
loisvazquezind asked this question in Q&A
Discussion options

You must be logged in to vote

I've been trying to do this the whole morning and finally got to a working solution. I'm also new to pyvista so maybe the menta model I have is not accurate and I might be wrong, but this is what I think is going on:

The first thing is that you cannot put the array of mask into the grid since they have different dimensions as the error says. The problem is that voxels is just an array of points defining the coordinates of the voxels extracted from the mesh (I think that each point can have additional attributes) . So when you select the points of voxels that are inside the mesh:

selection = voxels.select_enclosed_points(mesh.extract_surface(),
                                          tol…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@loisvazquezind
Comment options

Answer selected by loisvazquezind
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants