On Tue, Sep 2, 2008 at 8:14 PM, Maximilian Albert <Anhalter42@...> wrote:
> How do you plan to store the per-node information and retain it when the
> path is modified (especially with "simplify" and such, but also when nodes
> are inserted/deleted)? It can't be part of the LPE itself since it's
> path-specific.
Why, it can, it will be just a path-specific LPE, automatically
constructed for each path and edited by node tool. I think we will
need to store widths not per node, but as a list of length along
path/width pairs, with length measured in percentages of the total
length of subpath; this way it will be easily preserved during
simplify and add/delete nodes. Such a profile will also be easily
shareable to other paths, which may make perfect sense, even if their
node composition is quite different.
Actually, now that I think of it, why tie this thing to nodes at all?
Just provide a shortcut in the Node tool which would find out the
point on path over which you're hovering your mouse (which may be a
node, or a segment between nodes - does not matter), and adjust width
up or down for that point. Even better and more generic! This way you
will be able to fully edit profiles that were copy/pasted from another
path and whose maxima/minima points do not coincide with your path's
nodes.
The only gotcha is that we need some flexibility in the LPE in the
algorithm which takes the length/width input and adjusts the list. For
example, if you have width 1 at length 0.5 and request it to make
width 2 at length 0.501, you will get a sharp hike, which is most
likely not what the user wants. So, the algorithm must check if there
already is a point "close enough" (definition may vary) to the
requested point; if there is, change that point without adding a new
one. If however a width change is requested "far enough" from the
existing points, a new point is added to the list. At leadt, that
should be the default behavior; later we may add some other shortcut
which would allow us to add sharp width changes if necessary.
And finally, for the actual profile shape I think we should use a
Spiro path for extra smoothness and natural flow. However, if we want
to eventually support sharp width changes, we will need to store for
each point its type - whether it is a smooth Spiro point or a cusp
point.
--
bulia byak
Inkscape. Draw Freely.
http://www.inkscape.org
|