# Blender crashes when adding two more faces to the same mesh with python

I tried to add two faces to the same mesh containing nothing with obj.data.from_pydata([], [], faces) , obj.data.polygons[-1].vertices or bme.faces.new(verts).

They were all success when adding the first face, but blender all crashed when adding the second face.

I even tried different ways when adding the two faces, but blender still crashed.

However, It's work when adding the two faces to different meshes.

I have no idea why blender crashes in this situation and how I can fix it.

By the way, the reason why I need to do that is because I want to use bpy.ops.mesh.intersect(mode='SELECT_UNSELECT', use_separate=True, threshold=1e-06) to cut out the intersection of two faces.

The two faces can be in the same meshes or not, depending on what bpy.ops.mesh.intersect() needs

Please tell me if you have any good suggestion, and thank you in advance.

• A face is defined by three or more vertices, only the index number of the vertex is known to the face. Without vertices it will be reading random data looking for the vertex locations, which would be the cause of the crash. You will need to position the vertices where you want the cut to happen so define the vertex positions and then use them to make the faces. – sambler Jul 14 '17 at 1:58
• I had added 4 vertices and known the index and position of each of them before I added the second face. I followed this method to add the first face and it worked, while it didn't work when adding the second face. – rita33cool1 Jul 14 '17 at 5:23