Jump to content

Snap To Edge Of Sdf


doc

Recommended Posts

so I'm trying to snap my points to the edge of my SDF.

The way I figure it, if I normalize the gradient of the volume and multiply that

by the volumes value at the specified point, my point should snap to

the edge of the SDF (where it's value equals 0).

but the results seem to fall short.

I've attached a file which shows my failed attempt, if anyone is able to

point me in the right direction it would be greatly appreciated

Many thanks

L

levelsetTest.hip

Link to comment
Share on other sites

I've attached a file which shows my failed attempt, if anyone is able to

point me in the right direction it would be greatly appreciated

In your point2 node, try changing:

abs(volumesample("../isooffset1",0,$TX,$TY,$TZ))*-1*$NX

To:

$TX+abs(volumesample("../isooffset1",0,$TX,$TY,$TZ))*$NX

For extra accuracy, link a few of these "adjustment chains" together, to refine your solution.

See attached

levelsetTest2.hip

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