Geoemtry nodes wireframe from edges with radius and color from vertex groups

Hey there :slight_smile:

i am searching for a method to create a wireframe from edges. The basis is a mesh without faces. The radius and the color should be affected by two vertex-groups.

This is a minimal example:

geo_test_simple.blend (841.4 KB)

By coincidence i have managed to affect the radius by vertex-Group. I am not shure if this is a proper way to do it. First of all i am a little bit confused about how geometry nodes is using vertex-groups. When i create a group with the name “radius”, the “curve to mesh”-node is automatically affecting the radius. I am not sure if this is a bug or not. Is “mesh to curve” automatically transfering the vertex-group to curve-radius by the name of the group?

What could be a possible approach to color the output-mesh with the vertex-color?

Thanks in advance.

Greetings,
Chris

1 Like

Hi

Use a Viewer Node to see what is going on.

You’ll see your “radius” vertex group attached to the “Points” Domain.
image
Since it is carried through by the Mesh to Curve, it will get used as the Curve’s radius (This is actually something I learned only now, so thanks…)

You can add a Vertex Color and Paint it in Vertex Paint mode…

…but you’ll need to add it to your material (and use Set Material like above) to make it visible.
image

…here painting while the Viewer node is active:
image

…showing color attribute attached to face-corner in spreadsheet:
image

…making the final model (Set Material node required because mesh-to-curve “forgets” the material):
image

Good luck.

3 Likes

TIL. Thanks!

1 Like

Thank you very much zeroskilz! Looks like a great approach. Thanks for the hint with the viewer also.

I am running into an issue with the vertex-groups. Unfortunately, i do not have faces to work with. My actual minimal python-script to color the vertices is producing a group with type of “Face Corner”. Without faces, only type of “Vertex” is working. I do not find any documentation about this. But is it possible to create a vertex-group with the type of “Vertex” instead?

Sorry for asking this weird questions. I am searching for a performative way of thickening and coloring a huge amount of faces for a blender-plugin.

Thanks in advance :slight_smile:

Do not really get your question…but the error you get in the script in one of your screenshots results from the refactor to use generic attributes instead of vertex colors.

Since Vertex colors are deprecated you should now use:

obj.data.attributes['Color']

instead.

2 Likes
bpy.ops.geometry.color_attribute_add(name="Color", domain='POINT', data_type='FLOAT_COLOR', color=(0, 0, 0, 1))

Set the domain to “POINT” or “CORNER”

Good luck.

2 Likes

Thank you very much!
This is working for me:
obj.data.attributes[‘Color’].data[0].color = [0, 1, 0, 1]