Self tutorial Mesh Gradient

Share your Inkscape tricks and tutorials here.
erik.teodoru
Posts: 18
Joined: Wed Jun 10, 2015 8:32 pm

Self tutorial Mesh Gradient

Postby erik.teodoru » Tue Mar 22, 2016 5:49 am

This is a tutorial that I made initially for myself, in order to not forgot what I discover in working with the Inkscape mesh gradient. The examples I present are probably not the best way of solving the tasks, but they are MY WAY of accomplishment. So if anyone can improve them with any advice, it is welcomed. Progress is made by sharing experience, by improving your previous activities and actions.
Last but not least, for registering the screen I used the amazing “active presenter: software, which free version is really incredible! :)

So, as a start, for the moment (March 2016) the mesh gradient is still a developing function in Inkscape. I search on the net details and I found how to activate it (it is not implict activated in version 0.91). More, from the site:
http://wiki.inkscape.org/wiki/index.php/Mesh_Gradients
I fond some more things, like the lack (for the moment) of functionalities as UNDO or DELETE mesh line. Other things (like the short-cuts) was not working for me… maybe the content there is only a wish list…
OK, but lets start with it.

1 Technical issues
1.1 Activate the function. See:
http://goinkscape.com/how-to-unlock-the ... -inkscape/

1.2 Type:
1.2.1 Diamond: NODES (Corner, margin or “inside”)
1.2.2 Circle: Bezier handles
1.3 Erik discovered issues
1.3.1 Mesh lines can be added only from one mesh margin to the opposite one. It is not possible to draw a mesh from a margin to an adjacent margin.
1.3.2 There is not possible to intersect 2 interior mesh lines that are connecting same opposite margins. Practically, all interior mesh lines are “parallel” with 2 margins, and between them.
1.4 How to collect colour for a node
1.4.1 Select the node
1.4.2 Select pick colours from image tool (F7)
1.4.3 Click desired colour
1.5 Add a mesh line: in “mesh” mode, move the mouse until you are over an existing mesh line. The cursor will lokk like the mesh cursor with a supplementary “+”. Double click and a new mesh line will be drawn “perpendicular” on the line you clicked.

2 Erik tips and tricks
2.1 Don't use the round mesh - it is a square rounded and it not close at 360 so you cannot smooth colour at the 0-360 degrees line.
2.2 Especially when there are a lot of nodes, identifying their handles is not an easy task. Sometimes, after introducing new mesh lines or moving nodes, their handles are far away from the nodes. “S” shapes can appear.
2.3 Avoid “S” shapes of the lines, that can appear because of strange placement of the handles – strange borders can appear. Example:
ex1.jpg
ex1.jpg (43.83 KiB) Viewed 3205 times

2.4 Arrange / align handles when you have a lot of nodes. If you have 4 mesh lines (except the margin) a new mesh perpendicular on them will create 4+2=6 new nodes and 4x4 + 2x3 = 22 new handles
2.5 Moving
2.5.1 A handle – is moving individual
2.5.2 A node – when you move a node, all his handles are moving (2 for corner node, 3 for margin node, 4 for interior node).

2.5.3
3 Drawing issues
3.1 Identify the colour zones. They can mainly be:
3.1.1 Round zones. They will have allocated a “colour pole” - mesh lines will cross in the “centre” of the zone. Example:
https://www.youtube.com/watch?v=CSJkw5x ... V8&index=4
3.1.2 Linear zones. Those will have allocated a “colour mesh line”, through the “middle” of the zone. Example:
https://www.youtube.com/watch?v=7lXynSv ... V8&index=3
3.1.3 Mixed zones. Use your phantasy and experience.
3.1.3.1 Half moon. Example:
https://www.youtube.com/watch?v=8Wom0P1 ... V8&index=2
3.1.3.2 S linear shadow
https://www.youtube.com/watch?v=ZMfcoGs ... V8&index=5
3.1.3.3 Triangle shadow – borders that remains visible are because of a bug – the alpha channel of the background is not 1, don't know why… :)
https://www.youtube.com/watch?v=mzaENWW ... V8&index=1
3.1.4 Strong borders – with clear different coloured on “left” and “right”. This situation can be treated in 2 ways:
3.1.4.1 Create 2 areas that have as border the “strong border”.
3.1.4.2 Consider 2 linear zones close to the border and you will drag the handles very close to one of the mesh line.
3.2 Sketching the mesh lines position. For this, create first an extra layer on which we will draw simple lines, on the position where we estimate the mesh lines will be.
3.2.1 Mark the colour poles on the extra layer (use a pencil)
3.2.2 Mark colour mesh lines on the extra layer (use a pencil)
3.2.3 Try to optimise the lines, by including the poles on the lines
3.3 Splitting
Splitting an area in several areas or objects is necessary to reduce the number of mesh gradients. For drawing – tracing a photo – the following steps are required:
3.3.1 Split the drawing in “objects” (layers).
3.3.1.1 Parts of the drawing that are over-posing each-other shall be different objects (on different layers). Ex: mouth, nose, eye and face of a person. They can later further split (nose in nose and nostrils, etc)
3.3.1.2 After splitting on objects, choose the priority / level of each object (the order of the layers)
3.3.2 Split the objects on areas (same layer). Example: split the face in 3 areas (forefront / middle / chin). Areas of an object shall be adjacent. In the adjacent areas “un-fitting” borders can appear. See later how to deal with them.
3.3.3 As examples, see
https://www.youtube.com/watch?v=0EQV2Ci ... V8&index=6

and
Ex3.jpg
Ex3.jpg (90.91 KiB) Viewed 3205 times


3.3.4 To remove a discontinuity in colour, add another mesh line
3.3.5 To remove strong borders between 2 zones, “prolong” mesh lines from “zone 1” in “zone 2” and the select only for the margin mesh nodes in zone 2, the colour corresponding to the equivalent nodes in zone 1. Example:
https://www.youtube.com/watch?v=0EQV2Ci ... V8&index=6


3.3.6 Where it is a discontinuity between a zone colour and the colour below it, add mesh lines in those points (“perpendicular” to the discontinuity) and then deal only with the margin nodes (that are in the areas of “discontinuity). See examples
Ex 2.jpg
Ex 2.jpg (31.56 KiB) Viewed 3205 times

erik.teodoru
Posts: 18
Joined: Wed Jun 10, 2015 8:32 pm

Re: Self tutorial Mesh Gradient

Postby erik.teodoru » Wed Mar 30, 2016 6:56 pm

Continuing to work I "discovered" some other things and I like to share them with you here. What I write here is a mixture of test results and tutorial hope people will not be mad on me...
I know that this function / tool is still in develop phase. I am aware of that. So we don't know for sure which will be the keys / commands to realise a sub-function or another (add mesh line, delete mesh line, etc)
1) As we already know, it is not possible (in this moment) to delete a mesh line or a mesh node and to undo something.

2) If there is no node selected (but the mesh is active) and you click somewhere with the color picker (F7) - then mesh disappear and undo close the inkscape. Was there, done that. :)

3) When picking color for the border / margin nodes - especially at the border between 2 zones - zoom a lot the drawing to pick the color as much as possible close to the desired node. I found out that at the borders this can have a lot of relevance. Same thing when you have 2 objects overposed

4) As I previously said, if you have connex zones, you can put them in the same layer. If you have overposed zones, better put them in different layers

5) It is recommendable to split the drawing to several zones, in order to not increase - especially at the beginning of the drawing - the number of the mesh lines - you will obtain a huge amount of handles!

6) I found out that if you have the mesh visible but the layer invisible (yes, it is posible), to be able to add a new mesh line you must: a) put the cursor over a mesh line (so that the "+" appear) and b) keep "Ctrl" pressed. Otherwise the mesh will dissappear.

7) It is not recommended to move nodes and handles while active in "mesh" mode or "color picker (F7)" modes. Bad things can happen. :) I ususally use the "efit path by nodes (F2)" mode. Safest.

8. When dealing with mesh gradients, it must be clear that for any figure, we have 2 different things:
- the figure iself (shall we say - a rectangle)
- the mesh gradient - who CAN LOOK the same, but it is NOT linkend "node-by-node" to the figure. I mean, you can move the figure independent of the mesh and the mesh independent of the figure. Same for nodes. My experience until now teach me that is good to keep as musch as possible those 2 overposed, to dont have surprises. Node (figure) over node (mesh) - I am reffering to the margin nodes, of course.

9) I don't really use the ROUND mesh just because in fact it is a curved square mesh in fact (at least in this moment). That means that the 0 degree and the 360 degree (in the circle) are NOT automatic synchronised, and this will look strange.

10) As a result, I try to define my "user zones" (split of the main figure) in things as much as possible close to rectangles. But don't be afraid - is you need a pentagon / hexagon or anything else, just consider the main square / reactange and later in the mesh gradient ADD mesh lines, and new margin nodes will appear, so that you can play with them. The difference is that a classin inscape node has 2 lins converging to him, while a margin mesh node is usually has 3 lines convergong to him (except the CORNER mesh nodes, who have 2 converging lines)

11) Mesh lines (in square mesh) are drawn from one square margin to the opposite square margin. There are NO intermediary mesh lines (only between 2 internal mesh lines) and there are no mesh lines between 2 convergin margins.

12) The main investment that you must make in this tool is... PATIENCE. You must have a lot of patience when dealing with mesh gradient, if you really want to obtain some results.

OK. Sorry I talk so much. :)
And I add another tutorial in 3 parts, that you can find here:

part 1
https://youtu.be/Pucm3J-WS9o
part2
https://youtu.be/M4AnFtzav5g
part 3
https://youtu.be/sLkkTc1AMSI

For this I used the beautiful picture of Arkadiusz Branicki, called: Maya III
Find this one here: https://plus.google.com/108871877301789 ... E4TWBiYr1C
or here: http://www.fineartnude.pl/homo-chorum#12

See also my post here: viewtopic.php?f=28&t=23575&p=83532#p83532

Please, if you have any comment in order to imprive my actions or my (unwilling but anytime possible) mistakes, please do that.
Wish you all a beautiful day!


Return to “Tricks & Tutorials”