Hi Tom, Sorry for the delayed reply.
On 8-12-2013 3:59, Tom Lechner wrote:
Hi,
I really love the powerstroke path effect, but some questions.
- How accessible is the stroke information? From the file, it appears
it is stored as a series of points, and stroke properties are derived from proximity to the original path.
The points are ('time' along path, width) pairs. The 'time' coordinate can be split in two parts: the integer part counts the segments of the path, and the fractional part is the 'time' coordinate for that segment (if you have the curve segment, the point can be found by curve.at(time)). Note that this is not the distance along the path! (computationally more expensive)
Perhaps there is an option to output more explicit information so that anything building on top of powerstroke can use it? If there is no possibility of outputing a kind of cache of powerstroke info, are there easy to use functions in the actual code to get this kind of information?
I have been working on a mesh along path interface (not quite directly in inkscape yet), which could be adapted to apply gradients perpendicular to paths, make paths change color in the path direction, or perhaps be a base for inserting series of etching lines that conforms to a base path.
Having access to powerstroke width profiles would be a great asset for these kinds of extensions.
- Does the powerstroke computer apply the width always centered on the
path? If the top and bottom were allowed to operate independently, it would be a single interface for both line offsetting (with only one powerstroke point) and for powerstroking itself.
The width is always centered on the path. Although it is not very hard to make it asymmetric in the code, I decided to first make it work well with symmetric widths. But it has been a long time since I last worked on the code. It needs some design improvements.
regards, Johan