Notifications
Clear all

[Closed] select Overlapping faces – Editable poly SCRIPT?

Hey everybody,
i´m trying to make a new script that selects faces in a editable poly, but i can´t seem to find my way through this. Should i go to the normal? vertex position ? is there a way to get the face position. i have absolutly no ideas…
can you Help…
bernardo

4 Replies

Do you mean two faces sharing all the same verts? You could loop through every face, save the vert numbers from every face, and compare the arrays.

well not quite but something like that…
a face can be overlapping without any vertices beeing coincidents.
just think of triangle a and b both completly overllaping and then you rotate throu b trinagle´´s normal axis and you got to faces that are overlapping and not coincidents when it comes to their vertices…
what i think is the way is to get the Diagonal of the face and if it there are one or two coincident points between the two of them you have a coincident face… but i don´t know hos to compare the two diagonals. hugs bern

A way to know if polygon A overlaps polygon B, would be projecting polygon A onto polygon B. Doing this, the problem happens to be 3D to 2D.

Done that, you have to verify if some edge of polygon A intersects with some edge of polygon B. If this happens, polygon A overlaps polygon B.

But that could be very expensive, though. Mainly in MAXScript.

hello :
my idea :

define a struct with object, facelist in it .

define a function to filter the faces which are overlaping :

  1. with same face direction .
  2. distance between two faces in local Z axis of faces is too short , or to say close enough .
  3. loop the vertexes of one face : one of each of 3 vertexes and the other 3 vertexes of the opposite face . with this 4 vertexes , we can get the area of 3 tri_faces , if the sum of this 3 faces is too close to the area of opposite face, that mean the vertex is too close to the opposite face , and if one of vertex of a face is like this , we can say the faces have some area overlaped . just like a pyiamid with triangle bottom., if the height is too small , that means the top vertex almost in the bottom face.
  4. maybe u can add more test ways here…

loop all the objects faces .search the overlap items . with upper function . collect the result to a array , with struct as item of the array .

add a mesh_select modify to the objects u select . because it can select faces from difference object .

use the struct array , select all faces in it (use keep paramater.), show it in viewport as red faces .


this is my idea , and can be works fine . the speed is not so low for me .