I find some sharp edges through bpy.ops.mesh.edges_select_sharp().
Now i Would like to have all neighbouring faces selected (for smoothing…). How can I do this? (through Python…)
Many thanks for help!
I find some sharp edges through bpy.ops.mesh.edges_select_sharp().
Now i Would like to have all neighbouring faces selected (for smoothing…). How can I do this? (through Python…)
Many thanks for help!
bpy.ops.mesh.select_more(use_face_step = True)
or, you can do it manually using BMesh by iterating over the selected edges and using edge.link_faces
bme = bmesh.from_edit_mesh(context.object.data)
sel_edges = [ed for ed in bme.edges if ed.select]
for ed in sel_edges:
for f in ed.link_faces:
f.select_set(True)
bmesh.update_edit_mesh(context.object.data)
You may have to make sure that your mesh selection mode is correct and you may have to toggle into and out of edit mode if using the bpy.ops.
Best,
Patrick
Patrick, many thanks!! That works perfectly for me. Now I can find all sharp edges and smooth them.
First, bpy.ops.mesh.edges_select_sharp()
then
bpy.ops.mesh.select_more(True) several times, to have a broader strip around the edges.
And then bpy.ops.mesh.vertices_smooth()
[QUOTE=patmo141;2869523]
bpy.ops.mesh.select_more(use_face_step = True)