Stuart Axon
2009-09-21 11:02:22 UTC
Err... OK, so tried nodebox and rotation is anticlockwise there too...
(Image stuff is still wrong though)
Will ask on nodebox mailing list
**Noise is as I've been playing with paths
----- Original Message ----
From: Stuart Axon <stuaxo2-/***@public.gmane.org>
To: shoebox mailing list <shoebot-devel-***@public.gmane.org>
Sent: Saturday, September 12, 2009 3:13:11 PM
Subject: rotation not quite right
Hi,
Rotation seems to go in the wrong direction and be 2x the required amount.... (note only tested on image so far)
I changed the
a =
line in transform.py - case for rotate...
It fixes it, but I'm not sure if it's right
New code in my bitbucket repos (of the filesystem branch)
http://bitbucket.org/stuaxo/shoebot/
I'm not sure if the change is correct, but it looks like this in my branch now:
elif cmd == 'rotate':
if mode == 'corner':
# apply existing transform to cornerpoint
deltax,deltay = m.transform_point(0,0)
a = -args[0] / 2.0
ct = cos(a)
st = sin(a)
m *= cairo.Matrix(ct, st, -st, ct,deltax-(ct*deltax)+(st*deltay),deltay-(st*deltax)-(ct*deltay))
elif mode == 'center':
# apply existing transform to centerpoint
deltax,deltay = m.transform_point(centerx,centery)
a = -args[0] / 2.0
ct = cos(a)
st = sin(a)
m *= cairo.Matrix(ct, st, -st, ct,deltax-(ct*deltax)+(st*deltay),deltay-(st*deltax)-(ct*deltay))
(Image stuff is still wrong though)
Will ask on nodebox mailing list
**Noise is as I've been playing with paths
----- Original Message ----
From: Stuart Axon <stuaxo2-/***@public.gmane.org>
To: shoebox mailing list <shoebot-devel-***@public.gmane.org>
Sent: Saturday, September 12, 2009 3:13:11 PM
Subject: rotation not quite right
Hi,
Rotation seems to go in the wrong direction and be 2x the required amount.... (note only tested on image so far)
I changed the
a =
line in transform.py - case for rotate...
It fixes it, but I'm not sure if it's right
New code in my bitbucket repos (of the filesystem branch)
http://bitbucket.org/stuaxo/shoebot/
I'm not sure if the change is correct, but it looks like this in my branch now:
elif cmd == 'rotate':
if mode == 'corner':
# apply existing transform to cornerpoint
deltax,deltay = m.transform_point(0,0)
a = -args[0] / 2.0
ct = cos(a)
st = sin(a)
m *= cairo.Matrix(ct, st, -st, ct,deltax-(ct*deltax)+(st*deltay),deltay-(st*deltax)-(ct*deltay))
elif mode == 'center':
# apply existing transform to centerpoint
deltax,deltay = m.transform_point(centerx,centery)
a = -args[0] / 2.0
ct = cos(a)
st = sin(a)
m *= cairo.Matrix(ct, st, -st, ct,deltax-(ct*deltax)+(st*deltay),deltay-(st*deltax)-(ct*deltay))