Match on three points
Migrated from https://bugs.launchpad.net/inkscape/+bug/1736722
*From 2017-12-06
Summary:
Houbrechts Didier wrote...
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. It's like changing the plane of an object from one to another knowing 3 points of each plane!I join a sample to make you understand ... I open the picture (see attachments) 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 ??
Migrator's Notes:
- My little pointed head is spinning from this one. Maybe some engineer-type here can make sense out of it. All I gleaned is the submitter was looking for an extension to do this mathematical devilry and didn't find one, hence the feature request. Regarding the rest of the (call it a) summary, I think it's reprinted from secret documents in Edward Teller's briefcase for all I know. Ich verstehe nur Bahnhof.
- After someone figures this one out, can they comment on how useful something like this would be to beginning/intermediate users or would it be a fringe-case feature request only Norbert Wiener could love?
- The only reason I migrated this one is because it's probably the only Inkscape bug report that actually has BUGS!
🐛 🤣