https://github.com/chiefenne/scale_gcode
Scale the G-Code given in the input file in x, y, z axis. Useful for part duplication in different sizes.
https://github.com/chiefenne/scale_gcode
Last synced: 11 months ago
JSON representation
Scale the G-Code given in the input file in x, y, z axis. Useful for part duplication in different sizes.
- Host: GitHub
- URL: https://github.com/chiefenne/scale_gcode
- Owner: chiefenne
- License: mit
- Created: 2024-07-28T07:47:43.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-05T11:57:45.000Z (over 1 year ago)
- Last Synced: 2025-04-08T08:49:12.940Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 5.46 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# G-code Scaling Script
This Python script scales the X, Y, and Z coordinates in a G-code file by specified factors and exports the scaled G-code to a new file.
## Features
- Scale G-code coordinates for X, Y, and Z axes independently. (also scales I, J, K respectively for arc centers)
- A default output file name is derived based on the input file and scaling factors.
- Optionally an arbitrary output file name can be specified.
## Requirements
- Python 3.x
## Usage
Scale an input G-code file with default scaling factors and generate a default output file name.
```sh
python scale_gcode.py input.gcode -x 1.5 -y 1.2 -z 1.0
```
```sh
python scale_gcode.py another_input.nc -x 0.5 -y 0.5 -o scaled.nc
```
### Command Line Arguments
- `input_file`: Path to the input G-code file (required).
- `-o`: Path to the output scaled G-code file (optional). If not provided, a default filename will be generated.
- `-x`: Scaling factor for X axis. Default is 1.0.
- `-y`: Scaling factor for Y axis. Default is 1.0.
- `-z`: Scaling factor for Z axis. Default is 1.0.