diff options
author | Mikhail Rachinskiy <mikhail.rachinskiy@gmail.com> | 2019-10-09 18:28:21 +0300 |
---|---|---|
committer | Mikhail Rachinskiy <mikhail.rachinskiy@gmail.com> | 2019-10-09 18:28:21 +0300 |
commit | 8aa0fcd8b92500d2d1d33a60216da76f74b37fb8 (patch) | |
tree | c717f2554d465b771b93439e06df23661da53ba8 /object_print3d_utils | |
parent | 3d1eb9c25c5969f01f66752479f9454604178fc0 (diff) |
3D-Print: remove Clean Isolated tool
This is already handeled by Make Manifold.
Diffstat (limited to 'object_print3d_utils')
-rw-r--r-- | object_print3d_utils/__init__.py | 1 | ||||
-rw-r--r-- | object_print3d_utils/operators.py | 62 | ||||
-rw-r--r-- | object_print3d_utils/ui.py | 4 |
3 files changed, 1 insertions, 66 deletions
diff --git a/object_print3d_utils/__init__.py b/object_print3d_utils/__init__.py index 9147bb08..c654940f 100644 --- a/object_print3d_utils/__init__.py +++ b/object_print3d_utils/__init__.py @@ -143,7 +143,6 @@ classes = ( operators.MESH_OT_print3d_check_sharp, operators.MESH_OT_print3d_check_overhang, operators.MESH_OT_print3d_check_all, - operators.MESH_OT_print3d_clean_isolated, operators.MESH_OT_print3d_clean_distorted, # operators.MESH_OT_print3d_clean_thin, operators.MESH_OT_print3d_clean_non_manifold, diff --git a/object_print3d_utils/operators.py b/object_print3d_utils/operators.py index b142cfbb..3f252015 100644 --- a/object_print3d_utils/operators.py +++ b/object_print3d_utils/operators.py @@ -337,68 +337,6 @@ class MESH_OT_print3d_check_all(Operator): return {'FINISHED'} -class MESH_OT_print3d_clean_isolated(Operator): - bl_idname = "mesh.print3d_clean_isolated" - bl_label = "3D-Print Clean Isolated" - bl_description = "Cleanup isolated vertices and edges" - bl_options = {'REGISTER', 'UNDO'} - - def execute(self, context): - obj = context.active_object - bm = mesh_helpers.bmesh_from_object(obj) - - change = False - - def face_is_isolated(ele): - for loop in ele.loops: - loop_next = loop.link_loop_radial_next - if loop is not loop_next: - return False - return True - - def edge_is_isolated(ele): - return ele.is_wire - - def vert_is_isolated(ele): - return not bool(ele.link_edges) - - # --- face - elems_remove = [ele for ele in bm.faces if face_is_isolated(ele)] - remove = bm.faces.remove - for ele in elems_remove: - remove(ele) - change |= bool(elems_remove) - face_count = len(elems_remove) - del elems_remove - - # --- edge - elems_remove = [ele for ele in bm.edges if edge_is_isolated(ele)] - remove = bm.edges.remove - for ele in elems_remove: - remove(ele) - change |= bool(elems_remove) - edge_count = len(elems_remove) - del elems_remove - - # --- vert - elems_remove = [ele for ele in bm.verts if vert_is_isolated(ele)] - remove = bm.verts.remove - for ele in elems_remove: - remove(ele) - change |= bool(elems_remove) - vert_count = len(elems_remove) - del elems_remove - # --- - - self.report({'INFO'}, f"Removed Verts: {vert_count}, Edges: {edge_count}, Faces: {face_count}") - - if change: - mesh_helpers.bmesh_to_object(obj, bm) - return {'FINISHED'} - - return {'CANCELLED'} - - class MESH_OT_print3d_clean_distorted(Operator): bl_idname = "mesh.print3d_clean_distorted" bl_label = "3D-Print Clean Distorted" diff --git a/object_print3d_utils/ui.py b/object_print3d_utils/ui.py index e9a7f039..e43f5ef1 100644 --- a/object_print3d_utils/ui.py +++ b/object_print3d_utils/ui.py @@ -109,9 +109,7 @@ class VIEW3D_PT_print3d_cleanup(Panel, Setup): print_3d = context.scene.print_3d - col = layout.column(align=True) - col.operator("mesh.print3d_clean_isolated", text="Isolated") - row = col.row(align=True) + row = layout.row(align=True) row.operator("mesh.print3d_clean_distorted", text="Distorted") row.prop(print_3d, "angle_distort", text="") layout.operator("mesh.print3d_clean_non_manifold", text="Make Manifold") |