Gimp-Forum.net
Creating a customizable dashed line along curve - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: Creating a customizable dashed line along curve (/Thread-Creating-a-customizable-dashed-line-along-curve)



Creating a customizable dashed line along curve - OJS - 04-13-2024

Hi, I am new to these forums and apologize if this is not the right place.

My question is, how can I make a dashed line along a curved path or something similar, and still be able to customize the spacing?
To make it clearer: I am making a map, and on this map there are going to be several dashed lines with the same size (80x25 px). However the spacing between the dashed lines is something I want to vary, so that certain places on the maps have large gaps between the dashed lines and others have close spaces between the dashed lines. Additionally I want to make the dashed lines follow smoother curves to make them prettier, as it looks wrong with straight lines.

What I've tried so far:
- Stroke path - stroke line using a line style (This works great, but I have problems varying the gaps between the dashed lines. If i set to line length to squares, I cant have more than 3 squares as spacing. This works fine some places, but I need larger spacings other places)
-Drawing the dashed lines by hand, this takes ages and is easy to mess up, and my attempts have looked awful
-using shift click with the correct angel setting and spacing to create dashed lines. The problem here is it looks too straight and therefore not good.
-Using dynamic brush "Track Direction", this doesnt work. It is simply way too innaccurate


Using windows 10 and Gimp 2.10 if that helps

Thank you for any help


RE: Creating a customizable dashed line along curve - rich2005 - 04-13-2024

Maybe this one, a plugin replicate_path_along_path.py
 from http://kmarkku.arkku.net/Path_replicate_files/Gimp_master.html

It might take more than a bit of fiddling around with variables but for example.

A rectangular path - the 'dash' - made from a selection-to-path
A base path and the position of this does matter.
The path to follow.

[attachment=11654]

Which gives this and you need to fill that new path Edit -> Fill Path.

[attachment=11655]


RE: Creating a customizable dashed line along curve - Ofnuts - 04-13-2024

(04-13-2024, 11:06 AM)OJS Wrote: If i set to line length to squares, I cant have more than 3 squares as spacing.
Uh? Works fine for me...

[attachment=11656]



RE: Creating a customizable dashed line along curve - OJS - 04-13-2024

(04-13-2024, 12:14 PM)rich2005 Wrote: Maybe this one, a plugin replicate_path_along_path.py
 from http://kmarkku.arkku.net/Path_replicate_files/Gimp_master.html

It might take more than a bit of fiddling around with variables but for example.

A rectangular path - the 'dash' - made from a selection-to-path
A base path and the position of this does matter.
The path to follow.



Which gives this and you need to fill that new path Edit -> Fill Path.

Thank you! This is working, although it requires a bit of fiddling for each path that uses different spacing, but it should do the trick!

(04-13-2024, 02:00 PM)Ofnuts Wrote:
(04-13-2024, 11:06 AM)OJS Wrote: If i set to line length to squares, I cant have more than 3 squares as spacing.
Uh? Works fine for me...

I might have expressed myself in a confusing way. I mean that if is set the dash length to 3 squares then I am stuck with 3 squares as spacing, or 9 squares. There is no more room for customization, unless you add smaller dashes in between. At least as far as I can make it out.

It would be nice to for example have 3 square dash with 4 square spacing, or 3 square dash with 5 square spacing, etc.


RE: Creating a customizable dashed line along curve - rich2005 - 04-13-2024

(04-13-2024, 02:20 PM)OJS Wrote: I might have expressed myself in a confusing way. I mean that if is set the dash length to 3 squares then I am stuck with 3 squares as spacing, or 9 squares. There is no more room for customization, unless you add smaller dashes in between. At least as far as I can make it out.

It would be nice to for example have 3 square dash with 4 square spacing, or 3 square dash with 5 square spacing, etc.

As usual I was overthinking, although same as you I find that custom dialogue less than wonderful.

You can edit in your Gimp profile gimprc file as this.


RE: Creating a customizable dashed line along curve - OJS - 04-13-2024

(04-13-2024, 02:31 PM)rich2005 Wrote:
(04-13-2024, 02:20 PM)OJS Wrote: I might have expressed myself in a confusing way. I mean that if is set the dash length to 3 squares then I am stuck with 3 squares as spacing, or 9 squares. There is no more room for customization, unless you add smaller dashes in between. At least as far as I can make it out.

It would be nice to for example have 3 square dash with 4 square spacing, or 3 square dash with 5 square spacing, etc.

As usual I was overthinking, although same as you I find that custom dialogue less than wonderful.

You can edit in your Gimp profile gimprc file as this.

Can you elaborate please? I tried changing my gimprc file's dash info to the numbers in your picture, but there was no change. I dont rightly know what the different numbers do. Oh and do I have to restart gimp each time i change it?


RE: Creating a customizable dashed line along curve - rich2005 - 04-13-2024

(04-13-2024, 02:46 PM)OJS Wrote: Can you elaborate please? I tried changing my gimprc file's dash info to the numbers in your picture, but there was no change. I dont rightly know what the different numbers do. Oh and do I have to restart gimp each time i change it?

You will have to experiment. It seems the first 4 is a dashed pattern the next parameter will give a broken path. Final 3 parameters length and spacing.  You will need to restart Gimp after editing for Gimp to re-read the settings.

[attachment=11658]


RE: Creating a customizable dashed line along curve - Ofnuts - 04-13-2024

(04-13-2024, 02:46 PM)OJS Wrote:
(04-13-2024, 02:31 PM)rich2005 Wrote:
(04-13-2024, 02:20 PM)OJS Wrote: I might have expressed myself in a confusing way. I mean that if is set the dash length to 3 squares then I am stuck with 3 squares as spacing, or 9 squares. There is no more room for customization, unless you add smaller dashes in between. At least as far as I can make it out.

It would be nice to for example have 3 square dash with 4 square spacing, or 3 square dash with 5 square spacing, etc.

As usual I was overthinking, although same as you I find that custom dialogue less than wonderful.

You can edit in your Gimp profile gimprc file as this.

Can you elaborate please? I tried changing my gimprc file's dash info to the numbers in your picture, but there was no change. I dont rightly know what the different numbers do. Oh and do I have to restart gimp each time i change it?

Something you could try to is stroke the same path with different patterns


RE: Creating a customizable dashed line along curve - OJS - 04-13-2024

Thank you so much for you help. I have decided to use the gimprc file to adjust the dash patterns and just stroking the same path till i find the ones I like. This seems to be a quick and elegant solution.

Again, thanks a bunch!