Graphite icon indicating copy to clipboard operation
Graphite copied to clipboard

Add Smoothing to the Freehand Tool

Open Njasa2k opened this issue 3 years ago • 5 comments

Pencilfreehand When I use this tool the lines of the pencil isn't really smooth. Is this a bug? can it be fixed?

Njasa2k avatar Dec 01 '22 17:12 Njasa2k

Currently we just insert a series of straight lines, however this could easily be improved.

0HyperCube avatar Dec 01 '22 20:12 0HyperCube

Is this issue still up, also which tool is exhibiting this property?

Cioraz avatar Feb 23 '24 19:02 Cioraz

This will be handled by the node graph by the existing spline node.

Keavon avatar Feb 23 '24 19:02 Keavon

This will be handled by the node graph by the existing spline node.

@Keavon This is not how it works in inkscape. There is a user customisable "smoothness" which acts to simplify the line (i.e. removing the control points) and the algorithm used is not a spline as that doesn't really give the desired behaviour.

Inkscape algorithm is https://gitlab.com/inkscape/lib2geom/-/blob/master/src/2geom/bezier-utils.cpp#L192

For context @Cioraz this is with the freehand tool (N key).

0HyperCube avatar Feb 23 '24 21:02 0HyperCube

I think we should generally take the philosophy of recording the raw input data and then postprocessing it in the graph rather than in the tool. You're right that the spline node isn't best for this behavior, but we should probably make one that's better meant for simplifying dense point data.

I could also see this taking the form of a "trailing tail" mode that you drag behind your cursor for a common type of interactive smoothing that's part of the tool itself.

Keavon avatar Feb 23 '24 21:02 Keavon