-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modify PencilBrush render to allow smoother curves #4664
Comments
So my opinion is that if one is better than the other, visually better and gives less complex path, there is no need to have both. So if you can change the code of pencil brush in a simpler one, that gives the same visual effect, you can override the previous code. Also if there is path semplification logic to write, write that as a fabric.util member in order to be reusable on normal fabric.Path To be reusable the fabric.util obviously, should not be a class member but a simple function that return a simplified path without mutating the input ( if possible ) |
about this
this can be a subclass of the pencil brush, with a different name that can be or not be part of the main library, depending on usefulness/code quantity/pluggability. |
An alternative is to write the pencil_brush to use fabric.Path and implement fabric.Path.simplify([tolerance]).
Totally agree that is more a ink brush or something like that. |
i think a simple function, a utility is better. I see that the paper.js example draw segments and then it update to bezier. If you want to work on it, verify if is possible to draw with quadratic, and then do segment -> bezier in a single pass. Is nice to draw and see smooth curves from the beginning. |
|
what is uv_chdir? look like something related to lib_uv not fabricjs
2018-02-14 15:03 GMT+01:00 Fred Guth <[email protected]>:
… @asturur <https://github.com/asturur>, I get an error trying to build:
***@***.*** in ~/Code/fabric/fabric.js (bezier●)
$ nvm use v8.2.1
Now using node v8.2.1 (npm v5.6.0)
***@***.*** in ~/Code/fabric/fabric.js (bezier●)
$ node build.js modules=ALL exclude=node
/Users/fredguth/Code/fabric/fabric.js/build.js:250
process.chdir(distributionPath);
^
Error: ENOENT: no such file or directory, uv_chdir
at Object.<anonymous> (/Users/fredguth/Code/fabric/fabric.js/build.js:250:11)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Function.Module.runMain (module.js:605:10)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:575:3
any idea?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4664 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABI4QBO_8v1___p1spLJ82Pqyo5ZDMVOks5tUueugaJpZM4R2lgn>
.
|
I found the error. The problem was that I needed to create a |
Btw, I am working on this candidate feature right now. |
be aware of those changes that are going to be probably merged. The brushes should have for efficient render, a method to draw just the difference and then also the full render. Pencil brush was an exception and now has been normalized. |
@fredguth have you made any progress on this? |
I stopped working on this. Really sorry. I actually did some progress but I would need to have some spare time to check what is PRable. |
Maybe we should close the issue and I reopen when I can PR. |
the issue is ok open, it gets closed when is incomplete or does not make sense. Can be in progress forever, this is a free/hobby project. |
Hi, |
this functionality landed somehow in fabric with recent changes, |
This is a feature I intend to implement, but I would like to discuss it before coding.
Motivation
Please compare:
http://fabricjs.com/freedrawing
with
http://paperjs.org/examples/path-simplification/
Notice that paper.js curves seem more realistic.
This is due to 2 factors:
Suggested Design
Alternatives
The text was updated successfully, but these errors were encountered: