Pencil tool interpolation
Hi all, I've been having trouble getting lines smooth looking when drawing with the pencil tool. Looking at the code, it seems like a reasonable job of interpolation is being done, but it is done while the path is being drawn, so it can't base the interpolation on all the points drawn by the user.
I made some changes to do the interpolation of the entire path on button release:
Here is an example using identical mouse points and identical tolerances:
http://arcsin.org/temp/Screenshot-3.png
On the left, is the current way; on the right, is the path interpolated using the entire curve. Deferring interpolation decreases the number of knots created and improves (imo) the result appearance. The tolerance is still adjustable in the same way it is currently.
Here's the diff, which is only a demonstration, and in no condition to be actually used: http://arcsin.org/temp/diff
In order to make the final patch, i guess the questions are ... is the way i'm saving the points ok (or should i use std::vector, etc), should we forgo interpolating at all during drawing and instead just show the user a line path (which would greatly simplify the pencil-context code)? or do people want to retain the old behavior and create a new setting/tool.
regards, rob
Excellent. I'd love to see that behavior as an option on the pencil tool's toolbar.
--bb
On Jan 24, 2008 4:05 PM, R M <hoverweasel@...400...> wrote:
Hi all, I've been having trouble getting lines smooth looking when drawing with the pencil tool. Looking at the code, it seems like a reasonable job of interpolation is being done, but it is done while the path is being drawn, so it can't base the interpolation on all the points drawn by the user.
I made some changes to do the interpolation of the entire path on button release:
Here is an example using identical mouse points and identical tolerances:
http://arcsin.org/temp/Screenshot-3.png
On the left, is the current way; on the right, is the path interpolated using the entire curve. Deferring interpolation decreases the number of knots created and improves (imo) the result appearance. The tolerance is still adjustable in the same way it is currently.
Here's the diff, which is only a demonstration, and in no condition to be actually used: http://arcsin.org/temp/diff
In order to make the final patch, i guess the questions are ... is the way i'm saving the points ok (or should i use std::vector, etc), should we forgo interpolating at all during drawing and instead just show the user a line path (which would greatly simplify the pencil-context code)? or do people want to retain the old behavior and create a new setting/tool.
regards, rob
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Excellent. I'd love to see that behavior as an option on the pencil tool's toolbar.
You say that, but to me, I'm really worried about the number of switches that inkscape is taking on. What icon could you use to explain a choice between "use old jaggedy line interpolation" or "use new smooth interpolation". IMHO, users just want the app to work right. The switches seem to be being used as an excuse by us to dodge hard design decisions.
I'd advise that we thoroughly test the new code, and see if we use any functionality by loosing the old interpolator, then if there's no significant loss, only gain, then replace the old with the new permanently!
Joel
On Thu, 2008-01-24 at 16:11 +0900, Bill Baxter wrote:
Excellent. I'd love to see that behavior as an option on the pencil tool's toolbar.
--bb
On Jan 24, 2008 4:05 PM, R M <hoverweasel@...400...> wrote:
Hi all, I've been having trouble getting lines smooth looking when drawing with the pencil tool. Looking at the code, it seems like a reasonable job of interpolation is being done, but it is done while the path is being drawn, so it can't base the interpolation on all the points drawn by the user.
I made some changes to do the interpolation of the entire path on button release:
Here is an example using identical mouse points and identical tolerances:
http://arcsin.org/temp/Screenshot-3.png
On the left, is the current way; on the right, is the path interpolated using the entire curve. Deferring interpolation decreases the number of knots created and improves (imo) the result appearance. The tolerance is still adjustable in the same way it is currently.
Here's the diff, which is only a demonstration, and in no condition to be actually used: http://arcsin.org/temp/diff
In order to make the final patch, i guess the questions are ... is the way i'm saving the points ok (or should i use std::vector, etc), should we forgo interpolating at all during drawing and instead just show the user a line path (which would greatly simplify the pencil-context code)? or do people want to retain the old behavior and create a new setting/tool.
regards, rob
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
On Thu, 24 Jan 2008 08:49:44 -0000, Joel Holdsworth <joel@...1709...> wrote:
Excellent. I'd love to see that behavior as an option on the pencil tool's toolbar.
You say that, but to me, I'm really worried about the number of switches that inkscape is taking on. What icon could you use to explain a choice between "use old jaggedy line interpolation" or "use new smooth interpolation". IMHO, users just want the app to work right. The switches seem to be being used as an excuse by us to dodge hard design decisions.
I'd advise that we thoroughly test the new code, and see if we use any functionality by loosing the old interpolator, then if there's no significant loss, only gain, then replace the old with the new permanently!
Joel
I agree; as far as I can see the current jaggy behaviour should be regarded as a bug. If I want jaggy I can use other tools!
TW
On Thu, 24 Jan 2008 08:49:44 +0000, Joel Holdsworth <joel@...1709...> wrote:
Excellent. I'd love to see that behavior as an option on the pencil tool's toolbar.
You say that, but to me, I'm really worried about the number of switches that inkscape is taking on. What icon could you use to explain a choice between "use old jaggedy line interpolation" or "use new smooth interpolation". IMHO, users just want the app to work right. The switches seem to be being used as an excuse by us to dodge hard design decisions.
I'd advise that we thoroughly test the new code, and see if we use any functionality by loosing the old interpolator, then if there's no significant loss, only gain, then replace the old with the new permanently!
I concur.
-mental
On Jan 24, 2008 7:25 PM, MenTaLguY <mental@...3...> wrote:
On Thu, 24 Jan 2008 08:49:44 +0000, Joel Holdsworth <joel@...1709...> wrote:
Excellent. I'd love to see that behavior as an option on the pencil tool's toolbar.
You say that, but to me, I'm really worried about the number of switches that inkscape is taking on. What icon could you use to explain a choice between "use old jaggedy line interpolation" or "use new smooth interpolation". IMHO, users just want the app to work right. The switches seem to be being used as an excuse by us to dodge hard design decisions.
I'd advise that we thoroughly test the new code, and see if we use any functionality by loosing the old interpolator, then if there's no significant loss, only gain, then replace the old with the new permanently!
I concur.
just as a side note since we're talking about the pencil tool. There was a proposition to reuse the code from the calligraphy tool (at it was done in SodiPodi). Maybe I am raising a delicate mater but I personnally like very much this behavior and think it also produces some smoother and more natural lines. This can (should?) be a toggle, since the behaviors are so different (or a "mass" slider in which 0 is current behavior). What about this plan? Is there someone still thinking about it? Are there some strong opinions about _not_ including it?
On 1/24/08, jiho <jo.irisson@...400...> wrote:
On Jan 24, 2008 7:25 PM, MenTaLguY <mental@...3...> wrote:
On Thu, 24 Jan 2008 08:49:44 +0000, Joel Holdsworth <
joel@...1709...> wrote:
Excellent. I'd love to see that behavior as an option on the pencil tool's toolbar.
You say that, but to me, I'm really worried about the number of
switches
that inkscape is taking on. What icon could you use to explain a
choice
between "use old jaggedy line interpolation" or "use new smooth interpolation". IMHO, users just want the app to work right. The switches seem to be being used as an excuse by us to dodge hard design decisions.
I'd advise that we thoroughly test the new code, and see if we use any functionality by loosing the old interpolator, then if there's no significant loss, only gain, then replace the old with the new permanently!
I concur.
just as a side note since we're talking about the pencil tool. There was a proposition to reuse the code from the calligraphy tool (at it was done in SodiPodi). Maybe I am raising a delicate mater but I personnally like very much this behavior and think it also produces some smoother and more natural lines. This can (should?) be a toggle, since the behaviors are so different (or a "mass" slider in which 0 is current behavior). What about this plan? Is there someone still thinking about it? Are there some strong opinions about _not_ including it?
there was a patch in the tracker a while back from me that made the callig tool generate centerlines as well as the strokes so that you could use them as easy fill shapes, that basically does what your asking for here minus the ui toggle. Would need a fair bit of love before it would apply i think tho, bulia commited the wood carving stuff right after I got it working, so there was a lot of change to the files involved.
Joel Holdsworth <joel@...360...> writes:
You say that, but to me, I'm really worried about the number of switches that inkscape is taking on. What icon could you use to explain a choice between "use old jaggedy line interpolation" or "use new smooth interpolation".
That's easy - you open Adobe flash which has these settings in its pencil tool and you copy that icon. scroll down the page here: http://www.echoecho.com/flashdrawing01.htm and you will see what I'm talking about. actually there's a third setting to the pencil tool there (which also exists in Corel Draw) where some sort of shape recognition is used: nearly-straight lines are recognized as an attempt to draw accurate straight (or angled) lines, and approximate circles are converted to perfect circles.
Without trying the diff yet: smoothness is good but it's not the only thing that matters. Sharp turns and corners, ideally, must be recognized and created sharp, not smoothed out. How does your patch compare to the current code in this respect?
Also: maybe while you're at it, you could also add the tolerance slider to the controls bar of the tool, which is a very long-standing feature gap.
Thanks!
On Jan 24, 2008 2:05 AM, R M <hoverweasel@...400...> wrote:
Hi all, I've been having trouble getting lines smooth looking when drawing with the pencil tool. Looking at the code, it seems like a reasonable job of interpolation is being done, but it is done while the path is being drawn, so it can't base the interpolation on all the points drawn by the user.
I made some changes to do the interpolation of the entire path on button release:
Here is an example using identical mouse points and identical tolerances:
http://arcsin.org/temp/Screenshot-3.png
On the left, is the current way; on the right, is the path interpolated using the entire curve. Deferring interpolation decreases the number of knots created and improves (imo) the result appearance. The tolerance is still adjustable in the same way it is currently.
Here's the diff, which is only a demonstration, and in no condition to be actually used: http://arcsin.org/temp/diff
In order to make the final patch, i guess the questions are ... is the way i'm saving the points ok (or should i use std::vector, etc), should we forgo interpolating at all during drawing and instead just show the user a line path (which would greatly simplify the pencil-context code)? or do people want to retain the old behavior and create a new setting/tool.
regards, rob
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
I tried the patch and found the difference it makes to be quite small. In any case it does not seem to make it any worse. So, please finish the patch and submit it to the bug tracker (along with the toolbar patch) and if others find it an improvement we'll commit it after 0.46.
2008/1/24 R M <hoverweasel@...400...>:
Hi all, I've been having trouble getting lines smooth looking when drawing with the pencil tool. Looking at the code, it seems like a reasonable job of interpolation is being done, but it is done while the path is being drawn, so it can't base the interpolation on all the points drawn by the user.
I made some changes to do the interpolation of the entire path on button release:
Here is an example using identical mouse points and identical tolerances:
http://arcsin.org/temp/Screenshot-3.png
On the left, is the current way; on the right, is the path interpolated using the entire curve. Deferring interpolation decreases the number of knots created and improves (imo) the result appearance. The tolerance is still adjustable in the same way it is currently.
Here's the diff, which is only a demonstration, and in no condition to be actually used: http://arcsin.org/temp/diff
In order to make the final patch, i guess the questions are ... is the way i'm saving the points ok (or should i use std::vector, etc), should we forgo interpolating at all during drawing and instead just show the user a line path (which would greatly simplify the pencil-context code)? or do people want to retain the old behavior and create a new setting/tool.
regards, rob
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
On Jan 28, 2008 3:49 AM, bulia byak <buliabyak@...400...> wrote:
I tried the patch and found the difference it makes to be quite small. In any case it does not seem to make it any worse. So, please finish the patch and submit it to the bug tracker (along with the toolbar patch) and if others find it an improvement we'll commit it after 0.46.
ok here is a patch that is a bit more functional (joining lines, closing, etc). i think it's nearly finished (if i'm handling the paths correctly). notice that i pulled some functions out of draw-context.cpp .
http://arcsin.org/temp/pencil2.diff
i tried it out tonight with my wacom pad and the code felt fairly natural and transparent.
i'll post it to launchpad as well after some minor cleanup.
thanks, rm
participants (9)
-
Bill Baxter
-
bulia byak
-
jiho
-
Joel Holdsworth
-
john cliff
-
MenTaLguY
-
Michael Grosberg
-
R M
-
Thomas Worthington