Hi , I came up with What is the logic for creating boxes at a mass of points ? , as there is a component written by @MateuszZwierzycki

Thanks

Hi , I came up with What is the logic for creating boxes at a mass of points ? , as there is a component written by @MateuszZwierzycki

Thanks

Youâ€™re going to have to elaborate a bit. Grasshopper doesnâ€™t work with Voxels, so are you talking about a specific plugin or a way to mimic voxels in vanilla Grasshopper orâ€¦?

There is no Voxel Type in grasshopper or rhino , and i donâ€™t mean the output , or the used type (brep ,mesh ,â€¦)

I was looking for the logic of pixels and further (voxels) , so that to create **adjacent** cubes not **intersected** from a bunch of points .

In Mateusz Zwierzyckiâ€™s version of voxel generating the output is a single mesh and when the cubes meet each other the adjacent faces will be culled .

It sounds like that needs some serious coding, because thereâ€™s various intricate loops involved that are not easily done in Grasshopper. In general the default approach would be to generate *all* the voxel volumes, then test each point for inside/outside relationships. This is exceedingly inefficient as the number of tests you have to perform is the number of points times the number of voxels. In code it is much easier to figure out for each point in what voxel it resides, reducing the runtime to just the number of points.

Wouldnâ€™t that be the number of points six times? Being a homogeneous topology, with a voxel up, down, front, back, right and left, it would not be enough to know the absence of a neighbor to add a face?

Thatâ€™s the next step I havenâ€™t even thought about yet. First you need to figure out which voxels in the infinite voxel space contain one or more points. The attached file uses a `HashSet<VoxelIndex>`

to build the list of voxels that are touched by points, but if youâ€™re happy setting up finite space boundaries and you know that youâ€™re not going to deal with too many potential voxels, you could use a 3D array as well.

voxel solver.gh (14.4 KB)

Mateusz voxels are very fast and def math based. I donâ€™t think he makes cubes and remove walls. Also always post some link to plug-ins so people know what you are referring to.

http://www.grasshopper3d.com/group/milkbox/forum/topics/mesh-pipe-and-sweep-mesh

It merges all the adjacent faces , and itâ€™s optional not to merge by grafting the point list . the point is that I donâ€™t know if the code makes each voxel cube and recognize the adjacent ones and omit them or not .

Thanks for clarification .

Thanks a lot David

Well I gotta add the adjacent faces removing part , And I was not familiar with HashSet data storage .

I know what it does, what I am saying is it doesnâ€™t make each cube, it calculates the final mesh boundary from the point space. Of course it makes separate voxels with graft, because then each voxel space is one point.

If the total number of voxels you would possible add does not exceed ~1million or so, using a multi-dimensional or nested array of booleans will both be faster and easier when testing for adjacency. But I think it also makes it all a little bit more complicated.

I quite like the idea of having some sort of voxel geometry type in GH2, but I havenâ€™t done enough with them in the past to really know yet what would be involved.