ScalarGrid in VoxelTools

@arendvw I don’t understand the purpose of the scalar grid in the VoxelTools plugin. I would like to use it to represent a matrix of leaf area density voxels, a common way of representing a tree in CFD. It doesn’t seems like there are many functions other than displaying values in the model - I would instead need to extract the values as number parameters I can manipulate and export. It would also be very helpful to have other constructor and operator components, but to be honest I don’t really understand the ‘mass’ parameter or what the intent of the functionality you built may be.

Hi Ivan!

Awesome that you dove into scalar grids. Honesty, this is half an implementation, and I’ve never really created all the components that would make sense to make it feature complete. I’ve mainly used it from C# and not all features have grasshopper components yet.

As my voxel adventures became less I’ve not invested any more time in changing things. But exporting to CFD would be a very interesting use case.

Do you have a diagram of what you’re looking for? I’m sure I can cook something up in the coming weeks.

Thanks for the reply. I started making a diagram and realized it’s pretty easy to render in text:
LiDAR->Connected components->Tree stand->Bounding box->Grid->Point count (n)->matrix:{x,y,z,n}->ascii list
The LiDAR is preprocessed in CloudCompare and imported as an e57.

Right now I’m populating new 3D shapes that represent trees with points and then using the voxelgrid component to get all the true grid cells as a list, but this means that the cells are all a constant magnitude.

Awesome, could you share an example file? Then it’s a lot easier to cook something up. I think it’s pretty easy to cook up a Scalarize by point count thing for this.

Set Mass to 1 because I don’t know what it’s for. Uses cockroach for pointcloud param.
Also here is an image showing what the voxelgrid looks like for the same point cloud. (115.1 KB)

Awesome, I think I’ll get back to you over the weekend

I’ve released voxeltools 1.0.5 through the package manager. Make sure to update first.

I think on the voxelisation part I’ve solved it by adding an exponent weight of 0. Mass is how much mass is counted. Exponent is how far each voxel has an influence (like an attractor). Since you don’t want any attractor behaviour, I would set it to 0 for now.

I think this solves the first part (voxelizing a point cloud).

The second part: exporting, I’m still not quite sure what should be the output, but I’m sure there a component missing. Any thoughts?

231210 (111.7 KB)

Awesome! I look forward to playing with it. I still see 1.0.3 on both packagemanager and the git repo.

For my specific purpose what I need to export the result is a list of coordinates and values in a local coordinate system.


and so on.
This is because the result will go into an xml file where the matrix defines positions of leaves relative to the insertion point of the grid. The approach here is to just omit empty cells.

Your list voxelgrid component gives coordinates in world xy plane, which i had to translate to the coordinate system of the bounding box. It would be awesome if your ‘list’ components took a plane as a parameter.

I realized I should add some information regarding the values I made up in my example: their are decimals because they actually represent a ratio of surface area to the volume and assume another parameter for the area represented by each point in the count. So if there are 100 points and each one of them represents 0.01 m^2 then the total would be 1m^2/m^3. Less than that would be a decimal.
Of course those kind of calculations can be done after the fact as long as it’s possible to get the scalar values out of the component as numbers.