Generating open cell structure + Attractor based density control

Hey,
I’ve been working on generating an open celll structure using Iguana Mesh plugin.
However, when I tried to apply the same script to a different solid, it didn’t work as expected. I suspect this is due to the complexity of the geometry, which may be affecting how the mesh elements and point connections are generated.

In Iguana Mesh, I also noticed that there are magnetic field components, which seem to work similarly to attractors. However, I haven’t been able to achieve the expected results when using them to control the density of the structure.

I’m wondering if there is a more robust way to generate this type of structure that would work across different solids. Additionally, I want to incorporate attractors (points or surfaces) to control the density of the structure so that some areas have smaller, denser cells.

Is there a better way to achieve this with Iguana Mesh, or would another approach be more suitable? I’d appreciate any advice.

In the script there is another solid that i want to put the structure in.

IguanaMeshStructure.gh (1.6 MB)

Thanks in advance for any insights!