C# Script on top of FlexCLI, RegisterCustomConstraints problem

I would like to ask about FlexHopper.

How do you assign RegisterCustomConstraints?
I have problem assigning indices in shapeMatchingIndices.

int shapeMatchingIndices;
scene.RegisterCustomConstraints(anchorIndices, shapeMathingIndices, shapeStiffness, springPairIndices, springStiffness, springDefaultLengths, triangleIndices, triangleNormals);
flex.SetScene(scene);

It needs an int data type, a one dimensional array.

I don’t understand how to make each rigid body point indices separated in one dimensional array.

i tried two options in the code,
first option is trying to initiate RegisterCustomConstaints, assuming it will be referenced in a list.
second option is like a flatten list. it assumes all the indices as a single component.

My objective is to get the second option to work and able to get the translation for the “original brep”
Or if it’s too much too ask, can you give me some lead to solve this?

Attached is the c# code in grasshopper file and FlexCLI dll.
Thank you.

For documentation on github regarding FlexHopper can be found here.
FlexCLI.zip (63.7 KB)
FlexCLIRegisterCustomConstraints.gh (40.2 KB)

Kind regards,
Ignatius

1 Like