linked line with different color or clone above high contrast background

Post questions on how to use or achieve an effect in Inkscape.
HoWilIs
Posts: 11
Joined: Tue Apr 25, 2017 12:01 am

linked line with different color or clone above high contrast background

Postby HoWilIs » Tue Apr 25, 2017 12:36 am

Hello,
I use Inkscape to make pictures with descriptive text as shown in the attachment.
Most of these pictures include background with high contrast colors as I tried to illustrate with the included white and dark rectangles. When I now draw a line from my text to a point I want to describe in the picture, some dark or light parts of the background cloak my line making it harder to find the 'target' I want to point out.

For straight lines is a linked offset a solution still allowing to change the source and destination points together with the linked offset.
But for other curves like shown in the attached picture is this not applicable.

Does anyone have a different idea how to apply such a 'clone' with different color the the original line while the original object and its points is still easy editable? Simple modified duplicates of the original line are not helpful because I dont want to edit each of the duplicates.
I need a 'all-vector' solution, so filters like shadow/glow are no option.

Many thanks in advance.
drawing.svg
(19.37 KiB) Downloaded 320 times
drawing.png
drawing.png (26.75 KiB) Viewed 5017 times

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

Re: linked line with different color or clone above high contrast background

Postby Lazur » Tue Apr 25, 2017 3:22 am

Hi.

Cloning "should" do the job.
If you set no fill and *undefined stroke* to the parent, you can make clones of it with different stroke colours set.
Simply put the parent on top, a clone with a black stroke below, and another clone with a wider white stroke at the bottom.

Only problem is with editability because the parent object offers nothing to be rendered and for selecting it you may need switching to outlines only rendering mode (or look up other extra selection methods, like there is an option you can go through all objects on screen).

HoWilIs
Posts: 11
Joined: Tue Apr 25, 2017 12:01 am

Re: linked line with different color or clone above high contrast background

Postby HoWilIs » Tue Apr 25, 2017 3:41 am

Lazur wrote:Hi.

Cloning "should" do the job.
If you set no fill and *undefined stroke* to rhe parent, you can make clones of it with different stroke colours set.
Simply put the parent on top, a clone with a black stroke below, and another clone with a wider white stroke at the bottom.

Only problem is with editability because the parent object offers nothing to be rendered and for selecting it you may switch to outlines only rendering mode (or look up other extra selection methods, like there is an option you can go through all objects on screen).

Dear Lazur,
Thank you for your reply.
Is it possible for you to give an example?
I do not understand undefined stroke and rhe parent. Where do I find the corresponding menu items? As far as I know is it not possible to give a linked clone a different color than the original!?
Maybe you use the .svg from my first post.
BR,
HoWilIs

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

Re: linked line with different color or clone above high contrast background

Postby Lazur » Tue Apr 25, 2017 4:01 am

Attached an example with cloning.
Parent path was grouped together with the two clones, so if you enter the group (Ctrl+Enter) and select all inside after (Ctrl+A),
you can select the parent by deselecting the two visible clones (Shift+Clicking).

Only problem with it is that no markers can be added this way.
And if you draw the dot by a subpath somehow it won't render solid filled on the stroke's intersecting, although that only depends on the renderer -browsers may display it correctly.


desc.svg
(9.96 KiB) Downloaded 257 times



Some more info in the manual at clones.

HoWilIs
Posts: 11
Joined: Tue Apr 25, 2017 12:01 am

Re: linked line with different color or clone above high contrast background

Postby HoWilIs » Tue Apr 25, 2017 4:59 am

Lazur wrote:Attached an example with cloning.
Parent path was grouped together with the two clones, so if you enter the group (Ctrl+Enter) and select all inside after (Ctrl+A),
you can select the parent by deselecting the two visible clones (Shift+Clicking).

Only problem with it is that no markers can be added this way.
And if you draw the dot by a subpath somehow it won't render solid filled on the stroke's intersecting, although that only depends on the renderer -browsers may display it correctly.


desc.svg


Some more info in the manual at clones.

Dear Lazur,
Thank you very very much :!:
It is almost all I need. Setting and changing the end marker via the dialog for 'Stroke style' would be awesome but I can live without it or at least with the self made marker version.
EDIT: is there a reason why the stroke-markers are not shown even if the where cloned? Should I file a bug-report :?:
Best regards,
HoWilIs

For all interested (and what I learned):
To color a clone different than the 'parent' set the !parents! stroke-style to 'Unset paint' (its the '?' in the 'Stoke-paint' dialog in 'Fill and Stroke'). The unpainted parent can easily be found in 'Display mode' 'Outline'.
Last edited by HoWilIs on Tue Apr 25, 2017 5:03 am, edited 1 time in total.

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

Re: linked line with different color or clone above high contrast background

Postby Lazur » Tue Apr 25, 2017 5:01 am

You are welcome!

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: linked line with different color or clone above high contrast background

Postby theozh » Tue Apr 25, 2017 5:01 am

@HoWilIs, if I understood your question correctly, in short: you basically need an outlined path.
You could realize this with the LPE "Pattern along path". You basically pattern a rectangle along your desired path and give it a white stroke and a black fill. You even can add a marker at the end.
If you are not familiar with this LPE and need more details please let me know and I will try to explain more in detail.
I think editing the path is easy. If you just want vectors/paths in the end you need to do "Object to path" (Shift+Ctrl+C).

OutlinePath.gif
OutlinePath.gif (102.07 KiB) Viewed 4963 times
Win7/64, Inkscape 0.92.2

HoWilIs
Posts: 11
Joined: Tue Apr 25, 2017 12:01 am

Re: linked line with different color or clone above high contrast background

Postby HoWilIs » Tue Apr 25, 2017 5:16 am

theozh wrote:@HoWilIs, if I understood your question correctly, in short: you basically need an outlined path.
You could realize this with the LPE "Pattern along path". You basically pattern a rectangle along your desired path and give it a white stroke and a black fill. You even can add a marker at the end.
If you are not familiar with this LPE and need more details please let me know and I will try to explain more in detail.
I think editing the path is easy. If you just want vectors/paths in the end you need to do "Object to path" (Shift+Ctrl+C).

OutlinePath.gif


Dear theozh,
Thank you for you reply.
Yes I know "Pattern along path". Yes I tested it via "Extensions->Generate from Path->Pattern along Path" and in "Path Effects" and had no luck.
Can you please explain it in a more detailed way.
Thank you in advance,
HoWilIs

EDIT:

The 'correct'/working workflow is as follows:
- draw a rectangle in desired form, copy it to clipboard
- draw a path, select it and go to "Path->Path Effect"
- select '+' 'Pattern along Path' and press the 'Paste graph' under 'Pattern source'
- apply desired colors for stroke and fill; A 'endmarker' is applied at the end-corner of the path! for thin lines it this OK.
Thanks again

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: linked line with different color or clone above high contrast background

Postby theozh » Tue Apr 25, 2017 6:18 am

@HoWilIs, I'm glad that I could help a little ;) . Yes, that's how I did it. And yes, the end marker is not centered :-(.
Win7/64, Inkscape 0.92.2

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

Re: linked line with different color or clone above high contrast background

Postby Lazur » Tue Apr 25, 2017 6:25 am

There is also the clone original path effect to make the marker centered, see it here.

HoWilIs
Posts: 11
Joined: Tue Apr 25, 2017 12:01 am

Re: linked line with different color or clone above high contrast background

Postby HoWilIs » Tue Apr 25, 2017 5:01 pm

HoWilIs wrote::!: But one problem is left :arrow: : After duplicating the original line together with the background-clone, the background is still 'linked' to the original!

The easiest way I found to resolve this is deleting the Path-Effect on the duplicated 'background' and reassign it to the also duplicated path.

Thanks again for your help!
BR,
HoWil
Attachments
Inkscape_line_with_marker__path_with_shadow_line_of_different_color_or_glow.svg.png
Inkscape_line_with_marker__path_with_shadow_line_of_different_color_or_glow.svg.png (36.34 KiB) Viewed 4870 times
Inkscape_line_with_marker__path_with_shadow_line_of_different_color_or_glow.svg
(16.57 KiB) Downloaded 188 times
Last edited by HoWilIs on Wed Apr 26, 2017 6:21 pm, edited 1 time in total.

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

Re: linked line with different color or clone above high contrast background

Postby Lazur » Wed Apr 26, 2017 6:13 am

I'm afraid that's how it works. Or you could try the xml editor to link the appropriate path but then again the solution is getting more and more complex&complicated.

HoWilIs
Posts: 11
Joined: Tue Apr 25, 2017 12:01 am

Re: linked line with different color or clone above high contrast background

Postby HoWilIs » Wed Apr 26, 2017 6:17 pm

Lazur wrote:Only problem with it is that no markers can be added this way.

Filed a bug about it ... Bug #1686030 https://bugs.launchpad.net/inkscape/+bug/1686030 Maybe it will resolved.

HoWilIs
Posts: 11
Joined: Tue Apr 25, 2017 12:01 am

Re: linked line with different color or clone above high contrast background

Postby HoWilIs » Wed Apr 26, 2017 6:50 pm

Lazur wrote:I'm afraid that's how it works. Or you could try the xml editor to link the appropriate path but then again the solution is getting more and more complex&complicated.

For me is now the easiest solution the following: After Grouping and duplicating the original, I remove the path effect for the 'Background' and reasign it to the duplicated path.

Thanks to all of you again for your help,
BR,
HoWilIs

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

Re: linked line with different color or clone above high contrast background

Postby Moini » Thu Apr 27, 2017 7:51 am

Btw. would this extension be useful here:
https://inkscape.org/en/~jabiertxof/%E2%98%85unlink-lpe
(I haven't read everything closely, so I may be way off, but wanted to mention)
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)

HoWilIs
Posts: 11
Joined: Tue Apr 25, 2017 12:01 am

Re: linked line with different color or clone above high contrast background

Postby HoWilIs » Fri Apr 28, 2017 5:44 am

Moini wrote:Btw. would this extension be useful here:
https://inkscape.org/en/~jabiertxof/%E2%98%85unlink-lpe
(I haven't read everything closely, so I may be way off, but wanted to mention)


Dear Moini,
Yes this is really useful. With this extension I can 'unlink' the 'background path' from the original and reassign it to the new, duplicated path. I no more need to delete the 'Clone original path' and reassign it again to the background.
Thank you,
BR,
HoWilIs
ps.: Is someone able to combine all the above findings into one extension? Would be really appreciated.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: linked line with different color or clone above high contrast background

Postby brynn » Fri Apr 28, 2017 2:34 pm

You could make a feature request, detailing the kind of new extension you want. But unless there's a developer who is interested, it may be a long time before it happens.

I didn't read this whole thread very closely, so I'm not sure about all the features that you're talking about. If they would work as an LPE, we do have an active developer who likes to make LPEs. Although I have no idea whether he would be interested in this (if indeed it can be done via LPE). All you can do is post the request and watch for answers. This is the bug tracker, which is also where new feature requests are kept. https://launchpad.net/inkscape

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: linked line with different color or clone above high contrast background

Postby theozh » Fri Apr 28, 2017 6:04 pm

@HoWilIs, I still haven't completely understood and reproduced your process about LPE linked clones and background and second extension, unlinking, relinking, cloning, uncloning, etc... It's just to complicated for me ;-).

I thought there must be a way with "Pattern along path" to get the Endmarker centered. And there is :-).

In short: you simply need a rectangle with a node on the center of the right side. However, this node has to be node number 1. This requires some preparation, but only once. Instead of modifiying a rectangle you could also use the Freehand tool (F6) and draw a rectangle starting at the right center.
In the end, if you need more of those outlined paths you can simply duplicate your path and set a different color for stroke and fill for each of them as you like.

OutlinedPath2.png
OutlinedPath2.png (71.91 KiB) Viewed 4699 times
Attachments
OutlinedPath2.svg
(60.4 KiB) Downloaded 181 times
Win7/64, Inkscape 0.92.2

HoWilIs
Posts: 11
Joined: Tue Apr 25, 2017 12:01 am

Re: linked line with different color or clone above high contrast background

Postby HoWilIs » Fri Apr 28, 2017 10:27 pm

theozh wrote:@HoWilIs, I still haven't completely understood and reproduced your process about LPE linked clones and background and second extension, unlinking, relinking, cloning, uncloning, etc... It's just to complicated for me ;-).

I thought there must be a way with "Pattern along path" to get the Endmarker centered. And there is :-).

In short: you simply need a rectangle with a node on the center of the right side. However, this node has to be node number 1. This requires some preparation, but only once. Instead of modifiying a rectangle you could also use the Freehand tool (F6) and draw a rectangle starting at the right center.
In the end, if you need more of those outlined paths you can simply duplicate your path and set a different color for stroke and fill for each of them as you like.

OutlinedPath2.png

Intresting approch. I adopted it by drawing the rectangle with :tool_pen: and started with the your point 1 on the right mid.

Will test this further in contrast to the 'clone original path' approach. I see some benefits but also disadvantages:
-For beginners is the creation of the needed, split rectangle a bit confusing
-Assigning new 'stroke' colors and thicknesses is a bit trickier because now you have to change the fill- to change the inner color. Same for the outer color .... now its the stroke. Setting the thickness of the stock is done by setting the width of the LPE and adjusting the line stroke thickness.

++Duplicating the resulting path is no problem

Thx angain,
HoWilIs

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: linked line with different color or clone above high contrast background

Postby theozh » Fri Apr 28, 2017 11:29 pm

HoWilIs wrote:Will test this further in contrast to the 'clone original path' approach. I see some benefits but also disadvantages:
-For beginners is the creation of the needed, split rectangle a bit confusing
Well, now you are an advanced user ;-)... (please don't always cite just the whole post, cite only if you are referring to specific sentences.)

HoWilIs wrote: -Assigning new 'stroke' colors and thicknesses is a bit trickier because now you have to change the fill- to change the inner color. Same for the outer color .... now its the stroke.
What is tricky there? Select the path and click on the color palette to change the fill and Shift+Click to change the stroke.

HoWilIs wrote: Setting the thickness of the stock is done by setting the width of the LPE and adjusting the line stroke thickness.
You can also zoom in, use the node tool and the handle to change the width. Inner and outer scale proportionally. Depending on if you have this button activated or not.
ScaleStrokeProportionally.png
ScaleStrokeProportionally.png (2.83 KiB) Viewed 4658 times
Well, for changing the outer/inner ratio you can also use the stroke dialog (Shift+Ctrl+F) and change the stroke width.

HoWilIs wrote: ++Duplicating the resulting path is no problem
I guess that's the main point. You create it once and change colors and shapes, or even copy it to other SVG files... create once, use forever ;-).

OutlinePathChange.gif
OutlinePathChange.gif (185.67 KiB) Viewed 4665 times
Win7/64, Inkscape 0.92.2

HoWilIs
Posts: 11
Joined: Tue Apr 25, 2017 12:01 am

Re: linked line with different color or clone above high contrast background

Postby HoWilIs » Sat Apr 29, 2017 2:35 am

theozh wrote:Well, now you are an advanced user ;-).

Still learning... use inkscape now ~8 years for scientific publications but things like this (line-background) do make it hard for me to convince (unexperienced) colleagues :roll:.
theozh wrote:What is tricky there? Select the path and click on the color palette to change the fill and Shift+Click to change the stroke.
You can also zoom in, use the node tool and the handle to change the width. Inner and outer scale proportionally. Depending on if you have this button activated or not.

For my pictures I need to set the linewidth to a certain value. Please watch your .gif screencast again and see what happens when you select the path and enter a value under stroke-width. It changes the outer stroke-width. I do know that this is correct and its because it is set up this way but this is not intuitive! A unexperienced user would like to enter the width of the path he/she selects in the stroke-width dialog. Now he/she has to calculate after setting the width in the path-effect dialog: width-path = width_path-effect - width_stroke.
You also would have to adopt it each time you changing the stroke-width for the background.

Summary: I am happy with the solutions you brought up here 8-). I only wanted to point out that it maybe is to tricky for 'unexperienced' users and maybe some dialog for this would help.
BR,
HoWil
ps.: I filed a feature request referencing this post https://bugs.launchpad.net/inkscape/+bug/1686925

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: linked line with different color or clone above high contrast background

Postby theozh » Sat Apr 29, 2017 5:42 am

You're not giving up so easily if you want something special... I like that attitude ;-).

Well, this also can be done...
Then you need a rectangle with a height of 1 mm. As you said, it's actually easier to use the Freehand or Bezier tool to draw a rectangle starting at the right center. Snap to grid (show grid with #) facilitates it further. I have a 1 mm grid, so I draw a rectangle, e.g. with 10 mm height, starting on the right center. Then I apply fill, remove the stroke and scale it down in height by simply typing 1 mm at H:(eight) in the Tools Control bar.

Then start the procedure with copying this rectangle to the LPE ... ... see earlier post.
Now, you need to additionally change the Stroke Style Order:
Select one of the two: Stroke,Fill,Markers or Stroke,Markers,Fill

Fill&StrokeDialog.png
Fill&StrokeDialog.png (4.52 KiB) Viewed 4618 times
By this, the fill is on top of the stroke, which means half of the stroke is actually covered by the fill. And the stroke width in the Stroke dialog (Shift+Ctrl+F) corresponds now to the width of the stroke together on both sides. If you don't want to calculate and want to enter the stroke width of one side you also can type width*2, e.g. 1.5*2, Inkscape will multiply for you ;-).

Furthermore, the width you enter in the LPE now corresponds to the fill width (or your targeted linewidth in your picture) in mm, because you used the 1 mm rectangle as template.

LPE_PatternAlongPath.png
LPE_PatternAlongPath.png (8.58 KiB) Viewed 4618 times


All this, you have to do only once. Now, I think your colleagues can easily start using Inkscape... :-).
Win7/64, Inkscape 0.92.2

HoWilIs
Posts: 11
Joined: Tue Apr 25, 2017 12:01 am

Re: linked line with different color or clone above high contrast background

Postby HoWilIs » Sat Apr 29, 2017 6:50 am

theozh wrote:You're not giving up so easily if you want something special... I like that attitude ;-).

Thx. :D
theozh wrote:All this, you have to do only once. Now, I think your colleagues can easily start using Inkscape... :-).

Thank you very much for this detailed and interesting explanation!
I attached a file containing the needed lines to give them a easy start. :lol:
lines_for_annotations_on_high_contrast_background.png
lines_for_annotations_on_high_contrast_background.png (48.53 KiB) Viewed 4602 times

Best regards,
HoWilIs

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: linked line with different color or clone above high contrast background

Postby tylerdurden » Sat Apr 29, 2017 11:47 pm

I'll add my two rubles:

I prefer the dot to be contiguous with the line. I used the paint-order to change that.

If sizes will be standardized (e.g. the two shown above), the users could use a custom template and custom symbols.
When an indicator line is needed, it can be dragged from the symbols panel, then unlinked to edit/modify with the node tool.
HiConTemplate.svg_-_Inkscape_2017-04-29_09-19-42.png
HiConTemplate.svg_-_Inkscape_2017-04-29_09-19-42.png (98.51 KiB) Viewed 4514 times


Two catches:
    As noted above, the unlink-clone button needs to be clicked to modify a symbol after it's been dragged into the workspace.
    The custom template must be used, or the marker dots on the ends may not show. The template has two hidden objects that use the markers, which allow the symbols to have markers.


The two attached files would be placed in their respective folders in the user profile.
Attachments
Indicator_lines.svg
(7.95 KiB) Downloaded 291 times
HiConTemplate.svg
(7.81 KiB) Downloaded 290 times
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

jabiertxof
Posts: 184
Joined: Wed Feb 06, 2013 6:47 am

Re: linked line with different color or clone above high contrast background

Postby jabiertxof » Sun Apr 30, 2017 9:36 pm

Hi all.
Thanks moini for share the extension. I hope 0.93 we can have a multistroke/multifill without LPE


Return to “Help with using Inkscape”