Rotate a track 180 degree using pcbnew python

Hello to all

I want to know that can i rotate a track 180 degree using pcbnew python.
There is option of tracks.Rotate() though it is asking for arotCentre and angle, I know about angle but what does aarotCentre represent or asks?

Also can I use Set selection to rotate all the tracks to 180 degree at a time.

your response will be highly appreciated.
Thankyou in advance.

arcCentre should be center of rotation. But if you just need to rotate 180 degree thats easy, if it’s x1,y1 to x2,y2 and you want to rotate around x1y1 then the other end should be x2-2*(x2-x1), y2-2*(y2-y1)

Thankyou for your response.
I will try it.
But what if I want to rotate all the tracks at a time with a single reference.
How can I do that?

for tracks in pcb.GetTracks():
tracks.Rotate(arotcentre, angle) ?

Yes, that should work.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.