For a Long time i was looking for a way to make this possible:
I had to duplicate many times the same node to make the function “remesh” for a larger amount of times, because it belongs to the MeshToolkit package.
So i didn’t know how to make it run inside python. Anyhow finally figured out a way, so i wanted to share it for those who may have the same problem, and it also works with other functions.
I leave here the code for those interested:
def FuncLoop(eq,func,elem)
{
return = [Imperative]
{
list2 = {};
ind = 0;
for (l in 1…eq)
{
if (ind >=1){
list2[ind] = __Apply(func,list2[ind-1]);
ind = ind + 1;
}
else{
list2[ind] = __Apply(func,elem);
ind = ind + 1;
}
}
return = list2[eq-1];
}
};
FuncLoop(loops,functioN,element);