# How to get Hair Curves as Instances in Geometry Nodes

I would like to use the new hair curves (Blender 3.3) as an input for an already existing geometry node. This node expects a collection of curves (i.e. curve instances). I don't see how I can change that node to work with one geometry containing all curves. So is it possible to convert the geometry I get from the hair Curves object into a collection of curve instances (each curve -> one instance)?

Edit:
Shortly after my question here someone asked a similar question: Is it possible to convert mesh islands to instances? There are currently two answers following the same basic idea. This is IMO the neater one: https://blender.stackexchange.com/a/276930/139016 The Idea is to use a cascade of Separate Geometry nodes where the Selection input is given by the Island Index output of a Mesh Island node. This way one needs N Separate Geometry nodes to convert N islands into N instances.

For my problem regarding the new hair curves I would need many such steps. Currently experimenting with creating a 10 Islands to Instances group node, based on this a 100 Islands to Instances node, ...

I found a solution which works for me. It is limited to max. 1000 curves, but could be extended easily (just there will always be an upper limit).

To make the Mesh Islands node work, the curves need to be converted into a mesh, which is converted back to curves at the end.

The first node group in the above screenshot (Islands To 1000 Instances) is just using another node group in a cascading manner which splits up mesh islands into 100 Instances:

Islands To 100 Instances works the same...

Finally Islands To 10 Instances is doing the work. By using Mesh Islands and Separate Geometry 10 times. By using the Index output of Mesh Islands it selects all but the first island and returns that first by the Inverted output slot. (not my idea but taken from here: enter link description here)

All the Islands To X Instances groups are always creating the same number of instances (10, 100 and 1000 respectively). For N input curves all instances > N will be just empty. To get rid of those empty instances I'm using this node group on the results: (to be honest, I'm not entirely sure why this last node actually works)

With that I'm now able to use my hair system together with the new hair curves (I created my hair system actually before the new curve / geometry node based hair system came out).

Update

I don't know if the information about what is an island is directly stored in the internal data model or if it is computationally expensive. But just in case I have created another setup, because the above calls Mesh Island a 1000 times on 1000 different meshs (each reduced by one island).

First step here is to call Mesh Island once and capture the result for all other steps.

1000 islands: 100 islands (indices [offset..offset+100[): 10 islands (indices: [offset..offset+10[):