Skip to content

Roundtrip Mesh2Voxel conversions #4584

Answered by Grantim
emil-peters asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @emil-peters !

Convert the mesh → VDB volume → Simple Volume → VDB → mesh — the result has a large box around it (see inferred_mesh2)

VdbVolume stores openvdb::FloatGrid inside which has a lot of metadata, and also "background" which is used for non-voxelized space out of scope. Usually we use simpleVolumeToVdbVolume this function, to convert density volumes to openvdb, and we put simpleVolume.min as background to openvdb. It is correct for density volume, but for distance fields it should be opposite.

So you can change simple->vdb conversion like this:

def simpleVolumeToVdbDistanceField( volume: mr.SimpleVolumeMinMax ):
    vdbVolume = mr.VdbVolume()
    vdbVolume.data = mr.simpl…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by emil-peters
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