1
$\begingroup$

I create a BMesh using some vertices like this:

def create_object(self):
    # Create a mesh and an object and 
    # add the object to the scene collection
    mesh = bpy.data.meshes.new("MyMesh")
    obj  = bpy.data.objects.new("MyObject", mesh)

    bpy.context.scene.collection.objects.link(obj)

    bpy.ops.object.select_all(action='DESELECT')

    bpy.context.view_layer.objects.active = obj
    obj.select_set(state=True)

    # Create a bmesh and add the vertices
    # added with mouse clicks
    bm = bmesh.new()
    bm.from_mesh(mesh) 

    for v in self.vertices:
        bm.verts.new(v)

    bm.verts.new(self.vertices[0])

    bm.faces.new(bm.verts)

    bm.to_mesh(mesh)  
    bm.free()


    bpy.context.view_layer.objects.active = obj
    obj.select_set(state=True)

    bpy.ops.object.editmode_toggle()
    bpy.ops.mesh.select_all(action='SELECT')

    bpy.ops.mesh.remove_doubles()

    # set origin to geometry
    bpy.ops.object.editmode_toggle()
    bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')

This creates a simple object with a face. Then I extrude it in edit mode and do a bool (diff) operation with it, which leads to distortions when I do a bevel operation afterwards.

Here is he created object:

enter image description here

And I do a diff bool after that to a cube and then bevel an edge

enter image description here

Any ideas what is wrong with the BMesh?

$\endgroup$
1
$\begingroup$

Ah got it, the normals were inside after extrude, didnt see it for I was in eevee render and no normals overlay activated:-)

|improve this answer|||||
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.