What's wrong with c#?

hi.
I started c#.
But in C#, FirstBrep is rotated.
It just wants to stay in place.
What’s wrong with c#?



rotatedBrep.gh (8.2 KB)

I dont know C# so well, but maybe:

    FirstBrep = brep.DuplicateBrep();

    double angle = Rhino.RhinoMath.ToRadians(180);
    Transform xform = Transform.Rotation(angle, cent);

    brep.Transform(xform);

    RotatedBrep = brep;

You are perfect. Thank you very much.

It is the classical problem with class and struct.
Struct are duplicated, class are passed by reference like an adress. So if you change what is inside the adress …

I’ve been struggling with this problem all afternoon.
Thank you.