How to build coplanar faces into a whole face

I have many individual faces which are coplanar. How can I make them as a single face? I have used Fuse,Glue and bool operation(add),however,none could work.
When I set texture to the result shape,the texture still map onto each individual face.

Svetlozar Kostadinov's picture

Look the GeomImpl_GlueDriver class from Salome project.

Alay's picture

You can use feature angle theory for this , take the normal of each faces and count the angle between them . If it is lesser than your feature angle, then it will be in one face. Decide your feature angle mainly between ( 40-45 degree). you can have more or less than that , so make trial around this.

Paul Jimenez's picture

Are the faces at least sewed (they share edges)?

If so, here's an algorithm that may work for you:

* Take the outer wire of all faces.
* Create a list of edges excluding all those that are shared.
* Create a new closed wire with the remaining edges.
* Create a face from this wire.
* If the normal of this new face is opposite to that of the old faces, reverse the face's orientation.

In case of inner wires, just put them all into a list and add them to the final face later.

It's quite some work, but it works.