Jump to content
Sign in to follow this  
anupamd

writing out velocity fields to .geo volume format makes no sense, HELP

Recommended Posts

Does anyone know have any info/docs on .geo/.bgeo file format as it relates to volumes. The current docs don’t really say anything about how volumes are stored (other than they are primitive attributes).

I am trying to export velocity fields out of a fluid sim for use elsewhere and writing these out of Houdini as .geo ascii files. For a 10x10x10 volume we get 3 data blocks (one for each dimention). That makes sense to me.

But for a 20x20x20 we get 8 data blocks per dimension, which I cant make sense of. Attached are the two files.

If someone knows more about how volumes are written out to .geo files I'd love to speak with you further. Any assistance would be appreciated. See attached.

pyro_velexport_debug.hip

Share this post


Link to post
Share on other sites

I only know them from UT_VoxelArray.h in the HDK. The scalar volume fields are stored as voxel tiles of maximum 16x16x16 dimensions. So voxel (x, y, z) will be stored in tile (x/16, y/16, z/16). For a 10x10x10 volume, you only require 1 tile. For a 20x20x20 field, I would expect that you get 8 tiles: one 16x16x16 tile, three 16x16x4 combinations, three 4x4x16 combinations, and one 4x4x4. As for the tile order, I think it's done in x major order. ie. tile (x, y, z) is tile number ((z * res_z + y) * res_y + x) for a volume with tile resolution (res_x, res_y, res_z). This is all I know, YMMV. :)

Share this post


Link to post
Share on other sites

BTW, why do you want to do this? You know there's a Volume VOP SOP for processing raw volumes, the SOP Solver if you need to process it over time.

Share this post


Link to post
Share on other sites

Wow this is great help an will also check out additional documentation in UT_VoxelArray.h. Ok I will try that out! Thanks so much for the speedy response!

ps: need to export velocity fields out of houdini for use in a seperate propritary application (not houdini). :)

Share this post


Link to post
Share on other sites

Python is really good for this sort of thing. You can get the volumes as hou.Volume objects, then use allVoxels to get the raw float values. Or use allVoxelsAsString and create python Array objects or numpy objects from which you can export in many different formats.

Also note that velocity fields will typically use Face sampling, meaning the values will be stored on the voxel faces and the field will be one size longer along that dimension. So if you've got a 100x100x100 sim, for example, the field for the x-velocity will actually be resolution 101x100x100, since the values are stored on the faces along the x-axis. Similarly for y- and z-.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×