0
$\begingroup$

I'm creating a molecular model where I need to rotate a cylinder (representing a chemical bond) around the normal vector of its end face. The cylinder connects to an OH group (represented by red and grey spheres with another cylinder between them), and I need the bond to rotate so the OH group moves with it (direction is shown with an arrow in the picture). enter image description here

My current geometry nodes setup uses Capture Attribute to store the face normal of the cylinder's end, then connects it to the Axis input of a Vector Rotate node. When I disconnect the normal from Vector Rotate and use standard X/Y/Z axis rotation, the bond does rotate, but this isn't useful because the cylinder is not aligned with any global axis and cannot be due to the molecular geometry. When I connect the captured face normal to the Vector Rotate axis input, it doesn't rotate at all.

If I just connect a Vector node to the Axis socket it doesn't seem to rotate at all when the Vector node is set at 0, 0, 0. If you change one of them to a non-zero value then it rotates. So I think probably what is happening is the Capture Attribute is passing all zeros to the Axis node for some reason. Not sure why that would be.

The goal is to rotate the cylinder around its actual bond axis (the end face normal) rather than global axes, so that the attached OH group rotates properly with the bond. Ideally, the solution should be using geometry nodes, as I'd love to use it more than once and don't want to waste time creating other systems. I already have another way of rotating the OH group by setting the 3D cursor to the oxygen (red sphere), setting the origin of the O-H bond to the 3D cursor, aligning the cylinder's local axis, then parenting the OH group to the bond and rotating it using that axis - but it's too long and inconvenient, while with a geometry node setup I could apply it to other bonds as well. Here's a link to video where I'm doing rotation the old way: link to video If I could get the same result by using geometry nodes setup, that would be amazing.

What's the proper way to rotate a cylinder mesh around a captured face normal vector in geometry nodes? Should I be using Transform Geometry or a different node setup entirely? Any guidance on the correct node chain for this type of molecular bond rotation would be greatly appreciated. Thank you.

$\endgroup$
3
  • 1
    $\begingroup$ The logic of the setup doesn't make sense, see: Geometry Nodes: What Does Capture Attribute Add to Geometry?, your question is an example of an XY problem because in the title you describe your choice of a a solution as opposed to the actual problem - the title likely should be: how to rotate a cylinder around its axis. However, from the description I think it still won't do what you want it to do, as this will rotate geometry data and NOT the parented children ("attached OH group"). $\endgroup$ Commented Jul 16, 2025 at 7:53
  • 1
    $\begingroup$ Unless the parented children are parented to a triangle on the cylinder (vertex parenting). Your link doesn't work (no access). $\endgroup$ Commented Jul 16, 2025 at 7:54
  • $\begingroup$ @MarkusvonBroady As for the link, my bad; I managed the limitations, you should have access to it now (drive.google.com/file/d/1zLgtqZXSGV8gHTJlZz0rZAvFgeXh3WeW/…). If you could have a look and see what I mean by rotating the cylinder with other objects parented to it, that would be really nice, as it shows what I'm trying to do but using geometry nodes. $\endgroup$ Commented Jul 22, 2025 at 8:58

1 Answer 1

2
$\begingroup$

i am not sure whether this is what you want, but that's how i thought you meant it ;)

So i am creating the cylinder here in the GN node tree, the icosphere is "from outside". You can rotate and move the icosphere as you like, the z-rotation of the cylinder will continue. You can also change the index of the face of the icosphere so that the cylinder will always start on the position of that face and will be oriented to its normal.

Hope it helps.

enter image description here

after 2x scaling my gif - BSE still refuses to accept it, so i put the link of my gif here from github: https://github.com/luckychris/gifs/blob/115d9f2d352ccacad0e6ad805f94d22a21e827ee/cylinder%20facing%20to%20face%20normal%20small.gif

$\endgroup$
1
  • $\begingroup$ Comments have been moved to chat; please do not continue the discussion here. Before posting a comment below this one, please review the purposes of comments. Comments that do not request clarification or suggest improvements usually belong as an answer, on Blender Meta, or in Blender Chat. Comments continuing discussion may be removed. $\endgroup$ Commented Jul 17, 2025 at 12:28

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.