Draft: GSoC 2021 On-canvas interactive boolean operations
UX issue: ux#109 (closed)
Last GSoC commit: 12dc863f
Demo of the current implementation: https://youtu.be/YnoewFZeXnk
Operations that will be introduced:
-
Fracture (a temporary name): Given a selection, it breaks it into non-overlapping parts.
-
Union/Delete while swiping: This will have the same effect as selecting the selection tool and swiping while holding the alt key, but unions/deletes the selection at the end.
- Flatten: This is a new operation, suggested by Matías Benzo (@matthyuz) in a comment on a youtube video. It basically removes the hidden parts of the shapes. You can see it in action in a video below.
There should be some more parameters in the future. Also, some of these parameters might be discarded if found out to not be very useful.
Currently, the noting about the UX is determined. The features are not yet complete.
How to use:
-
Fracture: Path -> Fracture.
-
Union while swiping: Select the selection tool, hold the alt key, and swipe along the shapes/paths that you want to merge. This replaces the old alt + swipe functionality of the selection tool. This is just temporary for now. Later, will have its own way of doing it (not sure how it should be represented).
-
Delete while swiping: Not implemented yet. When the union part gets implemented separately, it'll be done with it.
Some videos for the progress:
Fracture + Union:
https://www.youtube.com/watch?v=P86sO2XWht0
https://www.youtube.com/watch?v=v4d7HfT52ZE
Flatten:
https://www.youtube.com/watch?v=gnUu28yaitc
Note: There are some parts in the videos where I have to union twice (or more) for the union to happen completely. This is a bug and not a feature. didn't work on the union/delete while swiping functionality that much. The main focus is on the Fraccture
operation for now.
Current known problems:
-
Fracture
doesn't work well with curved shapes. Try applying it on all of the circles in this file: 6_intersecting_circles.svg, you should get only 31 shapes. That's not what happens. -
The union while swiping doesn't always work well and requires unioning more than one time to union completely and doesn't always union correctly (joins the shapes with some lines inside the result).
-
The history doesn't work very well, will be fixed soon. update: Should be fixed now.
-
Doesn't work very well with lines or any shape that consists of 2 nodes.