Dear Community,
I’m trying to do convolution on vertices or faces of a triangle mesh (from trimesh remeshing)
The problem is, the mesh is not a simple grid with rows and columns, so I cannot always use a fixed kernel–I don’t know if a mesh face has 1 or 10 neighboring vertices, for example. Could you please give me some advice?
Thanks a lot!
maje90
(Riccardo Majewski)
January 5, 2024, 3:46pm
2
Can you give further details of what are you trying to do?
Kangaroo2 have this:
very simple but also basilar.
Otherwise you can go to scripting to access RhinoCommon topology methods for meshes… or find a plugin that give you components for the same.
Mesh+ is a set of user objects which enable a wide range of mesh editing, creation, interaction, and topology modification within Grasshopper
1 Like
Thanks for your help Riccardo! VertexNeighbors sound like a great way to start–I will elaborate the operation I want:
My convolution operation is like this:
I have (part of a large) matrix
[ ...
[...1, 2, 3, ...],
[...4, x, 6, ...],
[...7, 8, 9, ...],
...]
to update x, I multiply with a kernel (in this case 3 * 3) centered at x (dot product). I sum values in the resulting 3 * 3 matrix, so I get new value of x here.
The problem is, mesh from trimesh is not a grid with rows and columns like this. The number of neighbors of a vertex changes, too, I’m wondering if a process similar to convolution exist for mesh vertices.
Thanks a gain!
maje90
(Riccardo Majewski)
January 5, 2024, 4:20pm
4
Sorry I’m lost.
I’m not understanding what you are trying to do.
Also I don’t know matrix operations…
Are you trying to “smooth” values through your mesh?
Check this:
I presume you are referring to the cotan weighting option for the Laplacian smoothing force in the old version of Kangaroo. (Kangaroo2 has instead the SoapFilm goal)
MeshMachine also used cotan weighted smoothing for the relocation of the vertices.
Here’s an example showing the effect of cotangent weighting on smoothing values per vertex (shown as colours). The mesh is deliberately uneven in triangle size.
cotanweight_example.gh (28.0 KB)
On the left is uniform weighted smoothing,…
1 Like
Thanks very much for the resources you pointed me to. I’m making progress after reading through them!
1 Like
maje90
(Riccardo Majewski)
January 6, 2024, 12:42am
6
That’s nice.
And… the thread I linked later redirect to this one:
A script demonstrating the Heat Method for Distance Computation, as described here
This came up recently in another thread , and I thought others might find it an interesting example. It is a fast way of getting approximate geodesic distances from a given point to all points on a mesh.
Here solved in an iterative fashion, without any extra numerics library. This is not the fastest way to do it, but it does let you see what’s going on and interact with it.
HeatMethod2.gh (163.7 KB) …
where Daniel Picker go deeper about it.
1 Like