Calculate slope for attribute

   855   10   2
User Avatar
Member
766 posts
Joined: April 2014
Offline
I was hoping someone can help. In the attached image specifically near the end of the screen cast there are areas of light green. I'm using a maskbyfeature sop after a DOPImport to get these color values.

How do I calculate the angle of the slope of the areas which are green and create an attribute on those areas while having control over the angle of the slope of those areas as the maskbyfeature creates a float attribute. In other words, if the slope attribute is too steep; and it's calculating the slope around those green areas then don't create an attribute for those areas otherwise create the attribute for those areas ?

Attachments:
greenAttribute.gif (5.7 MB)

【T】【C】【S】
User Avatar
Member
8579 posts
Joined: July 2007
Online
Attribute Remap SOP and remap your slope based mask to produce values only in areas you want
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
766 posts
Joined: April 2014
Offline
tamte
Attribute Remap SOP and remap your slope based mask to produce values only in areas you want
Except this sop adds these ugly edges; I tried attribute blur but no success ?

Attachments:
edgeAttribute.jpg (68.8 KB)

【T】【C】【S】
User Avatar
Member
696 posts
Joined: March 2009
Offline
Those "ugly edges" seem to be consistent with your original data set.
You could paint a mask along the sides to filter them out...

Cheers,
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
766 posts
Joined: April 2014
Offline
rafaels
Those "ugly edges" seem to be consistent with your original data set.
You could paint a mask along the sides to filter them out...

Cheers,

How is this possible without using attribute paint as in procedurally ?
【T】【C】【S】
User Avatar
Member
696 posts
Joined: March 2009
Offline
Feed your geo into a bounds SOP;
Group the top and/or bottom faces of the box using the normal direction and delete them;
Use the ray SOP to calculate the distance from your geo to the bounding box's sides;
Attribute remap the distance value to your liking and multiply the resulting attribute by the slope.

OR

attribute paint a mask!

Cheers,
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
766 posts
Joined: April 2014
Offline
rafaels
Feed your geo into a bounds SOP;
Group the top and/or bottom faces of the box using the normal direction and delete them;
Use the ray SOP to calculate the distance from your geo to the bounding box's sides;
Attribute remap the distance value to your liking and multiply the resulting attribute by the slope.

OR

attribute paint a mask!

Cheers,

I have to create two groups, based on the normals (keep by normals) enabled; then I have to set one vector to 1, the other to -1 for each group create sop. Too bad one cannot do this in one group create instead of two.

Then using raycast sop, I cast the rays against the deleted primitives and the maskbyfeature node and this is where I don't see any results before feeding into the attribute remap distance sop ?
【T】【C】【S】
User Avatar
Member
696 posts
Joined: March 2009
Offline
Sorry, I didn't have Houdini near me when I first wrote and then I've been too busy to check back on this.
I'm attaching an example file of what I meant, only I'm using curvature instead. Hope it helps!

Cheers,

Image Not Found
Edited by rafaels - April 5, 2024 16:14:52

Attachments:
curvature_with_mask.hipnc (524.3 KB)

Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
766 posts
Joined: April 2014
Offline
rafaels
Sorry, I didn't have Houdini near me when I first wrote and then I've been too busy to check back on this.
I'm attaching an example file of what I meant, only I'm using curvature instead. Hope it helps!

Cheers,

Image Not Found

The scene helps but in my case I'm using a DOPImport and it's not translating this is my node graph hoping it helps as I'm not seeing any results from the dist attribute ?

Attachments:
dop_raycast.jpg (43.8 KB)

【T】【C】【S】
User Avatar
Member
696 posts
Joined: March 2009
Offline
_Christopher_
The scene helps but in my case I'm using a DOPImport and it's not translating this is my node graph hoping it helps as I'm not seeing any results from the dist attribute ?

Switch the order of the nodes going into the Ray SOP. What I sent you was a potential solution for the "ugly" edge artifacts you mentioned here [www.sidefx.com], nothing more.

Cheers,
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
766 posts
Joined: April 2014
Offline
rafaels
_Christopher_
The scene helps but in my case I'm using a DOPImport and it's not translating this is my node graph hoping it helps as I'm not seeing any results from the dist attribute ?

Switch the order of the nodes going into the Ray SOP. What I sent you was a potential solution for the "ugly" edge artifacts you mentioned here [www.sidefx.com], nothing more.

Cheers,

I did switch the order based on the graph seen above I placed the right side into input1 of the raysop and the left side into input2 of the raysop; it still is not recognizing the dopimport in relation to my original question as there is not values for the dist attribute.

Edit
What I think the issue is that ray sop does not work with dop imports it doesn't know how to calculate the hit attribute. Unless there is way I'm guessing that I have to cache it out ?
Edited by _Christopher_ - April 7, 2024 17:25:55
【T】【C】【S】
  • Quick Links