Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Path transformations
#11
(07-12-2020, 11:33 PM)Ofnuts Wrote: I find it complicated to use. I don't see much purpose in the "base" and "target". You can make things simpler with one less path. You would have:

1. The source path
2. The "shaper"
3. A rectangle.

The transform maps the rectangle to the shaper. In the nominal use, the rectangle frames the source path. Benefits: the rectangle can be implicit, and can be for instance the bounding box of the source path (max/min x,y of the anchors, or anchors and tangents) or defined by guides, or the selection...  See for instance https://www.gimp-forum.net/Thread-ofn-bend-path

What makes the fast algorithm faster?

True. That would be more simple to use, and that would be an advantage. Something similar you can get by using the Shaper as the Target and drawing the Base rectangle around the source path (true, that could be implicit).

But this way it is more flexible. Where the transformed path will be located, is independent of the Shaper. The Base and the Target determine the movement. The Shaper determines the shape.

Also, if you use 4-anchor Base and Target, neither needs to be a rectangle, not even the Base. They may be skew quadrilaterals. So, from a single Shaper you get different effects by changing the forms of the Base and the Target.

But it might be good to make such simpler version. I'll look into it.

The plugin is slow because of the approximation that is needed. If the source path is a Bezier curve of degree 3, the transformation makes it into a curve of degree 9. To draw it with Bezier curves, an approximation must be used. To that end, the plugin uses my own algorithm (that certainly should be much better and faster).

The simple algorithm is fast since it is simple. It does not even try to approximate. If you choose the algorithm by putting the input number =1, it uses the following simple rule: When it sees an arc that should be drawn, it sets the end points exactly right, and it sets the tangent directions at the end points exactly right. But the handle lengths are set simply to be 1/3 of the chord length. If the arc curves only mildly, the result may be good, but it may also be quite wrong. The simple algorithm does not care. I shall make an example picture for you when I have the time.

If you choose the simple algorithm by putting the input number >1, what happens is that the algorithm first subdivides the arc into smaller subarcs, and then it uses the simple rule on the subarcs. So the number of control points grows. Try to put input =8 and see the result.

The slow algorithm ideally gives good approximation with only a small number of control points.

By the way, Inkscape can draw parametric curves as paths. I looked at it once (not the current version, that was some time ago).  It seemed to me that it used such simple 1/3 rule or something similar. So, to get accurate results, you must put control points densely. That approximation is a non-trivial problem.
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: