2D to 3D?

Post questions on how to use or achieve an effect in Inkscape.
anne_inkscape
Posts: 8
Joined: Thu May 15, 2014 9:43 pm

2D to 3D?

Postby anne_inkscape » Fri May 16, 2014 4:50 pm

Dear all,
I just started using Inkscape, and it seems to have many possibilities!
There is a specific thing I would like to do:

- I have a 2D 'picture', a figure of a deep ocean transect to be precise.
- I want it to look '3D', as shown in the examples on the right hand side of my figure-under-construction (look in file dropbox link below), - by extending the figure boundaries under an angle to create a 3D effect.

Can this be done in Inkscape?

Thank you!

link: https://www.dropbox.com/s/6bprfw7n58y4q ... figure.svg

anne_inkscape
Posts: 8
Joined: Thu May 15, 2014 9:43 pm

Re: 2D to 3D?

Postby anne_inkscape » Fri May 16, 2014 10:31 pm

Should I add some more information for people to be able to help me?

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: 2D to 3D?

Postby ragstian » Sat May 17, 2014 12:09 am

Hi.

To go from 2d to 3d in inkscape is fairly simple as long as you do isometric projection as in your example.
Doing 'true' 3d perspective is still possible but a little more complicated.

To 'transform' to isometric use the (you guessed it) transform dialog. Shift + Ctrl + M

First select the angle you want, I have used 30 degrees as this fits the axionometric grid as well.
Then use skew with negative angle - then rotate angle - horizontal as in first part of example.
Do it the 'other way around' if you want your image on 'the other side'.
(The extra 'borders have been added manually using 'snap to grid'.)
See Example below;

Image

Sorry for the rather short & quick explanation - 'real' work getting in the way!
Chime back if you need more assistance.
Good Luck!
RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

anne_inkscape
Posts: 8
Joined: Thu May 15, 2014 9:43 pm

Re: 2D to 3D?

Postby anne_inkscape » Sat May 17, 2014 12:18 am

Dear Ragnar,

Thank you for your post.
This is however not the solution I am looking for; The top and side of the graph have to be filled with an 'extrapolation' of the borders of the figure.
An example of that is provided in the file in my Dropbox, or seperately also here: https://www.dropbox.com/s/q5801rvpncsow ... _marie.pdf.

Is that possible as well in Inkscape?

User avatar
Maestral
Posts: 982
Joined: Sat Aug 27, 2011 7:10 am

Re: 2D to 3D?

Postby Maestral » Sat May 17, 2014 12:21 am

Your model is somehow... inconsistent? Should the red portions be toward center or not? ,)

"...by extending the figure boundaries under an angle to create a 3D effect."
This could mean a tone of different things. Could you be a bit more specific?

Interpolation could be a solution (check the Inkscape manual, especially the part about the LPE`a and Interpolation)
:tool_zoom: <<< click! - but, those with a cheaper tickets should go this way >>> :!:

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: 2D to 3D?

Postby ragstian » Sat May 17, 2014 12:27 am

Hi

Sorry for the misunderstanding!
Of course everything is possible in inkscape.
To get the effect you want you have to 'break up' the image somewhat and use the 'parts' individually.
The tops can be made if you make an image of the upper one pixel of the original and then stretch the image and perform the 'skew & rotate magic'.
Same for the axes, just turn them into separate images before importing into Inkscape.

By the way - your project is a perfect candidate for python and matplotlib.
How did you generate the graphs?
I can make some examples as soon as I am through with my 'chores'.

Should I add some more information for people to be able to help me?

You just have to wait for us ta wake up!! :D

RGDS
Ragnar
Last edited by ragstian on Sat May 17, 2014 12:36 am, edited 1 time in total.
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

anne_inkscape
Posts: 8
Joined: Thu May 15, 2014 9:43 pm

Re: 2D to 3D?

Postby anne_inkscape » Sat May 17, 2014 12:35 am

@Maestral: This is just an example, it is 3 times exactly the same plot just taken from the web. I will produce similar plots (using Matlab and/or a nice Ocean Data Viewer called ODV) later during my research project. I found it difficult to explain the boundaries part - I think Ragstian understood it. If you check the examples I linked to, you will probably understand what I mean.

@Ragnar: No of course thank you for your time! I will try what you are describing, but the working week is almost over so I will probably really attack this again on Monday:-). I am very curious about your comment on Python and matplotlib; it would be great to be able to create a view on 3 Antarctica transects without manipulating too much every time - e.g. a script! I will likely create transects with the same dimensions every time, so I just need the manipulation to get them into a nice picture.. One of the reasons I chose Inkscape, is that you can link to a file and when you update the file, all adjustments to the previous file will be applied to the new one instead- thereby making it fairly simple to plot them this way.
Last edited by anne_inkscape on Sat May 17, 2014 12:52 am, edited 1 time in total.

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: 2D to 3D?

Postby ragstian » Sat May 17, 2014 12:40 am

Hi.

I am very curious about your comment on Python and matplotlib;


I am sure we can work something out.
( Matlab is out of my 'leauge' due to high cost! Most of what you do in matlab can be done in python!)

You can send me a PM with mail info if you wish.

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

User avatar
Maestral
Posts: 982
Joined: Sat Aug 27, 2011 7:10 am

Re: 2D to 3D?

Postby Maestral » Sat May 17, 2014 12:46 am

Off topic:
Fingers crossed.
Would like to see what would the two of you come up with
:tool_zoom: <<< click! - but, those with a cheaper tickets should go this way >>> :!:

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: 2D to 3D?

Postby Lazur » Sat May 17, 2014 1:07 am

Hello there,

this topic might be helpful to map precisely a diagram ortographically, as vectors:
http://www.inkscapeforum.com/viewtopic.php?f=5&t=16307.

Also, it may not be totally necessary to have vector images for the result.
You may try to use blender, which way you can make it 3D from the start and render images much faster.

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: 2D to 3D?

Postby ragstian » Sat May 17, 2014 7:39 am

Hi.

Lazur, the formulas might come in handy.
Maybe an extension could do the transforms 'automagically".

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: 2D to 3D?

Postby ragstian » Sun May 18, 2014 10:30 am

Hi.

By slicing the original, import into Inkscape and rotate & skew it's possible to get (close to) what you want;

Image

The 'faint' areas on the top comes from stretching a one pixel high image in Inkscape - for some reason
it gets a 'gradient' - this can be fixed as seen on the left by stacking more images or stretching it in a bitmap editor first.

Good Luck
RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

anne_inkscape
Posts: 8
Joined: Thu May 15, 2014 9:43 pm

Re: 2D to 3D?

Postby anne_inkscape » Wed May 21, 2014 12:42 am

This indeed looks like what I want! Because of the slicing however, it won't be 'automatic'.
What I would like to make, is an Inkscape figure referring (linking!) to figures 1,2 and 3 (which are depth profiles as pictured above) and if I update these figures, the Inkscape figure will be updated as well.
I am quite sure that doesn't work any more after slicing, it only 'remembers' the transformations/changes you made to the figure itself.

Are there any more suggestions on an 'automatic' version of this? Or maybe someone knows of an extension that would fit my needs:)?

The use of Blender (which I tried for a short period and didn't understand..) would make it manipulative and non-'automatic', so I would like to do everything in one program, e.g. Inkscape.

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: 2D to 3D?

Postby ragstian » Wed May 21, 2014 1:22 am

Hi.

How was your original plots generated?
By having your 'generating program' (Mathlab?) write the axis and 'main' plot to different files it is possible to write a script to do the rotation, skew and offsets.

I am quite sure that doesn't work any more after slicing, it only 'remembers' the transformations/changes you made to the figure itself.

This is not quite correct, if you link to the images instead of embed the changes will be 'remembered', the trick is to do the slicing before importing the parts into Inkscape.

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

anne_inkscape
Posts: 8
Joined: Thu May 15, 2014 9:43 pm

Re: 2D to 3D?

Postby anne_inkscape » Wed May 21, 2014 4:38 pm

Hey Ragnar,

The original plots are made in ODV (Ocean Data Viewer) or Matlab.
I could indeed export the different parts of the graph as different files, then Inkscape can remember it and the linking works.
I think all the ideas in this topic gave me a good start to play around a bit more.

Still I think using Powerpoint or LibreOffice Impress does things really easy:
From a random 2D transect I found on the web:

Image

to

Image

in a few minutes (and never done it before). This would help me, it is however manipulative as well, but maybe I have to live with that ;)

--- Not sure why I can't post in-text pictures/figures like you: The links of the images are correct?

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: 2D to 3D?

Postby Lazur » Wed May 21, 2014 9:11 pm

anne_inkscape wrote:...
Image

to

Image

--- Not sure why I can't post in-text pictures/figures like you: The links of the images are correct?



Hi.

The www part needs to be changed to dl in the url-s from dropbox for displaying them right.

That fancy colours are achieved with raster images on the original file even if the plot itself is vector, so you really might consider to use blender instead.

anne_inkscape
Posts: 8
Joined: Thu May 15, 2014 9:43 pm

Re: 2D to 3D?

Postby anne_inkscape » Wed May 21, 2014 9:25 pm

Dear Lazur,
Thank you for fixing my figures:)

I do not understand your last sentence:
That fancy colours are achieved with raster images on the original file even if the plot itself is vector, so you really might consider to use blender instead.


You suggest that I should use Blender, but what do you mean with the rest of the sentence?

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: 2D to 3D?

Postby Lazur » Wed May 21, 2014 9:46 pm

The gradient part from matlab is a generated raster image.
I don't know how exaclty you export your figure later to be used in inkscape, but even if you manage to export as an svg, those colours are made up by embedded raster images.
Which may limit how large you can scale it up, without being pixelated.

anne_inkscape
Posts: 8
Joined: Thu May 15, 2014 9:43 pm

Re: 2D to 3D?

Postby anne_inkscape » Wed May 21, 2014 9:52 pm

Ah OK, thank you for your explanation, I think I understand it better now.


Return to “Help with using Inkscape”