SVG to G-Code Converter

Note: The GCode output has been somewhat tested on a Creality Falcon 2 Pro. It has not been tested on any other laser cutters and use of the GCode is at the sole risk of the user. Having said that, the GCode is standard with the exception of the framing comment which should be ignored by laser cutters which do not use it.

We will add a list of tested laser cutters based on feedback so please let us know if you have tested the program on other laser cutters.

Note: The first time that Generate is pressed you will be asked to allow access to your local fonts directory. This is required to process text within the SVG file correctly. If you do not allow this then you should convert the text to paths before loading the SVG file.

If you have said No but want to allow it, you will need to find the font setting for the 3puz site and change it:

User Guide

Table of Contents

Introduction

3PUZ SVG to G-Code Converter is a powerful application designed to transform Scalable Vector Graphics (SVG) files into G-code, the standard language for laser engravers and cutters. This software bridges the gap between graphic design and machine fabrication, allowing you to easily prepare your vector designs for engraving and printing.

Privacy

When you load an SVG file, it is loaded into your browser but not sent to 3PUZ. The conversion to GCode is performed on your computer in the browser.

Your designs remain on your computer at all times and you have complete control of them!

The speed at which the SVG is converted to GCode is dependant on the power of your computer but should not be an issue for most people. If it is an issue for you, let us know in the feedback and we will consider offering conversion on the server.

User Interface

The workflow is straightforward, it consists of three steps: * Load the SVG file * Set the output parameters * Download the generated GCode file * Verify that the result in the GCode Preview matches your expected output.

Help Button

Displays this Guide

Feedback Button

Sends a message to the developers. All comments, complements and suggestions are welcome.

Importing SVG Files

To import an SVG file: * Drag and drop your SVG file onto the indicated area or click the "Import SVG" button and select the file.

As well as SVG files, PNG and JPEG files are also supported. If you choose to load an image file you should set the size and margins in the GCode Settings Tab.

Setting the output parameters

Click Next or select the GCode Settings tab to adjust the power and other settings for the laser.

Settings Description
Laser Power The percentage power to apply to the cut.
This controls the S value in the GCode.
Only the first number after the decimal point is used and the rest of the number truncated
Speed The speed that the laser head will move.
This controls the F value in the GCode.
The input is multiplied by 60 and then truncated to an integer.
Number of Passes The number of passes that the laser will make.
The output is duplicated the number of times specified.
The design is fully cut on each pass.
Image Processing Strategy For raster images (PNG/JPG): Choose how the image is processed
Raster: Line-by-line engraving
Outline: Trace edges/contours
Variable Power: Power varies with pixel intensity
Stippling: Dot-based engraving
Hatch Fill: Cross-hatch fill pattern

Advanced Mode (SVG Files Only)

Advanced Mode provides precise control over individual objects and groups within your SVG file, allowing you to configure different cut parameters for each element.

Enabling Advanced Mode:

  1. Load an SVG file (Advanced Mode is only available for SVG files, not PNG/JPG)
  2. Navigate to the GCode Settings tab
  3. Toggle the Advanced Mode switch to "Enable"

Features:

Object Tree View

Visual Highlighting

Group Selection

Default Cut Parameters

When Advanced Mode is enabled, you'll see a blue "Default Cut Parameters" box with:

These defaults are synchronized with the main power/speed/passes settings.

Configuring Individual Objects:

  1. Select objects from the Object Configuration list by clicking checkboxes or object rows
  2. For groups: All child objects are automatically selected with the same color
  3. The Configure Selected Objects panel appears showing:
  4. Power (%): Set custom power for selected objects
  5. Speed (mm/sec): Set custom speed for selected objects
  6. Passes: Set custom number of passes for selected objects
  7. Click Apply to Selected to save the custom parameters
  8. Objects with custom parameters display their settings in the object list
  9. Click Clear Selection to deselect all objects

Select All Button

Workflow Tips:

When Advanced Mode is Disabled:

Image Settings (PNG/JPG Files Only)

When you load a raster image (PNG or JPG), additional settings become available:

Settings Description
Width (mm) The desired width of the engraved image in millimeters.
This determines the physical size of the output on your material.
Height (mm) The desired height of the engraved image in millimeters.
This determines the physical size of the output on your material.
Left Margin (mm) Distance from the left edge of the laser bed to start engraving.
Must be between 0 and the maximum width of your machine.
Top Margin (mm) Distance from the top edge of the laser bed to start engraving.
Must be between 0 and the maximum depth of your machine.

Note: For SVG files, these controls are automatically disabled as SVG files contain their own size information and scaling.

GCode Preview and Download

To generate the GCode you must press the Generate GCode button on the GCode Settings tab. This will bring up the Preview & Download tab.

You can view the generated GCode before downloading it. The preview shows a text representation of the first part of the G-code for inspection.

G-Code Visualization

After generating G-code, you can visualize the cutting path using the built-in visualization tool:

  1. Automatic Display: The visualization appears automatically after G-code generation
  2. Interactive Controls:
  3. Zoom: Use mouse wheel or zoom buttons to zoom in/out
  4. Pan: Click and drag to move around the visualization
  5. Reset: Return to the default view
  6. Path Information:
  7. Red lines: Cutting/engraving moves (laser on)
  8. Gray dashed lines: Rapid positioning moves (laser off)
  9. Grid: 10mm reference grid for scale
  10. Origin marker: Shows the (0,0) position based on your machine settings

Download Options

Note 2: For performance reasons only the first part of the output is shown in the Preview and Download tab.

Supported SVG Features

The converter supports the following SVG elements: - Path elements: All path commands (M, L, H, V, C, S, Q, T, A, Z) - Basic shapes: Rectangle, circle, ellipse, line, polyline, polygon - Text elements: Converted to paths automatically - Groups: Hierarchical organization preserved - Layers: Converted to separate operations - Transforms: Rotation, scaling, translation, and skewing

Not supported: - Gradients - Filters and effects - Animation - External references

SVG Best Practices

For optimal results: - Convert text to paths before importing - Use minimal path points to reduce processing time - Organize by layers for different operations - Clean up unnecessary elements that won't be cut - Set proper dimensions that match your intended output - Use closed paths where possible - Avoid very small elements below your machine's resolution

Configuration Settings

Machine Settings

Configure your specific machine parameters in the Machine tab:

Preconfigured Machines

Custom Machine Setup

For machines not in the preconfigured list:

Setting Description
Name Give your laser cutter a descriptive name for reference
Power Maximum laser power rating (used for documentation only)
Width (mm) The maximum cutting width of your machine's work area
Depth (mm) The maximum cutting depth of your machine's work area
Origin Corner Set where X0,Y0 is located on your machine:
Top-Left: Origin at top-left corner
Bottom-Left: Origin at bottom-left corner

Important: Check your machine's manual to determine the correct origin corner. Using the wrong origin will result in mirrored or inverted cuts.

Safety Considerations

Appendices

Keyboard Shortcuts

General Navigation - Ctrl+O: Open file dialog to import SVG/image files - Ctrl+S: Generate and download G-code (if not already generated) or download existing G-code

Workflow Shortcuts - Tab navigation: Use the tabs at the top to move between Load, Settings, and Preview sections - Enter: Submit forms and advance to next step where applicable

G-Code Reference

Common G-code commands generated by the converter:

Movement Commands - G0: Rapid positioning (laser off, fast movement) - G1: Linear interpolation (controlled movement, laser on)

Coordinate System - G21: Set units to millimeters - G90: Absolute positioning mode - G91: Incremental positioning mode (relative movements)

Laser Control - M3: Enable laser (constant power mode) - M5: Disable laser - S[value]: Set laser power (S0 = off, S1000 = maximum power)

Feed Rate - F[value]: Set feed rate in mm/minute

Program Control - M2: End of program - G4 P[seconds]: Dwell/pause for specified time

Example G-code snippet:

G21 ; Set units to millimeters
G90 ; Absolute positioning
M3 ; Enable laser
S0 ; Turn off laser initially
G0 X0 Y0 ; Move to origin
G0 X10 Y10 F3000 ; Rapid move to start position
S800 ; Set laser power to 80%
G1 X20 Y10 F1000 ; Cut line with laser on
S0 ; Turn off laser
M5 ; Disable laser
M2 ; End program

Troubleshooting

Common Issues and Solutions:

File Load Problems - Ensure file is in SVG, PNG, or JPG format - Check file size (very large files may take longer to process) - For SVG files, ensure they contain valid vector data

G-code Generation Errors - Verify all settings are within valid ranges - Check that laser power is between 1-100% - For custom machines, verify width/depth dimensions are correct

Visualization Issues

If visualization doesn't appear: - Ensure G-code was generated successfully first - Check browser console for any error messages

Output Quality Issues - For raster images: adjust processing strategy and power settings - For SVG files: ensure paths are properly closed and simplified - Consider reducing complexity for very detailed designs

Machine Compatibility - Test with low power on scrap material first - Verify origin settings match your machine's configuration - Check that coordinate system matches your machine's expectations

Glossary

Technical Terms - SVG: Scalable Vector Graphics format - a vector-based image format that uses mathematical descriptions of shapes - G-code: Programming language for CNC machines, including laser cutters, that describes toolpaths and machine operations - Raster: Bitmap image composed of individual pixels, processed line-by-line for engraving - Vector: Mathematical representation of shapes using points, lines, and curves - DPI: Dots Per Inch - resolution measurement for raster images

Laser Cutting Terms - Kerf: Width of material removed by the laser beam during cutting - Feed rate: Speed at which the laser head moves during cutting operations (mm/minute) - Rapid move: Fast positioning movement when laser is off, used for positioning between cuts - Feed move: Controlled movement during cutting operations when laser is on - Pass: Single complete execution of the cutting path - multiple passes can deepen cuts

Machine Coordinates - Origin: The reference point (0,0) on the laser bed from which all coordinates are measured - Work area: The maximum dimensions within which the laser can operate - Absolute positioning: Coordinate system where positions are specified relative to a fixed origin - Relative positioning: Coordinate system where positions are specified relative to the current position

Processing Strategies - Outline: Traces the edges/contours of shapes for cutting - Raster: Line-by-line engraving suitable for images and filled areas - Variable Power: Engraving where laser power varies based on image darkness/lightness - Stippling: Dot-based engraving technique for artistic effects - Hatch Fill: Cross-hatch pattern filling for solid areas

File Formats - SVG: Scalable Vector Graphics - XML-based vector image format - PNG: Portable Network Graphics - lossless raster image format - JPG/JPEG: Joint Photographic Experts Group - lossy raster image format - G-code: Plain text file containing machine instructions (.gcode or .nc extension)