Page 1 of 1

Rotating Polygons

Posted: Mon Jul 21, 2008 2:26 pm
by RobertC
I needed to rotate polygons but found that polygons do not have an "angle" property like images have.
I wrote a few routines to do the job, they may come in handy.
See
http://www.robertcailliau.eu/Alphabetic ... ation.html

and I'll be happy with constructive comments.

Robert.

Posted: Mon Jul 21, 2008 6:00 pm
by FourthWorld
Nicely done.

For the future, this prompted me to submit a request to have the angle property honored for all graphics - you can add your vote here:
http://quality.runrev.com/qacenter/show_bug.cgi?id=6816

Posted: Mon Jul 21, 2008 7:18 pm
by bn
Hi,

I agree, an angle property for polygons would be nice. In the meantime on could come close to the functionality with revRotatePoly.

make an irregular polygon, name it "g1"
create a custom property for this graphic "g1" called myPoints
set myPoints to the points of graphic "g1"

create a slider, set the endvalue of this slider to 359

set the script of the slider to:

on scrollbarDrag newValue
lock screen
set the points of graphic "g1" to the myPoints of graphic "g1"
revRotatePoly the name of graphic "g1", newValue
end scrollbarDrag

well it rotates, not bad...

Robert, thank you for the explanations on your website, it helps my 'mathematically challenged mind' a lot :-)

regards

Bernd