Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Path transformations
#6
Hello!

I have updated the plugins to version 0.9. The link is in post #1. Three essential changes were made:

1. I decided to drop the plugin "Curl a polyline by a Bezier arc", see post #5. It does not fit among the other path transformation plugins, those present now and those I plan to make soon. And honestly, I don't expect anybody to miss it. (But if somebody wants it, I can return it but give it a different place in Gimp's menu.)

2. I managed to include an approximation algorithm, so that now we have a plugin which handles any paths, not only line figures consisting of straight line segments.

3. The previous plugin "Transform a line figure by a Bezier arc" (post #3) is no more a separate plugin but is included as one option in the new plugin.

So, if you go to the link in post #1, fetch the new .ZIP file, unzip it, put it in Gimp's plug-ins folder (replacing the older path_transformations.py), and restart Gimp, you will have two plugins to do transformations on paths:

Transform a path by an affine map

Transform a path by a Bezier arc

They are found in Gimp by going to the Paths tab and right-clicking the path you want to transform, and following the links Tools > Transformations > ...

For the first plugin (affine map), see post #2; I don't explain it here.

Let us look at the second plugin Transform a path by a Bezier arc. First, you can use it just as before on line figures by clicking in the GUI the first Boolean field to Yes. That causes the plugin to ignore of the path everything except the anchors. That case the plugin can handle exactly. But if you keep the field as No (the default), the plugin applies to any curving path and tries its best to deal with the curvatures correctly. That involves approximation, which means that the plugin is somewhat slow (patience, please!) and that the results are not quite exact.

Now pictures: The first picture shows the already familiar line figure case. On the left there is the setup: the three paths Base, Target, and Shaper. On the right is a line figure (blue) and its image in the transformation (red).

   

The second picture shows the new effect of the plugin: transformation of a curving path. On the left is a path (outlines of six letters, blue) and its image in the transformation (red). On the right is the same job for a path 'rhodonea' which I drew with an older plugin of mine.

   

I include also a .xcf file where all these ingredients are present, with the purpose that you will have it easier to experiment. It contains now quite a lot of paths, so that when you invoke the plugin, be careful that you choose the right paths for the Base, the Target, and the Shaper (and of course the path you want to transform).


.xcf   path_bezier.xcf (Size: 55.24 KB / Downloads: 315)

The GUI of the plugin offers now a new choice: The user can choose the algorithm to be used; either good and slow; or bad and fast. The idea is that one can first force the plugin to use a simple algorithm which is quick but inaccurate. This enables one to do experiments with the quick algorithm (which may also put excessively many anchors), and when one has found what one likes, then the plugin can be run with the good but slow algorithm which hopefully also keeps the number of anchors low.

The choice of the algorithm is controlled by one input number which is a non-negative integer. Default is 0 (the full algorithm). Inputs 1,2,3,... give the simple algorithm, and the larger the number, the more accurate the result will be but with ever increasing number of control points. I don't expect there is any need to go over 5, but of course one can try. The simple algorithm is so fast that you can go higher, if only the large number of anchors does not bother you.

As for the anchors, the transformed path will always have those anchors that correspond to the anchors of the original path, and extra anchors will be created to get better approximation. (This also means that if you suspect that the result is not accurate enough, you can try to add anchors to the original path at critical points.)

What makes the plugin slow, is the approximation. The algorithm is my own and would certainly need much development, and everything is written in Python. I am very much aware of that my approximation algorithm is rather rickety and occasionally fails. When that happens, the plugin resorts to recursion, putting anchors more densely and hoping for the best.

If you have any problems with the plugins, please let me know. This is work in progress, and any feedback will be valuable.
Reply


Messages In This Thread
Path transformations - by Ottia Tuota - 04-22-2020, 10:34 AM
RE: Path transformations - by Ottia Tuota - 04-22-2020, 12:27 PM
RE: Path transformations - by Ottia Tuota - 04-24-2020, 10:28 AM
RE: Path transformations - by Zero01 - 04-24-2020, 09:25 PM
RE: Path transformations - by Ottia Tuota - 04-26-2020, 06:36 AM
RE: Path transformations - by Ottia Tuota - 05-04-2020, 10:01 AM
RE: Path transformations - by Ottia Tuota - 06-08-2020, 11:08 AM
RE: Path transformations - by Ottia Tuota - 06-09-2020, 05:08 PM
RE: Path transformations - by Ottia Tuota - 07-12-2020, 12:50 PM
RE: Path transformations - by Ofnuts - 07-12-2020, 11:33 PM
RE: Path transformations - by Ottia Tuota - 07-13-2020, 06:15 AM
RE: Path transformations - by Ottia Tuota - 07-13-2020, 05:15 PM
RE: Path transformations - by Ottia Tuota - 07-14-2020, 02:23 PM
RE: Path transformations - by Ofnuts - 07-14-2020, 04:02 PM
RE: Path transformations - by rich2005 - 07-15-2020, 09:20 AM
RE: Path transformations - by Ottia Tuota - 07-15-2020, 11:38 AM
RE: Path transformations - by Ottia Tuota - 07-16-2020, 11:42 AM
RE: Path transformations - by Ottia Tuota - 07-26-2020, 07:26 AM
RE: Path transformations - by Ottia Tuota - 08-05-2020, 06:13 PM
RE: Path transformations - by Ottia Tuota - 08-07-2020, 07:25 AM
RE: Path transformations - by Ottia Tuota - 08-11-2020, 08:39 AM
RE: Path transformations - by Ofnuts - 08-07-2020, 08:23 AM
RE: Path transformations - by Ottia Tuota - 08-07-2020, 12:06 PM
RE: Path transformations - by Ofnuts - 08-08-2020, 12:58 PM
RE: Path transformations - by Ottia Tuota - 08-08-2020, 01:33 PM
RE: Path transformations - by mahvin - 08-07-2020, 01:55 PM
RE: Path transformations - by Ottia Tuota - 08-07-2020, 07:26 PM
RE: Path transformations - by mahvin - 08-07-2020, 07:56 PM
RE: Path transformations - by Ottia Tuota - 08-07-2020, 08:15 PM
RE: Path transformations - by Ottia Tuota - 09-03-2020, 11:43 AM
RE: Path transformations - by Ottia Tuota - 09-04-2020, 11:29 AM
RE: Path transformations - by Ottia Tuota - 09-19-2020, 01:00 PM

Forum Jump: