Jump to content

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
Link to comment
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()

Link to comment
Share on other sites

  • 6 years later...
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/


 

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...