Hi how to automatic invert normal.
1729 1 0- Stalevarov
- Member
- 7 posts
- Joined: Oct. 2013
- Offline
- Herve
- Member
- 40 posts
- Joined: Aug. 2018
- Offline
if, like it seems to be the case from your screenshot, the majority of your primitives have correct normals, and you want to just correct the "few" inverted ones, then you can simply use a Clean SOP node with the option "orient polygons" checked. Unless you have some really messed up geometrym, it will work.
And after that, if you want to delete the initially inverted normals, then I'd add a primitive wrangle after that. first input from the output of clean node, second input from the output of your node before Clean/initial geometry (as long as both input get the same prims numbers, and order); with this code, for example:
.
And after that, if you want to delete the initially inverted normals, then I'd add a primitive wrangle after that. first input from the output of clean node, second input from the output of your node before Clean/initial geometry (as long as both input get the same prims numbers, and order); with this code, for example:
vector normA = prim_normal(0,@primnum,0.5,0.5); vector normB = prim_normal(1,@primnum,0.5,0.5); if (normA != normB) removeprim(0,@primnum,1);
.
Edited by Herve - Jan. 23, 2021 18:02:01
-
- Quick Links