v@concave = dot(@N,{0,1,0}); if(@concave < chv("anglee")){ @Cd = set(1.0,0.4,0.3); }
Color Concave area of mesh
1630 7 2 _Christopher_
 Member
 767 posts
 Joined: April 2014
 Offline
 BryanRay
 Staff
 43 posts
 Joined: March 2022
 Offline
You're using the dot product between the normal and the Y axis, so this will select everything that isn't pointed upward. Useful in its own way, but not what you need. I'm not sure what the actual solution in VEX would beit's not an easy problem, from what I can tell. There is, however, a Measure Curvature tool in Labs that might give you what you want.
 SWest
 Member
 313 posts
 Joined: Oct. 2016
 Offline
BryanRay
I'm not sure what the actual solution in VEX would beit's not an easy problem, from what I can tell
Observed the same as in the previous comment.
I've just started to learn a little VEX so this is just a couple of ideas.
In the list of geometry VEX functions there are neighbor and neighbors. If remembering correctly they will give you the point ids of points next to the current point.
From there you would probably need to compare the normals between your point and each point in the list.
In shading context there is occlusion, but probably this is not what you want, no?
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
 animatrix_
 Member
 4600 posts
 Joined: Feb. 2012
 Offline
Either curvature from Measure SOP or you can implement occlusion in VEX by firing rays and using hits.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmaticvfx.com]
youtube.com/@pragmaticvfx  patreon.com/animatrix  pragmaticvfx.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmaticvfx.com]
youtube.com/@pragmaticvfx  patreon.com/animatrix  pragmaticvfx.gumroad.com
 _Christopher_
 Member
 767 posts
 Joined: April 2014
 Offline
 _Christopher_
 Member
 767 posts
 Joined: April 2014
 Offline
SWestBryanRay
I'm not sure what the actual solution in VEX would beit's not an easy problem, from what I can tell
Observed the same as in the previous comment.
I've just started to learn a little VEX so this is just a couple of ideas.
In the list of geometry VEX functions there are neighbor and neighbors. If remembering correctly they will give you the point ids of points next to the current point.
From there you would probably need to compare the normals between your point and each point in the list.
In shading context there is occlusion, but probably this is not what you want, no?
Occlusion in shading, correct; is not what I want to do
【T】【C】【S】
 tamte
 Member
 8702 posts
 Joined: July 2007
 Offline
_Christopher_you can just use Mask By Feature SOP, which has Ambient Occlusion option
although how do I do occlusion in VEX ?
if you are interested in VEX you can have a look inside, it's all in make_light_and_shadow wrangle
even though for your purposes it definitely sounds like Measure SOP curvature or one of the Labs curvature SOPs should be the first to try, there is also plenty of interesting VEX inside if you are curious
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
 SWest
 Member
 313 posts
 Joined: Oct. 2016
 Offline
Out of curiosity I went a bit further with the original idea of comparing normals.
However, there is a problem with this, and that is how to mathematically know the difference between if a curvature is convex or concave.
Here's an image to show an example using a simple "a dot b" thing with the neighbor normals. Both the concave and the convex areas are darkened.
Edit: After investigating previous suggestions it seems like using dot product only will not work for distinguishing convex and concave curvature. Min and max curvature need to be calculated from coefficients coming from a matrix (from the point neighbors). This can be used to distinguish between convex and concave curvature. The mathematical steps required for this is advanced. A working solution is (confirmed to be) available according to the early answer from BryanRay.
However, there is a problem with this, and that is how to mathematically know the difference between if a curvature is convex or concave.
Here's an image to show an example using a simple "a dot b" thing with the neighbor normals. Both the concave and the convex areas are darkened.
Edit: After investigating previous suggestions it seems like using dot product only will not work for distinguishing convex and concave curvature. Min and max curvature need to be calculated from coefficients coming from a matrix (from the point neighbors). This can be used to distinguish between convex and concave curvature. The mathematical steps required for this is advanced. A working solution is (confirmed to be) available according to the early answer from BryanRay.
Edited by SWest  Jan. 30, 2023 17:47:11
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.

 Quick Links