Surface Curvature in SOP

   15957   13   3
User Avatar
Member
383 posts
Joined:
Offline
Hello,

There is a shading derivative vop in SHOP context but I wonder how to get the curvature of a mesh in SOP.

Thanks for your help

Vincent
http://vimeo.com/vbkstudio [vimeo.com]
User Avatar
Member
7899 posts
Joined: 7月 2005
Offline
Measure SOP?
User Avatar
Member
383 posts
Joined:
Offline
not bad really ! Thanks for the info.

Now is there any chance to explain how to isolate concave and convex curvature in SOP ?

++

Vincent
http://vimeo.com/vbkstudio [vimeo.com]
User Avatar
Member
18 posts
Joined: 11月 2011
Offline
You can do that inside of vop. For instance by getting a dot product of a point normal and all the vectors pointing towards its neighbours (one by one) then adding these together and calculating their average. If the result is positive, it'c convex, if negative, it's concave. It's not particularly precise, but it did the trick for me.

You can have a look at the vop in the attached hip file. the values are normalised and mapped to colour to see what's going on. If you want to flip the values, just invert the threshold.

Attachments:
curvature.hipnc (96.5 KB)

Technical Director @ Kredenc
www.mkolar.com [mkolar.com]
User Avatar
Member
383 posts
Joined:
Offline
very nice

thanks a lot.

++

Vincent
http://vimeo.com/vbkstudio [vimeo.com]
User Avatar
Member
518 posts
Joined: 12月 2013
Offline
Hi all,

Just trying to get this working with the new for loops in vops and I can't seem to get it happening.
Any ideas what I might be doing wrong here? Just trying to get the basics of it working…



Scene file [peterleary.com]

Thanks,
Pete
Edited by peteski - 2016年11月21日 22:16:06
User Avatar
Member
9 posts
Joined: 8月 2014
Offline
I know this is way late, but I was working on the same problem today and this thread came up in a search.

On the for loop, you need to add a float output for the cumulative angle, ie _angle. That will add “_angle_in” and “_angle_out” to the for nodes. After the dot product, you need to add the result to _angle_out on the for_begin before feeding it into the end_for. That will cumulatively add the angles between the original point and each neighbour.

After the for loop, you need to divide your results by the neighbourcount to get the average angle. Finally, use a fit to map the results (which will be -1 for maximum concavity to 1 for maximum convexity) to 0 to 1 for Cd.
Edited by chrism - 2017年2月15日 18:01:28
User Avatar
スタッフ
2551 posts
Joined: 9月 2007
Offline
Hmmm….kinda looks like a Houdini 16 image was just posted outside of the Houdini 16 forum the week before release, but you wouldn't do that, would you?
Edited by chrism - 2017年2月15日 18:01:39
Chris McSpurren
Senior Quality Assurance Specialist
SideFX
User Avatar
Member
518 posts
Joined: 12月 2013
Offline
Damn! I missed it!!
Hey thanks Pyraxis, you wouldn't have a scene example would you?
User Avatar
Member
9 posts
Joined: 8月 2014
Offline
Chris, I'm so sorry. I had the release dates mixed up.
User Avatar
Member
9 posts
Joined: 8月 2014
Offline
Hi peteski, here's a sample scene, hope it helps!

Attachments:
ConvexityDemo.hipnc (208.2 KB)

User Avatar
Member
28 posts
Joined: 11月 2013
Offline
Does somebody know how to use the shading derivative to create a curvature shader?
This is my wrangle version of the curvature pointvop posted here.

Attachments:
curvatureWrangle.hipnc (1.9 MB)

User Avatar
Member
518 posts
Joined: 12月 2013
Offline
Hey thanks for sharing that!
User Avatar
Member
1 posts
Joined: 1月 2019
Offline
Pyraxis
Hi peteski, here's a sample scene, hope it helps!


Hey man, can you, or someone else, explain me what is going on in the ‘output: _angle’ and its add with the dot.product in the loop node? I can understand all the rest of the process but not these in particular.
  • Quick Links