nolanyee / blender-path-extrude

Blender Polygon Path Extrusion Tool
3 stars 2 forks source link

Removing faces at both ends #3

Closed tnakagome closed 3 years ago

tnakagome commented 3 years ago

Hello again.

This time, I would like to remove the faces at both ends of the result object, both when the path is open-ended and closed.

I could remove one face by calling these functions when the path is closed, but that was not enough.

bpy.ops.mesh.select_interior_faces()
bpy.ops.mesh.delete(type='FACE')

Thanks.

nolanyee commented 3 years ago

Hi,

I updated the code to remove faces at both ends, but only for closed paths.

For open paths I would like to keep it flexible, meaning if you are extruding a ordinary mesh (with faces) it will result in faces at the ends, but if you are extruding just a curve (no faces) it will result in ends without faces.

If you are starting with a mesh with faces and would like to have the final extruded mesh without faces at the ends, just select all the faces in the starting mesh, dissolve them if there are multiple faces (Delete -> Dissolve Faces), then delete only the faces (Delete -> Only Faces), before extruding along the path. Alternatively, if you prefer to use script, you can select the mesh to be extruded and run the code below before selecting the path and extruding: bpy.ops.object.mode_set(mode='EDIT') bpy.ops.mesh.select_mode(type = 'FACE') bpy.ops.mesh.dissolve_faces() bpy.ops.mesh.delete(type = 'ONLY_FACE')

nolanyee commented 3 years ago

Minor correction, if you are using a script to delete faces before running the path extrusion, you will want to select all the faces before dissolving. bpy.ops.object.mode_set(mode='EDIT') bpy.ops.mesh.select_mode(type = 'FACE') bpy.ops.mesh.select_all(action='SELECT') bpy.ops.mesh.dissolve_faces() bpy.ops.mesh.delete(type = 'ONLY_FACE')

tnakagome commented 3 years ago

Thank you! The new code works as expected. I no longer see erroneous polygons inside the wall. Exported STL is also clean now, and Meshmixer accepted the model without errors that I saw previously. Closing.