A comprehensive C++ string art generator with Arduino automation and analysis tools.
This project generates string art from images and provides complete automation tools for physical string art creation using an Arduino-controlled machine.
- generate.py: Compiles the C++ code and generates Arduino instructions
- send_commands.py: Sends serial commands to the Arduino stringer
- analyze_pegs.py: Analyzes peg usage patterns and generates frequency plots
makestring-art input.pgm num_pins opacity threshold skipped_neighbors num_windings scale_factor output.pgm windings.txtParameters:
input.pgm- Square P5 portable graymap image (suggested:512x512)num_pins- Number of pegs around the circle (suggested:200-300)opacity- Line opacity factor (suggested:0.2, lower = darker lines)threshold- Scoring threshold (suggested:255)skipped_neighbors- Minimum distance between consecutive pegs (suggested:20)num_windings- Maximum number of string segments (suggested:10000)scale_factor- Output image scaling factor (suggested:4)output.pgm- Output string art image filewindings.txt- windings output file
python generate.pyThis script:
- Compiles the C++ code
- Converts input images to proper format (cropped, resized, grayscale)
- Runs the string art generator
- Creates Arduino instruction files
python send_commands.pySends the generated instructions to the Arduino stringer via serial communication.
python analyze_pegs.pyGenerates frequency plots and statistics showing how often each peg was used.