Jump to content
sweetdude09

Jake's HIPs Don't Lie

Recommended Posts

Sorry for making this thread and then going silent for a while, a lot has happened over the past few months, including me moving to LA on a whim... But I'm back!!!! I have tons of new files to share, which I'll push out in the coming weeks.

Today I had a couple of hours to play with Houdini before going to an Escape Room (wish me luck), and I had been discussing the Laplace-Beltrami operator with a couple of buddies on discord for a long time, so i thought, why not implement one myself!  After having thought about it for so long it actually didn't involve anything I hadn't already done, or covered in my blogs for that matter (go read them!!!!).

The implementation is based off this paper: http://www.cs.princeton.edu/courses/archive/fall10/cos526/papers/sorkine05.pdf

I did comment the wrangle so hopefully it makes sense. One caveat, is that this version does not include border weighting, so watch out for crazy minimization. For production, just use the attribute blur sop, this is more just me exploring weird math stuff that makes me question my art school degree... 

<3 <3 <3

P.S. there's a little ray tracing demo in there as well, since my roommate wanted to understand normals, and I went a bit too far off the deep end in explaining it to him....

EDIT: Petz has brought up a few issues with this, I will make a revision soon :)

JR_Laplacian_v001.hip

Laplace.png

Edited by sweetdude09
  • Like 4
  • Thanks 1

Share this post


Link to post
Share on other sites

Uh oh, I'm back.

While putzing around, trying to come up with good ideas for my next blog post (covering discrete operators seems a bit too mathy, so I'm open to suggestions. Maybe building a cloth solver in VEX?), I spent some time revisiting an old idea I've been attempting to solve for the better part of a year, rolling up a curve. That's probably not the best way to describe the effect, so I'll let my below GIF do the talking.

This solution wouldn't have been anywhere close to possible without Stephen Bester (https://vimeo.com/user13305957) for a solid vex foundation of chained rotations, or Julian Johnson's transport frame file (http://julianjohnsonsblog.blogspot.com/2017/).

 

59d0327bdf478_RollupGif.gif.c274b11ff417fc282222928abe2d66a9.gif

Above you'll see final effect in action. Still not sure how to describe it other than rolling up a curve...

 

I've attached the final OTL to this post along with the above example HIP! It works over multiple curves as well, so dont be afraid to try crazy stuff with it, it's pretty gosh darn fun! :o If you try it on a vertical line, you might need to change the up direction, or turn off "set up direction."

Maybe it's time to make a Github too...

<3 <3 <3 

JR_CurveRoll.zip

  • Like 5
  • Thanks 2

Share this post


Link to post
Share on other sites

WeEEeeEee it's been a minute since I've posted anything in here!!!! I'm sure at this point principal component analysis (PCA), and covariance matrixes are old news to pretty much everyone, but with the release of H16.5 i thought it'd be fun to build a little a file that shows off how you can use smooth distance (defined by the edge transport node), to fuel a discrete curvature algorithm! Wow! 
I've commented the covariance code, so hopefully it makes some kind of sense. I actually should just make a little blog post about PCA but until then, this'll have to do!

You're probably confused as to why this requires the edge transport node, and the reasoning is that without it (say you just do a pc-lookup to define the area we test the curvature against) you don't get an accurate curvature due to both errors in the mesh quality, and the fact that you're not doing a connectivity based curvature calculation in that case. However, those would easily outperform this method speed wise. Other methods, like those described in this Houdini Gubbins blog post are going to be faster as well (and maybe more accurate), however those come with issues of their own, like requiring the input mesh to be triangulated, among others.    

JR_Curvature.png.d58d5dad038be3c4f6b0afaa75c01def.png

 

Total side thing, but I've been working on some dynamic mesh slicing algorithms, and have been making a little short to show that off. Here's a sneak preview :)

EDIT: Read petz's breakdown below for far more accurate info on curvature values, mine is a total approximation (it's still a fun toy to play with), but his description is way more accurate in explaining the nuances of this stuff!!!

 

JR_Curvature_EdgeTransport.hipnc

Edited by sweetdude09
I forgot to attach the file....

Share this post


Link to post
Share on other sites

hey jake!
well, what you're calculating is not curvature but some curvature-indicating value. this, of course, makes sense since you're relying on normals which are per definition closely intertwined with curvature. but instead of building the covariance matrix you could just do pretty much the same by averaging the normalized normals from surrounding points and calculate the difference to the normal of the current point. however, from the mathematical and geometrical side of things neither this, nor your method has much to do with measuring curvature and the result is most probably off by a large number.  (in your case, for instance, it's a min. and max. value of 0.000332 / 0.7385  compared to mean curvature of -107.395 / 204.042).
if you want to compute curvature by using eigenvalues you need to compute, for example, the shape operator by computing the jacobian of N, which in this case results in the hessian and finally project it onto the surface. building the covariance matrix of normals doesn't make much sense if you're talking about accurate curvature values.
building the shape operator is one of the methods described at houdiniGubbins and no, it doesn't need to be a triangle mesh. fitting a polynomial and computing curvature analytically also doesn't need triangles. in fact it doesn't need any mesh at all and works even on a pointcloud. the same is true if you're computing the curvature tensor based on a simple diffusion distance and search for k1 and k2 in the least squares sense. the most accurate results, however, are possible on a triangular mesh.
you're right that curvature computation on meshes is generally problematic but the reason is not because of irregular distances in the one-ring. the main problem is that second order derivatives of piecewise continuous functions are pretty much everywhere null and hence curvature is constant on a triangle. using the edgeTransportSop does not solve this problem. if we are talking about the smooth case, then your idea might makes some sense but on a smooth surface you simply wouldn't need it because here it's easy to compute derivatives. beside that, you would need geodesic distances and not the shortest path distances which the edgeTransportSop calculates...

hth.
petz

  • Like 1
  • Confused 1

Share this post


Link to post
Share on other sites

Howdy partners,

So one of the g00ns (Flight404) in our lil chat group had a question on dynamically cutting a triangle by its edge duals (basically create a triangle with the midpoints of each edge, and then 3 other new triangles that each connect back to one of the input triangles points) which i thought was a fun problem. Luckily i have tons of experience in this area as I've been dealing with similar problems for that KD-Tree teaser thing I mentioned briefly at the end of my last post (go watch it). Unfortunately i can't think of a parallel method for solving the problem that doesn't create overlapping points on edges (since 2 prims can contain the same edge, solving on prims will double up points on shared edges), but I did get it running pretty fast. It's a QT 3.14 effect, and I've done my best to comment the code. It's all relatively simple, so hopefully you learn some stuff clicking through it! :)

Gosh I really need to update my website with this stuff...

image.png

JR_TriDiv.hip

Edited by sweetdude09
  • Like 1
  • Haha 1

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

×