diff --git a/nodes/modifier_change/extrude_region.py b/nodes/modifier_change/extrude_region.py index 08497fb869..5cffaf3896 100644 --- a/nodes/modifier_change/extrude_region.py +++ b/nodes/modifier_change/extrude_region.py @@ -219,6 +219,7 @@ def process(self): if face_data: face_data_matched = repeat_last_for_length(face_data, len(faces)) + # see: https://github.com/nortikin/sverchok/pull/4999#issuecomment-1734256435 need_fake_face = True loops = [[faces]] if need_fake_face: @@ -307,6 +308,7 @@ def process(self): extrude_geom = new_geom + # see: https://github.com/nortikin/sverchok/pull/4999#issuecomment-1734256435 if need_fake_face: for loop in loops: bm.verts.ensure_lookup_table() diff --git a/nodes/modifier_change/mesh_separate.py b/nodes/modifier_change/mesh_separate.py index e756bee198..c5d77ad8cb 100644 --- a/nodes/modifier_change/mesh_separate.py +++ b/nodes/modifier_change/mesh_separate.py @@ -48,50 +48,6 @@ def process(self): verts_out = [] poly_edge_out = [] for ve, pe in zip_long_repeat(verts, poly): - # # build links - # node_links = {} - # for edge_face in pe: - # for i in edge_face: - # if i not in node_links: - # node_links[i] = set() - # node_links[i].update(edge_face) - - # nodes = set(node_links.keys()) - # n = nodes.pop() - # node_set_list = [set([n])] - # node_stack = collections.deque() - # node_stack_append = node_stack.append - # node_stack_pop = node_stack.pop - # node_set = node_set_list[-1] - # # find separate sets - # while nodes: - # for node in node_links[n]: - # if node not in node_set: - # node_stack_append(node) - # if not node_stack: # new mesh part - # n = nodes.pop() - # node_set_list.append(set([n])) - # node_set = node_set_list[-1] - # else: - # while node_stack and n in node_set: - # n = node_stack_pop() - # nodes.discard(n) - # node_set.add(n) - # # create new meshes from sets, new_pe is the slow line. - # if len(node_set_list) > 1: - # for node_set in node_set_list: - # mesh_index = sorted(node_set) - # vert_dict = {j: i for i, j in enumerate(mesh_index)} - # new_vert = [ve[i] for i in mesh_index] - # new_pe = [[vert_dict[n] for n in fe] - # for fe in pe - # if fe[0] in node_set] - # verts_out.append(new_vert) - # poly_edge_out.append(new_pe) - # elif node_set_list: # no reprocessing needed - # verts_out.append(ve) - # poly_edge_out.append(pe) - vo, po, _ = separate_loose_mesh(ve, pe) verts_out.extend(vo) poly_edge_out.extend(po) diff --git a/utils/mesh/separate_loose_mesh.py b/utils/mesh/separate_loose_mesh.py index 1c7527170c..acd0242d70 100644 --- a/utils/mesh/separate_loose_mesh.py +++ b/utils/mesh/separate_loose_mesh.py @@ -25,6 +25,15 @@ from sverchok.utils.nodes_mixins.sockets_config import ModifierLiteNode def separate_loose_mesh(verts_in, poly_edge_in): + ''' separate a mesh by loose parts. + input: + 1. list of verts + 2. list of edges/polygons + output: list of + 1. separated list of verts + 2. separated list of edges/polygons with new indices of separated elements + 3. separated list of edges/polygons (like 2) with old indices + ''' verts_out = [] poly_edge_out = [] poly_edge_old_indexes_out = [] # faces with old indices