-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #4976. Node "Voronoi on Solid" produce incorrect results. #4977
Fix #4976. Node "Voronoi on Solid" produce incorrect results. #4977
Conversation
- update using Voronoi. Get new cells for border cells. - update parameter inset (now it use distance. Before was percent.)
('MEAN', "Barycenter", "Scale each region relative to it's barycenter, i.e. average location of it's vertices", 1) | ||
] | ||
|
||
scale_center : EnumProperty( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not used anymore as far as I understand?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not used anymore as far as I understand?
Yes. It is not used more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
||
def draw_buttons_ext(self, context, layout): | ||
self.draw_buttons(context, layout) | ||
layout.prop(self, 'scale_center') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and this also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed. removed.
layout.prop(self, 'scale_center') | ||
layout.prop(self, 'accuracy') | ||
|
||
def scale_cells(self, verts, sites, insets, precision): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed. scale_center removed.
y_min, y_max = box.YMin - clipping, box.YMax + clipping | ||
z_min, z_max = box.ZMin - clipping, box.ZMax + clipping | ||
bounds = list(itertools.product([x_min,x_max], [y_min, y_max], [z_min, z_max])) | ||
verts, edges, faces = voronoi_on_mesh_bmesh(bounds, [ [0,1,3,2], [2,3,7,6], [6,7,5,4], [4,5,1,0], [2,6,4,0], [7,3,1,5] ], len(sites), sites, spacing=inset, mode='VOLUME' ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
numbers in brackets look magic :)
I'd suggest to assign them to a separate variable and add a comment about what is this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What brackets? If an argument for voronoi_on_mesh_bmesh then it is a cube faces that is a bounding box.
9f3875c
to
d17d373
Compare
now it's ok with me :) |
fix #4976. Update node "Voronoi on Solid":
Description of fix:
Source algorithm of node "Voronoi on Solid" try to use closed cells of voronoi (1) for source sites but not all sites are closed. So old algorithm add bounding box points to sites (2):
This produce closed sites that was opened but this is produce some disturbing actions to source sites and some areas of bounding box are still opened. This can produce some glitches:
In other cases it can produce other glitches (view of Voronoi sites):
Result look unpredictable:
So I have a proposal:
Combine 1 and 2 with function voronoi_on_mesh_bmesh. Bounding box exceed solid bounding box for 1 in all directions:
and now results looks good.