Thread Rating:
Replicating a path
|
12-22-2021, 04:40 PM
12-23-2021, 09:54 AM
12-23-2021, 12:41 PM
Thanks. I appreciate this. It is just a pensionary's hobby, and the path seems endless, new ideas coming every now and then. I am happy if I can make something useful.
01-28-2022, 04:49 PM
Here is now a plugin that Rich suggested: "Replicate a path along another path". Perhaps it should still be called experimental. The basic usage is shown in the picture:
The main inputs are three paths:
The task of the plugin is difficult. Often the results have faults. I shall make a separate post about this later (tomorrow). I don't know how I could help this. It is the user's responsibility to make the input paths such that they work well. To avoid difficulties:
You can download the plugin from http://kmarkku.arkku.net/Path_replicate_...aster.html Unzip the .zip file and place the one file it contains (replicate_path_along_path.py) in your user's plug-ins folder. Then (re)start Gimp. Make a new image, and there the three input paths like above. In Gimp's menu, go to the Paths dock, right-click the Source path, and follow the link Tools > Replicate > Replicate path along another path and click. That opens the GUI of the plugin. I trust it to be so self-explanatory that you can go experimenting without further explanations. You may wonder about the input 'tapering' which is in percents. It means this: For example, if you set tapering=10, each created copy of the Source will be 10% smaller than its predecessor. In addition, each copy will have some "inner tapering". Two pictures about this, the first with tapering=10 and the second with tapering=30: The Source paths are on the left, and the Base paths coincide with their bottom lines. Often you may wish to touch up the resulting path by joining close stroke ends. The first picture above is an example where it is good to do. You can do it with my plugin in https://www.gimp-forum.net/Thread-Joinin...-of-a-path or with Ofnuts' plugin Edit > Join strokes, contained in ofn-path-edits. This new plugin is too complicated for me to have taken care of all failing points. Probably you will soon find cases where you just get some obscure error message. If so, please tell me. And post:
01-29-2022, 07:56 AM
I continue with the plugin "Replicate path along another path". Here I first explain a little the idea behind the plugin. Somebody may be interested. Then I mention some problems you may encounter.
The idea behind the plugin very roughly Very much simplified the idea is as follows. Let tapering=0. Assume that the Base path is the red horizontal line segment and the Source path is the upright line segment in this picture: Imagine there a coordinate system where the end points of Base are (0,0) and (1,0). Let (x,y) be the coordinates of the uppermost point of Source. Then the length of Source is y and it is located at x-coordinate x. We should map the Source somehow to the Target as several copies. Let us first look at one copy only. And let us look how the point (x,y) is mapped. We find on the Target a point based on x and the number of the copy (no details now). From that point we shoot up a perpendicular. From that perpendicular we take a point F(x,y) at distance=y scaled suitably. That point F(x,y) is to where (x,y) is mapped. And here is the picture when we make several copies. The procedure for each copy is the same except that the chosen point on the Target varies. And that was the basic idea in how the mapping of points is done. However, this is not nearly all since we are making paths, not raster pictures. But I stop here. Problems The next picture tries to show two possible problems: If there is too tight a bend the pattern starts to fold on itself. This problem is inherent in the task, and solving it would require a completely different approach, a quite different way to do the mapping. And then the resulting paths would look quite different. If the Target is not smooth the result may be non-sensical. It can even be something very wild. This problem is probably partly due to my implementation. To avoid such difficulties: In the Target path avoid:
The best remedy is to correct such faults manually, unless one is willing to modify the Target path (in this example it would help to make the Target very straight at the problematic stroke end). Remark Gimp has the tool "Text along path". Its working is so similar that I think somebody might have taken its code and made it into a tool "Path along path" or "Replicate path along path". Then no need for anybody to write 2600 lines of Python for the same job. That nobody has done it(?) or published(?) might be due to precisely such difficulties: the tool would not be so nicely behaving that it could be offered as a production version. This is just another guess.
01-29-2022, 04:07 PM
(This post was last modified: 01-29-2022, 04:08 PM by rich2005.
Edit Reason: typo
)
01-29-2022, 04:32 PM
(01-29-2022, 04:07 PM)rich2005 Wrote: Nice plugin, must have taken much work, and very much appreciated. Thanks, Rich. Good to hear that it works. The plugin has an option to use the Target path reversed, so no need to use another plugin for that.
01-29-2022, 04:38 PM
01-30-2022, 03:18 AM
Hi Ottia Tuota,
Thank you so much for this fantastic plugin. It's working really well here and I think it's going to be very useful. In the past I have also wondered why gimp has "Text along path" but not "Path along path". Co-incidentally a few months ago I went looking to see of there was such a script and didn't find anything either so it's great to see you have implemented this difficult task. One thing I was puzzled by is when the number of copies is set to 0 I got an empty path, not one with as many copies as there is room. Setting the length of copies to 0 worked fine so I stuck with that. Here's a couple of outcomes: With a target path of a rectangle with rounded corners, distort and finished by a quick edit at the corners. The target a hand drawn spiral and no distort. |
« Next Oldest | Next Newest »
|