Problems with using Karamba.Algorithms.OptiCroSec.solve

I’m trying to optimize my beam profiles using the Karamba.Algorithms.OptiCroSec.solve - method, but I don’t quite understand how to use this command correctly. I’m unsure about some of the inputs, like List<Vector3> targetDeformDirs, List<Vector3> targetDeformPlanes, and a few others.

In my code, I’m first trying to optimize my "internalBeams", and then using the model with optimized cross-sections to optimize other beam groups. It looks like the method does something, but the results aren’t really what I expected.

Could you explain in more detail how this method works and whether the way I’m using it makes sense?
I’m attaching my component code and Grasshopper file for reference.

Thank you very much for your help!
KarambaOpti_v3.gh (196.1 KB)
Karamba_Componentv3.txt (31.6 KB)

Uploding the post again, since last time I forgot to upload the code.

Dear @Aleksander_Tybura,
I wasn’t able to run the definition as I am missing the “Karamba_Coimponentv3” plug-in that you developed.
You can find the API documentation for OptiCroSec.solve here. The “targetDeformDirs” option allows you to set maximum displacement constraints in specific directions (e.g., only downwards), while “targetDeformPlanes” enables limiting the maximum displacement within a plane (e.g., horizontal shift).
You code is quite extensive therefore I couldn’t go through it full length. To help resolve the issue, it would be useful to have a simple system (e.g. a cantilever consisting of one beam) for testing.
– Clemens