Skip to content
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

Calculation of used sites for node "Voronoi on Mesh". #4980

Merged

Conversation

satabol
Copy link
Collaborator

@satabol satabol commented Aug 14, 2023

#4979

Inspired by https://www.youtube.com/watch?v=Ip6JI6Qiiwg but more precise.

Some issue is in this video-tutorial - all emitted points has to be applied to source mesh. If no then result will have glitches.
Not all source sites converts to Voronoi cells. This Pull Request take capability to get only used sites:

image

Voronoi Tower 001
Voronoi Tower.001.blend.zip

Is it sense to add Mask or Indices of used sites?

P.S.
Finally output socket "Sites" was changes to "Sites_idx"

…params for nodes "Voronoi on Solid" (not in output sockets) and "Voronoi on Surface" (not in output sockets)
@portnov
Copy link
Collaborator

portnov commented Aug 14, 2023

  1. I'd say it is more usual for Sverchok nodes to output masks, rather than subsets of vertices.
  2. What if node already exists in the scene, but does not yet have this new output? maybe this is not a problem since the new version of the node was introduced very recently.

@satabol
Copy link
Collaborator Author

satabol commented Aug 14, 2023

  1. I'll do indices
  2. Code to check new output socket exists in the "process" function. But I think a new version is better. )

- replace Sites socket from vertices to indexes (with new socket name "Sites_idx")
@satabol
Copy link
Collaborator Author

satabol commented Aug 14, 2023

@portnov this is new version of file for tests: Voronoi Tower.003.blend.zip (press play for animation)

image
image

@portnov
Copy link
Collaborator

portnov commented Aug 15, 2023

Sites_idx should be a SvStringSocket then?

@satabol
Copy link
Collaborator Author

satabol commented Aug 15, 2023

What do you think about property to switch type socket to a vector or an index for Site_idx? With rename socket to “Site” and show this additional property in “N-panel”.
Update. Now I thing it is bad idea to switch type of socket on the fly.

@satabol
Copy link
Collaborator Author

satabol commented Aug 15, 2023

Fix socket type to SvStringsSocket:
image

For tests:
Voronoi Tower.004.blend.zip

@portnov
Copy link
Collaborator

portnov commented Aug 15, 2023

ok with me.

@satabol satabol merged commit 3fdff8e into master Aug 15, 2023
2 checks passed
@satabol satabol deleted the fix_4979_add_output_socket_Sites_for_node_Voronoi_on_Mesh branch August 15, 2023 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants