fieryspoon Posted May 17, 2014 Share Posted May 17, 2014 What's the best way to get the thickness of an object? What I'm doing right now is: 1) Convert the object to VDB, making an SDF. 2) Analyze the gradient of the SDF to get the direction to the surface 3) Scatter a bunch of points in the volume 4) Transfer the SDF and gradient values on to the points. 5) Move the points along the gradient * SDF, to get all the points to be on the surface 6) using a local point cloud to transfer the minimum SDF values to the local area 7) transferring those values on to the original polygon points This seems extremely gross and unreliable, especially since it's using point clouds to do the attribute transfer. It's unreliable because I can't rely on a specific point density or whatever. In general, I'd like to have a more exact method of figuring this out. Preferably without rays, too, but that might be another option. I also figured that SSS must have a way of determining object thickness, right? Thanks! 1 Quote Link to comment Share on other sites More sharing options...
anim Posted May 21, 2014 Share Posted May 21, 2014 usually it's done by shooting rays thickness is relative to the direction so you can't just tell thickness at certain point but at certain point in certain direction if you need this in SOPs just use intersect() VEX function or Intersect VOP to shoot rays inside of the object (with a little offset so you don't hit the side you are shooting from) and get the length of the ray in shader you can use gather() or trace() functions, maybe even simple rayhittest() Quote Link to comment Share on other sites More sharing options...
vinyvince Posted July 31, 2020 Share Posted July 31, 2020 On 21/05/2014 at 8:01 AM, anim said: usually it's done by shooting rays thickness is relative to the direction so you can't just tell thickness at certain point but at certain point in certain direction if you need this in SOPs just use intersect() VEX function or Intersect VOP to shoot rays inside of the object (with a little offset so you don't hit the side you are shooting from) and get the length of the ray in shader you can use gather() or trace() functions, maybe even simple rayhittest() So Far i was using this method in VEX to measure a thickness value, blur it after but as i could see some inconsistency, im looking for a more precise methods without having to do a render/baking... Below is my actual code. Any suggestion for improvement? -------------------------- Measure Thickness -------------------------- vector dir = normalize(@N) * -chf("rayLength"); vector hitPoint; float hitu, hitv; int ray = intersect(0, @P + dir*0.01, dir, hitPointt, hitu, hitv); if(hitPt != -1) { f@meshThickness = distance(@P, hitPoint); @Cd.r = f@meshThickness; } else { f@meshThickness = 0; ____________________________________________ Vincent Thomas (VFX and Art since 1998) Senior Env and Lighting artist & Houdini generalist & Creative Concepts (Available shortly) http://fr.linkedin.com/in/vincentthomas https://www.imdb.com/name/nm0859628/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.