Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Path transformations
#30
The newest version is 0.22. For how to get it, see post #1. There is one new plugin. It converts a path to polar coordinates. It is supposed to imitate Gimp's filter Filters > Distorts > Polar coordinates. But this plugin distorts paths, not images, and options are different. The inputs are:
  • Choose which edge is mapped to the middle. Gimp's filter offers two choices: top or bottom. The plugin offers four: top, bottom, left, right. These refer to the edges of the Reference box (see below). Default is "top".
  • Central angle. Default is 360 (degrees), which causes the path to be wound to a full circle. This is the same behaviour as in Gimp's filter. But the plugin allows you to choose some different (smaller) angle, and instead of a full circle you get a circle sector.
  • Reference box. Gimp's filter uses always the whole window. In the plugin the default is the bounding box of the source path. Let us call it BB. You can imagine BB to be somehow "the window of the path", and with this choice the effect will indeed be similar to that of the filter. But the plugin allows other choices with different effects.
  • Algorithm. Choose the best but slow one, or a quick one which creates lots of control points and is possibly inaccurate.
Also, contrary to Gimp's filter, no inverse mapping is implemented. (Or to be precise, is, but I don't know how to make it into a practical plugin.)

Pictures: The first shows the effect of the central angle. Here the angle is 360, 270, 180, 90 degrees. All other inputs are defaults (Top, BB).

   

The second picture shows the effect of the choice of the edge (top, bottom, left, right) of the Reference box. In the picture I used central angle=270 since I think it makes the effect clearer. The Reference box is BB:

   


For example, in the "Top" case happens: The top edge goes to the middle point. (Indeed, the whole edge goes to one point!) The bottom edge goes to the outer circular arc. The left and right side edges go to the two straight edges emanating from the middle point.

The third picture tries to show what may happen when the Reference box does not coincide with the BB of the path. The inputs are defaults except for the Reference box. Let us call RB = the Reference box, and BB = the bounding box of the source path. (In the picture "Box" means RB.)  Since I use the option "Top to middle", the top edge of RB is sent to the middle point. The source path is the grid, and its BB equals its outer boundary. The first case in the picture is the same which already appeared. There RB equals BB, hence also the top edge of BB goes to one point (the middle point).

   

The other cases in this picture are created with RB changed so that its top edge is moved higher, and higher, and higher, and higher. You can think that RB equals otherwise the outer boundary of the grid except that its top edge is moved ever higher. Then the top edge of RB differs from the top edge of BB. The top edge of RB goes again to one point, but now the top edge of BB differs from it, so the latter does not go to one point. Instead, it goes to a small circle around the middle point. The result is that an empty circle emerges at the center, and it becomes the larger the greater the discrepancy is between the top edges of RB and of BB. (To make these examples I used the option to take the Reference box from guides.)

Finally, some plays using default inputs (except that algorithm=0):

   

An interesting fact: Simplifying matters a little, we can say that when we use the option "Top to middle", the mapping is essentially (x,y) -> y(cos(x),sin(x)) (cartesian coordinates are interpreted as polar coordinates). Then:
  • vertical lines are mapped onto straight lines passing through the middle point;
  • horizontal lines are mapped onto circles centered at the middle point;
  • all other straight lines are mapped onto Archimedean spirals.
See, for example, the case at bottom left in the picture above. Looking carefully you see that there are no circular arcs. They are all Archimedean spiral arcs (you just have to believe it!). Compare with the first picture in this post: there the source path has only vertical and horizontal lines, hence the resulting path contains only straight lines and circle arcs.
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: