Exclude faces from Normal SOP's By Face Area
3725 5 1-
- NickEast
- Member
- 8 posts
- Joined: April 2018
- Offline
The Normal SOP's By Face Area weighting method (aka Face Weighted Normals) adjusts the vertex normals based on the size of the faces, so bigger faces have a higher weight. This means all faces influence the normals, and therefore still creates some level of curvature on the large faces instead of making them flat. I'm currently still not entirely up to speed with Houdini's API in VEX, and still quite inexperienced with “low-level” geometry manipulation. So I wanted to ask what I can do to essentially have Face Weighted Normals while ignoring the weight of faces below a chosen threshold so that only the larger faces influence the normals.
-
- FDX3245
- Member
- 38 posts
- Joined: July 2019
- Offline
-
- NickEast
- Member
- 8 posts
- Joined: April 2018
- Offline
FDX3245That's not quite what I had in mind. This method excludes faces from the entire weighted calculation, therefore creating hard edges. What I need is to have the same functionality as ‘By Face Area’, but then make the larger faces a full weight of ‘1’ so the smaller faces don't influence the normal at all.
I'm not really sure why you would want to, but you can use a measure sop to measure area, and then a group expression with something like: @area >= chf(“Threshold”). Then if you run a normal node with this group you will only be affecting the vertices within the group.
Like this method:

But ‘By Face Area’ weights the faces to determine how much they influence the normal direction. So if the proportions between the flat surface and the bevel is too small, the normals are closer to being averaged, and not making the flat surface look flat. So the faces of the bevel should have a weight of zero so they don't influence the weight calculation of the normal. Doing this by hand on more complex models is impractical.
So the goal is to say, bevel hard edges, calculate normals By Face Area, and any face below a certain size (or outside a certain size range) should have its weight set to zero so they don't influence the weighting of the normals. The flat surface looks flat, and the bevel looks smooth.
Edited by NickEast - Dec. 22, 2019 06:52:17
-
- NickEast
- Member
- 8 posts
- Joined: April 2018
- Offline
It seems like I got it to work, at least as a basic example.
Basically I go through each primitive of a point, get its intrinsic ‘measuredarea’ value, and check if the surface area is above a certain threshold. If it is, its prim_normal is used to calculate the total weight. This is then used as the normal for that point. If the area is too small, it is ignored.
So there's that
Now all I need to do is to add more options for grouping so that I can use groups rather than measured surface area.
Basically I go through each primitive of a point, get its intrinsic ‘measuredarea’ value, and check if the surface area is above a certain threshold. If it is, its prim_normal is used to calculate the total weight. This is then used as the normal for that point. If the area is too small, it is ignored.
So there's that

Edited by NickEast - Dec. 22, 2019 08:33:48
-
- jsmack
- Member
- 8172 posts
- Joined: Sept. 2011
- Offline
Here's an example that uses the face area for weighting. The weight is set to zero if the ratio of the face area to the max face area of the faces that share the point exceeds a threshold. Using a ratio allows the normals to be calculated on the bevels themselves using the same logic, rather than falling back to average normal. This causes the bevel sides to render with a proper cylindrical normal rather than an elipsoid.
-
- NickEast
- Member
- 8 posts
- Joined: April 2018
- Offline
jsmack
Here's an example that uses the face area for weighting. The weight is set to zero if the ratio of the face area to the max face area of the faces that share the point exceeds a threshold. Using a ratio allows the normals to be calculated on the bevels themselves using the same logic, rather than falling back to average normal. This causes the bevel sides to render with a proper cylindrical normal rather than an elipsoid.
Thank you, that looks exactly like I wanted. Now to dissect the code and study it (also to dive more into Vex). Thank you.
-
- Quick Links