diff --git a/nodes/spatial/voronoi_on_solid_mk2.py b/nodes/spatial/voronoi_on_solid_mk2.py index ca8bf7d24d..13a9b858fa 100644 --- a/nodes/spatial/voronoi_on_solid_mk2.py +++ b/nodes/spatial/voronoi_on_solid_mk2.py @@ -24,7 +24,6 @@ from sverchok.data_structure import updateNode, zip_long_repeat, ensure_nesting_level, get_data_nesting_level,\ ensure_min_nesting, repeat_last_for_length from sverchok.utils.voronoi3d import voronoi_on_mesh_bmesh -from sverchok.utils.geom import scale_relative, center, diameter from sverchok.utils.solid import BMESH, svmesh_to_solid from sverchok.dependencies import FreeCAD @@ -67,18 +66,6 @@ class SvVoronoiOnSolidNodeMK2(SverchCustomTreeNode, bpy.types.Node): description="Distance to leave between generated Voronoi regions", update = updateNode) - scale_types = [ - ('SITE', "Site", "Scale each region relative to corresponding site location", 0), - ('MEAN', "Barycenter", "Scale each region relative to it's barycenter, i.e. average location of it's vertices", 1) - ] - - scale_center : EnumProperty( - name = "Scale around", - description = "Defines the center, along which the regions of Voronoi diagram are to be scaled in order to make inset", - items = scale_types, - default = 'SITE', - update = updateNode) - flat_output : BoolProperty( name = "Flat output", description = "If checked, output single flat list of fragments for all input solids; otherwise, output a separate list of fragments for each solid.", @@ -98,26 +85,8 @@ def draw_buttons(self, context, layout): def draw_buttons_ext(self, context, layout): self.draw_buttons(context, layout) - layout.prop(self, 'scale_center') layout.prop(self, 'accuracy') - def scale_cells(self, verts, sites, insets, precision): - if all(i == 0.0 for i in insets): - return verts - verts_out = [] - for vs, site, inset in zip(verts, sites, insets): - if inset >= 1.0: - continue - if self.scale_center == 'SITE': - c = site - else: - c = center(vs) - vs1 = scale_relative(vs, c, 1.0 - inset) - if diameter(vs1, axis=None) <= precision: - continue - verts_out.append(vs1) - return verts_out - def process(self): if not any(socket.is_linked for socket in self.outputs): @@ -144,7 +113,6 @@ def process(self): new_inner_fragments = [] new_outer_fragments = [] for solid, sites, inset in zip_long_repeat(*params): - #verts, edges, faces = voronoi_on_solid(solid, sites, do_clip=True, clipping=None) # see more info: https://github.com/nortikin/sverchok/pull/4977 box = solid.BoundBox clipping = 1 @@ -158,7 +126,6 @@ def process(self): inset = repeat_last_for_length(inset, len(sites)) else: inset = [inset for i in range(len(sites))] - #verts = self.scale_cells(verts, sites, inset, precision) fragments = [svmesh_to_solid(vs, fs, precision, method=BMESH, remove_splitter=False) for vs, fs in zip(verts, faces)] if self.mode == 'SURFACE': @@ -171,14 +138,18 @@ def process(self): src = solid if need_inner: - inner = [src.common(fragments)] + inner = [src] + if fragments: + inner = [src.common(fragments)] if self.flat_output: new_inner_fragments.extend(inner) else: new_inner_fragments.append(inner) if need_outer: - outer = [src.cut(fragments)] + outer = [src] + if fragments: + outer = [src.cut(fragments)] if self.flat_output: new_outer_fragments.extend(outer) else: