Thank you for reaching out to us. I am not quite sure how your last sentence is meant,
I manage to do this type of rotation, with matrices and with a change of Cartesian coordinate system, but I know that there is a much simpler method with C4D python functions
but you can define a rotation matrix from an axis of rotation v and an angle w with the function c4d.utils.RotAxisToMatrix(v, w). I.e., to transform vertices of an object, you would do something like this:
axis: c4d.Vector = c4d.Vector(1, 2, 3)
theta: float = c4d.utils.DegToRad(45)
transform: c4d.Matrix = c4d.utils.RotAxisToMatrix(axis, theta)
transformedPoints: list[c4d.Vector] = [transform * p for p in somePointObject.GetAllPoints()]
This transformation would however here happen in local object space, i.e., the space vertices/points are being expressed in. If you want to do the rotation in a space relative to the polygon, you will have to construct a frame for that polygon first, then convert the points out of local object space into your custom polygon space, carry out your rotation, and then convert the points back. I am just mentioning this because you talk about '[..] do[ing] a rotation for a polyon' which somewhat implies that you want to rotate around the origin of the polygon and some frame implied by the polygon.