Preconfigured Voronoi scanner
This activity belongs to the GeoGebra book Voronoi Paintings.
It is recommended to download the construction for local use, as it may run much slower on the web. Additionally, when used locally, the result can be saved as a GGB file (profiles will be preserved, but not the
traces). If a construction with profiles is saved, there might be an error when opening it again. This is not important and occurs because the list of profiles is no longer updated. Simply click the "Incorporate profiles" button to update it.
Naturally, the application works not only when there are paintings in the graphics view but also when there are at least two sketches made with the Pen tool. This means that we can create the Voronoi diagram of virtually any design that we can approximate with the Pen tool.
To achieve automation in the construction, it is essential to know the default names that GeoGebra assigns to sketches made with the Pen tool. These names vary when using the local construction, depending on the
language and geographic region (Spanish from Spain, international Spanish, etc.). The construction, when used locally, "should be ready" (at least it is on the authors' computer) to support any variety of Spanish, Portuguese, English, French, Italian, German, Galician, Catalan, and Basque, meaning it supports "sketch," "bosquejo," "bosquexo," "traç," "traço," "Traço," "tracé," "tratto," "stroke," "Strich," and "Eskukolpea".
We invite the reader to draw three or four strokes with the Pen tool , waiting at least three seconds between strokes. Then, click the "Incorporate profiles" button and finally the "Play" button .
Below, detailed information about its operation with images is provided after the construction.
Limitations
- As mentioned earlier, the local application runs much faster than the web version. Note: The web application is marked for compilation, which may improve the scanner's speed in the future, but it will never match the agility of the local application.
- When using the application locally, the user should ensure in the Options menu that they are using one of the languages mentioned earlier. If not, they should change it before using the Pencil tool.
- The maximum number of silhouette profiles that can be scanned is 50. This number also affects the speed of the scanner; if it is high, the user may need to adjust the "speed" slider to prevent skipping.
Instructions for use
If using the local application, make sure (in the Options menu) that the chosen language is Spanish or one of those already indicated.
The normal use of the application involves four steps:
1. Placement of the image.
2. Outlining the silhouettes and incorporating the profiles.
3. Scanning.
4. (Optional) Repositioning the result as a semitransparent image.
Placement of the image
- Using the Image tool, import an image into the graphic view. Although theoretically it supports the extensions jpg, jpeg, png, gif, and bmp, the first two may generate some error messages. Maximum dimensions: 1000 x 800 pixels. If the image is larger, readjust the position of the points in the lower corners of the image. Alternatively, there are many editors and applications that allow easy resizing of an image beforehand (such as this online tool: http://webresizer.com/resizer/?lang=en). Otherwise, delete those two points.
- Using the Move tool , place the image as centered as possible in the visible (green) corner in the upper left. With the same tool, adjust the angle (green) of the upper right corner.
- Using the Move tool, right-click to open the contextual menu. Choose "Properties" (or "Settings"), and activate "Background Image".
Outlining the silhouettes and incorporating the profiles
- Using the Pencil tool , trace the outline of the desired elements of the painting, up to a maximum of 50. To achieve the appropriate result, these elements should not share a common border. The tool is used by clicking and dragging the left mouse button. The use of the right button allows erasing previously drawn strokes. ATTENTION: It is important to wait a few seconds (4 or 5) between the end of one profile and the beginning of the next. Otherwise, GeoGebra considers the strokes as a single one (see note in the following section). ATTENTION: Each profile must be drawn in a single stroke. After a couple of seconds from releasing the left mouse button, GeoGebra considers the stroke finished. Strokes cannot be joined (even if visually they appear as one, they are still separate).
- Press the green button "Incorporate profiles", whose mission is to update the scanner with the new profiles. For it to work, it is necessary to have created at least two profiles. If not, a warning message will appear. If only one profile has been drawn, it can be used (in its entirety or by erasing any unnecessary parts) to draw another one before pressing this button again. All profiles can be deleted using the red button "Delete profiles". Note: To prevent two consecutive profiles from being considered as one, it may be a good strategy to press the "Incorporate profiles" button at the end of each stroke.
- If the new profiles have been successfully incorporated, a checkbox will appear that allows them to be hidden or shown at will, at any time.
Scanning
Finally, activate the scanner by pressing the Play button , in the bottom left corner.
The left sidebar provides various tools to control the scanner:
- The Stop button (which replaces the Play button when activated).
- The "t = ..." slider controls the horizontal position of the scanner. We can move it manually, but this may result in vertical bars with inaccurate traces.
- The "speed" slider allows us to reduce or increase the speed of the scanner. It is advisable to decrease the speed if we observe jumps in the scanner.
- The button sends the scanner to its leftmost position, regardless of its current position, without erasing traces or generating inaccurate traces. The same applies to the rightmost position using the button.
- The "Clean" button removes all traces left by the scanner from the screen.
- The vertical slider controls the vertical position of the scanner at different heights, from the top to the bottom of the graphic view. The scanner descends 200 pixels from one position to the next.
- The "contrast" slider allows adjusting the color contrast between the Voronoi diagram and the background.
- The "Show scanner" checkbox allows toggling the visibility of the scanner at will. Note that the scanner must be visible to leave a trace.
(Optional) Repositioning the result as a semitransparent image
- We export the image to the clipboard (only works locally). To do this, press the "Copy to Clipboard" button. The scanner will automatically hide just before copying. Note: There seems to be some sort of issue or limitation with the web version because clipboard export doesn't work. In the web version, you can use the hamburger menu to save the image and then retrieve it using the button.
- In the Edit menu, choose "Insert image from... Clipboard".
- The image will be pasted into the graphic view or the sidebar. In any case, delete the points in the bottom corners of the image.
- Right-click on the image and choose Properties. o In the Advanced tab, deactivate (if necessary) Graphic View 2 and activate Graphic View. o In the Position tab, choose A as Corner 1 and B as Corner 2. o On the Color tab, adjust the desired opacity (usually around 50%).
Author of the activity and GeoGebra construction: Rafael Losada.