Jump to content

VDB Curvature Flow


Recommended Posts

Hi everybody, I´m Igor a long time lurker but first time poster here on OdForce  :)

I´d like to ask what is best way to calculate curvature flow in volume. I searched the docs and found VDBAnalysis with curvature option but how can I calculate other curvature type like Vectorfield follows curvature?

Thanks for any idea!

Link to comment
Share on other sites

No one has any idea how it can work?

Maybe I did explain it badly (sorry for my English btw.) but pictures show best what I mean. It is Vectorfield that follows the curvature of Levelset. Is there any way to do it with VDB in Houdini?

Thanks!

 

Bunny_64_k1.pngCurvature1_BlobbyCube.png

 

 

Link to comment
Share on other sites

Thanks Dan!

I had look at the post but this is not what I mean. What I mean is Vectorfield that describes the surface in regards to curvature. If you look at pictures you can see how vector does follow surface with strong curvature and I want advect particles along this Vectorfield. Hope it is clear what I mean.

Thanks! 

Link to comment
Share on other sites

not sure if this is what you meant, but looking at the images in your second post i would say you are talking about principal curvature directions. if so, i don´t think there is any direct method in houdini but it shouldn´t be too hard to implement with a volumewrangle ...

hth.

petz

 

  • Like 1
Link to comment
Share on other sites

Thanks petz! You are right, Pricipal Curvature Direction is what I mean. I found formula on Website of MIT but do not know how to tranlate into VEX. Formula

Can somebody give me hint how to do it please?

Thanks!

 

Edited by Igor
Link to comment
Share on other sites

Will look at this hip file soon, but I think what you are wanting is to get the vector direction of the sdf surface, then get the average sdf of surface in the area (could use projected point cloud in this) and then using a cross product between the original surface direction vector, and the local average's, you will get a new vector field that flows along the surface that appears like the image you posted, it kind of resembles topology of a map.

  • Like 1
Link to comment
Share on other sites

Thanks Jamie!

I did try your idea and also got Vectorfield but it is different as in example from petz. It is not pointing in direction of curvature. Can you explain the difference? Perhaps Problem is that I did it on polygon-surface because I do not know how to get pointcloud around sampling Point in VDB.

 

Link to comment
Share on other sites

  • 7 months later...

Petz, your knowledge is amazing. Thank you for your source file, I am trying to understand the math behind it, you helped me a lot. But it is quite a long run :) I forgot lots of things from the university.

Please, why are there those interesting "zigzags" in the attachement? The gradient of curvature should be theoretically smooth, no voxels are missing and increasing the iteration accuracy doesn't help.

 

What I allready understand:
Hessian matrix, mean curvature value (from its diagonal), gradients, cross and dot products

I would like to achieve these kind of effects:
http://forums.odforce.net/topic/28239-gabor-kernels-oil-painted-cop-convolution-filter


What do you think is crucial to learn next? I will study these:
eigenvectors, trace of matrix

Do these lead me to some creative effects? Do I have to understand them really well?
frobenius norm of matrix, outer product(shape operator), inverse power iteration

If anybody could direct me, I will really appreciate.

zigzags.PNG

vdb_curvature - zigzags - v0.hipnc

  • Like 1
Link to comment
Share on other sites

the "zigzags" in the trails are the result of vectors pointing into opposite directions and this is due the way how they are calculated. when you calculate the eigenvectors of the matrix there is no easy way to determine in which direction (+ or -) the vector is pointing because both directions are true. an easy way to handle this problem is to check and reverse neighbouring vectors recursively, starting from one point, or write your own streamline algorithm in vex which ignores opposite vectors based on a given threshold. either way, this is not be a perfect solution but depending on your needs it might be enough. if you want a vectorfield on the mesh which is as smooth as possible, then that´s a completely different story and it becomes much more complicated...
in regards to your other question, if you need to fully understand all the things in the file, i would say no. it´s nice and sometimes helpful if you do but this is something you´ll barely need for day to day work. but that is just a personal opinion based on personal experience and not an advice by any means.

hth.
petz

  • Like 1
Link to comment
Share on other sites

well, it is possible to get the curvature, or more precisely the mean curvature with vdbAnalysis but not the curvature-direction. even though you could get a somewhat curvature-related vectorfield, if you calculate the curvature first and then the gradient of it (which is possible with vdbAnalysis) it wouldn´t be the same. principal curvature directions are quite different and sometimes they are useful since they have a few special properties.

 

Link to comment
Share on other sites

  • 3 weeks later...
On 6/22/2016 at 10:00 AM, Igor said:

Thanks Dan!

I had look at the post but this is not what I mean. What I mean is Vectorfield that describes the surface in regards to curvature. If you look at pictures you can see how vector does follow surface with strong curvature and I want advect particles along this Vectorfield. Hope it is clear what I mean.

Thanks! 

Created a tool to calculate the gradient and curl along the curvature of a given geometry.

If I'm understanding what you're looking for correctly I think this might help: (link to the file is in the vimeo description)

It runs on geometry but there's no reason you can't go to and from volumes.

Hope this helps,

-Tighe 

Edited by trzanko
  • Like 2
Link to comment
Share on other sites

  • 4 years later...
  • 2 months later...
On 6/24/2016 at 9:03 PM, petz said:

attached is a file with all sorts of curvature computation for vdbs ...

hth.

petz

 

vdb_curvature.hipnc

This is so helpful! thank you for sharing! Is it aslo possible to get the gradient y component of a volume like you do with a measure sop on meshes?

Edited by papsphilip
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...