Changing plane using 3 points

Flesh out your ideas for new or improved Inkscape features before submitting a request.
tetrao
Posts: 8
Joined: Fri Nov 24, 2017 7:54 pm

Changing plane using 3 points

Postby tetrao » Fri Nov 24, 2017 8:59 pm

I'm using Inkscape to compare insects by there venation (would call it the shape) using transformations matrix.
To do that I use 3 points on the picture and the same 3 points on the shape I want to compare.
How do I do ?
1. I open the picture in Inkscape. Make a triangle with 3 known points and some other VIP points
2. I create a new layer and import the shape there. On the shape I already have the same 3 points and VIP points.
3. I read the coords of the 3 points from the shape (let say x1,y1, x2,y2 and x3, y3) this is the matrix A of the plane of the shape.
4. I do the same on the picture (let say a1, b1, a2, b2 and a3, b3) this is the B matrix of the plane on the picture.
5. to put the shape in correlation with the picture, I need to transform the shape and put it on the picture. This is done by matrix calculation outside Inkscape A -> A-1, A-1 * B, (A-1*B)T, where A-1 is the inverse of matrix A and (A-1 * B)T is the transposed of A-1 * B.
Doing so I get the coefficients I need to make the transformation in Inkscape using the matrix.
Is it possible to make an extension where we could select the 3 points and tell the system where we want them to be placed ?
As the picture is too large for the forum, I deleted the picture on the left and keep only the part shape (on the left) ... and trace curved lines indicating which point must go where ... so I want the shape on the right to go on the shape on the left (here is a basic sample as the position of the insect is the same on the left and the right ...)
download/file.php"postlink-local" href="download/fileac62.svg">download/file.php
Attachments
2 Trichoptera Stenophylax permistus obs be test Vanmeerbeeck 12128551 GC image and VIP compare - shape only.svg
(13.05 KiB) Downloaded 647 times
1 Trichoptera Stenophylax permistus obs be test Vanmeerbeeck 12128551 GC image and VIP compare - avant - shape only.svg
(13.98 KiB) Downloaded 615 times
Last edited by tetrao on Sat Nov 25, 2017 6:07 am, edited 1 time in total.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Changing plane using 3 points

Postby Moini » Sat Nov 25, 2017 1:05 am

Probably. This sounds very similar to what the Interpolate extension does (to my knowledge).

Or perhaps the lattice deformation live path effect / the transform by 2 points path effect could be useful - but they don't seem to do what you need exactly.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

tetrao
Posts: 8
Joined: Fri Nov 24, 2017 7:54 pm

Re: Changing plane using 3 points

Postby tetrao » Sat Nov 25, 2017 2:06 am

Moini wrote:Probably. This sounds very similar to what the Interpolate extension does (to my knowledge).

Or perhaps the lattice deformation live path effect / the transform by 2 points path effect could be useful - but they don't seem to do what you need exactly.

No, you need 3 points to define a plane, the pictured insects are Never in the same plane, the reason why I use transformation matrix ...


Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Changing plane using 3 points

Postby Moini » Sat Nov 25, 2017 5:09 am

Okay, so it's not necessarily 3 points, but could also be more. Have you looked at the perspective Live Path Effect?
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

tetrao
Posts: 8
Joined: Fri Nov 24, 2017 7:54 pm

Re: Changing plane using 3 points

Postby tetrao » Sat Nov 25, 2017 6:24 am

Moini wrote:Okay, so it's not necessarily 3 points, but could also be more. Have you looked at the perspective Live Path Effect?

No, these 3 points we know on both picture and right shape are needed because we don't know the position of both planes ! We only know that these 3 points are in the planes (define the planes)
That Is the reason why we use transformations matrix from Inkscape ...

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Changing plane using 3 points

Postby Moini » Sat Nov 25, 2017 6:33 am

I guess then your best bet would be to take a look at the interpolate and perspective extensions, and try to transform your drawings by indicating two triangles and an object associated with one of them (or both?). Perhaps also parts of the RealScale extension will be of use to you. They're all written in Python, the first two come with Inkscape, the last one can be installed from https://inkscape.org/gallery/=extension/ .

More info on writing your own can be found at https://inkscape.org/en/develop/extensions/ .
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

tetrao
Posts: 8
Joined: Fri Nov 24, 2017 7:54 pm

Re: Changing plane using 3 points

Postby tetrao » Sat Nov 25, 2017 6:50 am

Moini wrote:I guess then your best bet would be to take a look at the interpolate and perspective extensions, and try to transform your drawings by indicating two triangles and an object associated with one of them (or both?). Perhaps also parts of the RealScale extension will be of use to you. They're all written in Python, the first two come with Inkscape, the last one can be installed from https://inkscape.org/gallery/=extension/ .

More info on writing your own can be found at https://inkscape.org/en/develop/extensions/ .

Thank you Moini, I will try these extensions even if the transformation matrix does it in one time ...

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Changing plane using 3 points

Postby Moini » Sat Nov 25, 2017 6:59 am

I meant to take them as examples for writing your own extension - there doesn't seem to exist an extension / functionality of Inkscape that seems to satisfy your needs. I was showing you the way to make something that does. Then you can make it so it does it in one time, just as you need it.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

tetrao
Posts: 8
Joined: Fri Nov 24, 2017 7:54 pm

Re: Changing plane using 3 points

Postby tetrao » Sat Nov 25, 2017 8:22 am

Moini wrote:I meant to take them as examples for writing your own extension - there doesn't seem to exist an extension / functionality of Inkscape that seems to satisfy your needs. I was showing you the way to make something that does. Then you can make it so it does it in one time, just as you need it.

Thank you very much again, Moini, but I can't make programs, never studied Python !
I got in touch with Mr Hoek (Jeroen) who wrote an extension for Inkscape ( http://jeroenhoek.nl/articles/svg-and-i ... ction.html ). He explain me with a sample I had mail to him that it was possible to write this extension using the xml editor and Python ... In his sample he was using libraries that aren't in Inkscape ...

tetrao
Posts: 8
Joined: Fri Nov 24, 2017 7:54 pm

Re: Changing plane using 3 points

Postby tetrao » Sun Nov 26, 2017 2:47 am


Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Changing plane using 3 points

Postby Moini » Sun Nov 26, 2017 3:21 am

Exactly. So you'll either need to learn programming in Python, or you will have to find someone who will do it for you.
I myself don't have time for this at the moment (and I'd only do it if I were paid for it, and if the client were located in Germany).
You may have some luck if you ask on the Inkscape User mailing list:
https://sourceforge.net/p/inkscape/mail ... cape-user/
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

tetrao
Posts: 8
Joined: Fri Nov 24, 2017 7:54 pm

Re: Changing plane using 3 points

Postby tetrao » Sun Nov 26, 2017 6:28 am

Thank you, Moini, another good link !!!


Return to “Inkscape Ideas”