Comment 0 for bug 1736722

Revision history for this message
Houbrechts Didier (tetrao) wrote :

This is for the wishlist ...
I mainly use Inkscape to compare insects specimens on picture with shapes/venations already known...
For that I need to transform the shape using 3 points that I already know on the picture using Object > transform > matrix.
I have looked for an already made extension for Inkscape and found nothing.
I join a sample to make you understand ...
I open the picture (on the left of my drawing and using bezier trace some interesting points and 3 very important points (called K,L,M on this sample) I already know I have them on shapes/venations (called A, B, C),
Then I create a new layer and import my shape (with the points A, B, C)
I need to calculate the affine transformation for A,B,C to match K,L,M
For this I read the coords of the points A,B,C in the layer, they will form the Matrix A, read the coords of the matching points K,L,M they will form Matrix B.
Outside Inkscape, using matrix calculator online, I do :
Mat A > inverse(Mat A), (inverse(Mat A)) * Mat B, and finaly transpose the result.
I get the coefficients needed to make the transformation using Object>transform>Matrix !

in the sample :
A= 856.862,63.833,1
B= 977.619,119.044,1
C= 1005.342,40.340,1
K= 157.152,250.870,1
L= 109.273,353.902,1
M= 168.368,375.494,1

Mat A = (A,B,C)
Mat B = (K,L,M)

Coefficients to use are :
-0.046, -0.767, 245.370
0.843, 0.023, -472.821

Everything works well and fine...
Perhaps this could be used by other to do an extension ??
Regards,
Didier