Issue with Box Morph not rotating

Hi,

I have a rectangular box curve that has several curves within the shape. My intention is to run this box shape along a curve in grasshopper to match the appropriate squared area using Galapagos. The initial part of the code works fine, the box creates geometry along the curve that matches the squared area. However, the final part of the code, extruding this into 3D geometry and morphing the box to match the shape and then backing out the curves does not. I am not clear why the shape does not morph correctly and so I cannot morph the curves.

Find attached the code and an image of what happens and what I would like to achieve.

Thank you

JAMES_GALAPAGOS UNIT OPTIMIZERIntern.gh (69.4 KB)

A box like Closed Brep is not a box.
Try Mesh Cage Morph, search this forum to get it.

I have tried to use Mesh Cage Morph - to be honest, I’m not advanced enough to really understand this. Are you able to give me a little more insight as to which inputs are which? There seems to be three mesh inputs and I’m not clear if I have to extrude my curves and then brep to mesh them and which are used for target / reference and points and how

Is there any other way to morph curves within a square or rectangle to a curved trapezium etc? Or are there any script examples of this?