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
Surface Curvature in SOP
15958 13 3- vbk!!!
- Member
- 383 posts
- Joined:
- Offline
- edward
- Member
- 7899 posts
- Joined: 7月 2005
- Offline
- vbk!!!
- Member
- 383 posts
- Joined:
- Offline
- mkolar
- 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.
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.
- vbk!!!
- Member
- 383 posts
- Joined:
- Offline
- peteski
- 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
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
- Pyraxis
- 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.
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
- chrism
- スタッフ
- 2551 posts
- Joined: 9月 2007
- Offline
- peteski
- Member
- 518 posts
- Joined: 12月 2013
- Offline
- Pyraxis
- Member
- 9 posts
- Joined: 8月 2014
- Offline
- Pyraxis
- Member
- 9 posts
- Joined: 8月 2014
- Offline
- arjanM
- Member
- 28 posts
- Joined: 11月 2013
- Offline
- peteski
- Member
- 518 posts
- Joined: 12月 2013
- Offline
- samuel.cazetta
- Member
- 1 posts
- Joined: 1月 2019
- Offline
-
- Quick Links