How saffroncarp1106/osgar works
OSGAR is a desktop tool for turning osu! replay (.osr) or SVG paths into printer-oriented G-code, with replay visualization and optional synchronized HID key playback through a printer. The principal workflow is import, edit or preview paths, generate G-code, then coordinate printing and key events. The README documents the OSR/SVG conversion goal; sampled code confirms parsing, recording data, export, and run control. Some GUI wiring and peripheral capabilities are unsampled, so only documented or indexed relationships are shown.
Main entry points: main_window.py Application window · model.py Recording model · hid_panel.py HID controls · run_controller.py Run controller
Components 22
Desktop interface
- Application window
gui/main_window.py - Canvas and editing
gui/canvas.py - Export controls
gui/export_panel.py
Path ingestion
- OSR parser
storage/osr_importer.py - SVG importer
storage/svg_importer.py - Recording model
recording/model.py
Motion and export
- Replay analysis
analyze.py - Coordinate conversion
motion/coordinate_converter.py - Path filters
motion/filters.py - Motion planner
motion/klipper_planner.py - Speed fitting
motion/speed_fit.py - G-code generator
storage/gcode_exporter.py
Replay and HID
- Replay player
playback/player.py - Key schedule
hardware/key_schedule.py - HID controls
gui/hid_panel.py - HID link
hardware/hid_link.py - Run controller
hardware/run_controller.py - Moonraker client
hardware/moonraker_client.py
Settings and projects
- Application settings
config/settings.py - Project persistence
storage/project.py
Other components
- Operator
- 3D printer
Connections 23
- Operator → Application window: uses
- Application window → Canvas and editing: updates
gui/main_window.py - Application window → OSR parser: imports replay
gui/main_window.py - Application window → SVG importer: imports paths
gui/main_window.py - OSR parser → Recording model: creates
storage/osr_importer.py - SVG importer → Recording model: creates
storage/svg_importer.py - Application window → Recording model: edits layers
gui/main_window.py - Application window → Replay analysis: analyzes replay
- Application window → Coordinate conversion: converts positions
gui/main_window.py - Coordinate conversion → Path filters: feeds
motion/filters.py - Recording model → Speed fitting: fits timing
motion/speed_fit.py - Export controls → Application window: sets export options
gui/main_window.py - Application window → G-code generator: exports paths
gui/main_window.py - G-code generator → Motion planner: plans moves
storage/gcode_exporter.py - Application window → Replay player: controls replay
gui/main_window.py - HID controls → Run controller: starts runs
gui/hid_panel.py - HID controls → HID link: controls link
gui/hid_panel.py - HID controls → Key schedule: prepares playback
gui/hid_panel.py - Run controller → Key schedule: dispatches events
hardware/run_controller.py - Run controller → Moonraker client: controls printer
hardware/run_controller.py - Moonraker client → 3D printer: sends commands
hardware/moonraker_client.py - Application window → Application settings: loads settings
gui/main_window.py - Application window → Project persistence: loads projects
gui/main_window.py