Jump to content
fieryspoon

object thickness

Recommended Posts

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!

  • Like 1

Share this post


Link to post
Share on other sites

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()

Share this post


Link to post
Share on other sites
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/


 

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

×