A point canvas with JSON storage
Pts is a GUI for creating, manipulating, and arranging points on a canvas.
Points can be:
- different shapes and switched from one to the other with S + the shape key:
- C for circle
- S for square
- D for diamond (square rotated 45°)
- H for semi-circle (half-circle)
- cloned,
- in-place with C×2
- in the dirrection of an arrow key with C+{←↑→↓}
- locked to a grid of lines, toggled with G
- selected one at a time, or multiple at a time by either:
- Box selection by holding the mouse to drag a bounding box
- flood fill (also in B mode) in a particular direction (←↑→↓),
- saved to JSON (
points.json) and re-loaded.
- Select single or multiple points with your mouse
- Draw new points by holding the mouse down in paintbrush mode (P toggles)
- Drag points with mouse (G toggles snapping to grid)
- Keyboard-driven workflow
- Configure settings via tool TOML in Cargo.toml
- Publish to crates.io
cargo install pts- Cargo binstall installation is still TODO
Create config.toml in the working directory:
bg_color = "#FFFFFF"
point_color = "#000000"
selected_color = "#FF0000"
selection_box_color = "#0000FF"
grid_enabled = true
grid_spacing = 50.0
grid_color = "#CCCCCC"
point_radius = 8.0
move_step = 1.0
move_step_large = 8.0- Click point: Select single point
- Click empty: Deselect all
- B: Toggle box select mode
- Arrow keys (in box mode): Expand selection to adjacent points
- Drag box: Select all points entirely within box
- Arrow keys: Move selected points by
move_step - Shift + Arrow: Move by
move_step_large - Mouse drag: Move selected points (quantized to
move_step)
- C then C: Clone selected points on top
- C then Arrow: Clone adjacent (offset by bounding box size)
- S then S: Set selected points to square
- S then C: Set selected points to circle
- S then D: Set selected points to diamond
- S then H: Set selected points to semi-circle (half-circle)
- G: Toggle snap-to-grid mode
- V then G: Toggle grid visibility
- Ctrl + Scroll: Zoom (0.1x to 10x)
- X: Delete selected points
- ?: Show help window
- Ctrl + S: Save points to
points.json - Ctrl + O: Load points from file
- Ctrl + R: Reset to defaults
- Q or Esc: Quit
Points are saved to points.json in the working directory:
{
"points": [
{"id": 1, "x": 200.0, "y": 100.0, "shape": "Circle"},
{"id": 2, "x": 400.0, "y": 200.0, "shape": "Square"}
{"id": 3, "x": 600.0, "y": 300.0, "shape": "Diamond"}
]
}When snap-to-grid mode is enabled (G), point boundaries snap to the nearest grid lines. The closest edge of each point aligns with grid spacing.
- Dragging or arrow moving a selected point moves all selected points together
- Cloning creates copies of all selected points
- Shape changes apply to all selected points
- Delete removes all selected points, then selects most recently created remaining point
- ...often not very well: TOFIX!
Made with:
- egui (for the easy GUI, naturally)
- facet (for JSON de/serialisation and application TOML config loading)
pts is MIT licensed, a permissive open source license.
