Geometry node - instantiating a cube only in the middle of another geometry edge

I would like to instantiate a cube in the middle of an edge of an ico sphere.

I'm thinking about converting to a curve, subdividing it and then make a mask between the primitive sphere and the subdivided sphere, but I'm stuck on how to do this.

I found the post How to create instances in the centers of faces or edges, instead of on verts?, but it was done with the legacy version of the geometry nodes.

• What is an "ico sphere"? Commented May 19, 2022 at 8:58

Just a follow-up to the commentary on @possibly ferret's answer. You can instance directly on the edges of a mesh, and set the rotation, too..

.. here, in 2 stages: 1. around 'Auto' to put Z on the normal, 2. around the (now good) 'Z' to put Y down the edge.

• this is briliant Commented May 19, 2022 at 1:52

You could convert the mesh to curves, then subdivide, and with the node Endpoint Selection select the middle points and instantiate there.

If you also want to transfer the rotation from the edges to the instantiated cubes, you can capture the selection of the middle points with the node Capture Attribute.

In order to align the cubes correctly, you would first have to capture the normals of the faces and combine it with the rotation you get from the Curve to Points node. You can then pass the resulting rotation directly to the Instance on Points node.

• Perfect, thanks a lot for quick and detailled answer! Commented May 18, 2022 at 12:37

The simplest way to do it, is by using a mesh to points set to edges:

• That's right, this is technically the easiest way to find the center point, but the rotation unfortunately makes no sense at all here because of the missing tangents/normals. Commented May 18, 2022 at 13:13
• yes that's true, unfortunately you will still need to do the curve tangent method to achieve that Commented May 18, 2022 at 13:14