Create a hole inside a bmesh ngon

Hi!

I need to punch a hole in a ngon bmesh face and I’m not sure how to do it.

I tried what I used to do which is creating the shape of the hole from a new mesh object and then connecting the vertices to the ngon and finally deleting the face from the middle. This however did not work (no hole was cut in my ngon face and the face remains whole).

Here is a simple illustration of the situation:



How can I accomplish making the hole inside my bmesh face? I read somewhere that bmesh doesn’t support holes. If this is true then how should I remedy the situation?

It does not support hole as it is currently (maybe in the future though), you will need to add 2 edges that link the boundaries of a hole and the other side of a ngon, by example you could have the 2 edges there :
http://i.imgur.com/7LVEb.jpg

Thank you very much for your reply!

I tried what you suggested on the picture, but I must be something wrong since I still couldn’t get a hole in the ngon. I made a quick video to illustrate what I’m doing so you can perhaps point out my problem:

You need to create a face for all sides, then delete the ngon and square faces, then dissolve the two top edges!

1 - Put the plane where you need inside the ngon
http://i.imgur.com/pC5qP.jpg

2 - select the plane face , press X or Delete then select “Only Face”, do the same with the ngon
http://i.imgur.com/3NrUN.jpg

3 - make a face that link the ngon and the hole, by example here
http://i.imgur.com/z8vLU.jpg

4 - continue to make some faces to fill the empty space
http://i.imgur.com/xlmNZ.jpg

5 - In Edges selection mode, select the edges you want to remove and press X -> Dissolve
But remember in the current state of Bmesh, you will need 2 edges to stay there, it can be whatever edges you want, but it must always be 2
By example :
http://i.imgur.com/7DFFm.jpg

Note : if you want to create an edge inside of an ngon select 2 vertices and press J , not F , as F would create a “floating edge” instead of separating the ngon into more faces

edit : that was what PA32 said, i was too slow in posting this to notice :slight_smile:

Thank you very much, this illustration really helped me undertand the workflow!

Ngon surface is defined with bunch of triangles. Well behaved Ngon need to have convex area. If shape is concave, it is really not clean, although it may look clean.

To see that, just unwrap it. You will see all kinds of triangular shapes running all over it.

http://i1135.photobucket.com/albums/m626/cabby24/Blender%20Pics%202012/ngone.png

Yes, a concept regarding the ngons (at least for the Blender Bmesh implementation) that is important to keep in mind is that they’re here to be helpfull in quickly building your model.

But once you’re finalizing, want to unwrap and do other further work, it is important to get rid of them by either making them into quads or triangles, as Blender by itself do not know how you wish to have those ngons converted and so will do a bad job at “guessing” as shown in ridix post.

Now, Blender features some triangulation/quadification function (CTRL+F -> Triangulate or CTRL+F -> Tris to Quads) , but i suggest to not use this but do the process manually (remember the J key to join 2 vertices inside of a ngon and the K key for the knife to build more edges inside of the ngons if needed) as you will do a much better job than Blender trying to guess where to have the tris and quads.