I have a list with all the normals of all the polygons of an object, that I calculated with this code:

for p in polygons:

a,b,d = points[p.a],points[p.b],points[p.d]

normals.append((b - a).Cross(d - a).GetNormalized())

With this information available, how can I check if two faces are:

- roughly facing each other

- roughly facing in the same direction

- roughly facing opposite directions

?

]]>I have a list with all the normals of all the polygons of an object, that I calculated with this code:

for p in polygons:

a,b,d = points[p.a],points[p.b],points[p.d]

normals.append((b - a).Cross(d - a).GetNormalized())

With this information available, how can I check if two faces are:

- roughly facing each other

- roughly facing in the same direction

- roughly facing opposite directions

?

]]>These are the possible cases. How can I detect them all? Anyone?

]]>You can compute the angle between the normal vectors of the polygons using the dot product.

]]>I know that, Niklas.

But in my image, for example, the angles between the normals in the second and third case is the same: around 180°

How can I differentiate them?

I guess I found a way.

If the angle between the normal is less than 90°, they are pointing in the same general direction.

If the angle is between 90° and 180°, I check if a point of one of the polygons(the center of a polygon) is in front of the other polygon or not.

If it is, the polygons are facing each other.

if not, they are facing in opposite directions.

Am I right?

Just to let everyone know that it worked

]]>