biigle / annotations

:m: BIIGLE module to create, edit and explore image annotations
0 stars 1 forks source link

Implement warp tool #117

Closed mzur closed 5 years ago

mzur commented 6 years ago

If freehand line strings or polygons are created or if the magic wand tool is used, shapes with many vertices are created. These shapes practically cannot be modified afterwards as modification works on a vertex-by-vertex basis. To enable modification of these shapes, we can implement a "warp tool". This tool should be similar to the warp tool in Illustrator or the tweak objects tool (in "push parts of paths" mode) of Inkscape.

The tool displays a "brush" in form of a circle. The brush radius should be configurable in the settings. Optionally, users can enable a dynamic brush radius that is determined by the pressure property of the mouse. When the user keeps the mouse button pressed and moves the cursor, the warp tool moves all vertices of line strings or polygons that are less than radius away from the center of the brush to exactly the distance of radius to the center. When the mouse button is released, any modified line strings or polygons are simplified, removing superfluous vertices.

mzur commented 5 years ago

An alternative way to do this would be closer to painting. In each iteration of the render loop, a virtual circle is drawn. Depending on the drawing mode (additive, subtractive) the circle is either merged into the existing polygon or subtracted from it. This has the advantage that it can add new vertives to an existing polygon which may be more practical.

mzur commented 5 years ago

This was implemented in #128.