DotsSVG Master: Halftone Vector Painting This specialized G-code generator is designed for CNC painting machines to reproduce Halftone-style vector dot patterns. It converts SVG circle data into optimized toolpaths, using advanced infill strategies to recreate the classic halftone aesthetic with real paint.
🎨 Halftone Painting StylesThe engine supports two distinct ways to fill halftone dots, depending on the desired visual density and texture:Spiral Infill: Paints each dot using a continuous Archimedean spiral starting from the center. This is the most efficient method for halftone dots as it minimizes sudden axis changes.Concentric Infill: Each dot is composed of multiple independent concentric rings. This style emphasizes the circular geometry and is ideal for high-contrast halftone patterns.
🚀 Key FeaturesGreedy Path Optimization: Reorders dots based on proximity to minimize "air travel" time.Spiral Dip & Mix: The brush enters the paint reservoir using a spiral motion to ensure the bristles are fully saturated and the paint is mixed.Smart Drip Wipe: Calculates the direction of the next halftone dot and wipes the brush against the rim of the tray in that direction.Centralized Configuration: All painting and machine parameters are grouped in a single easy-to-edit block in the source code.
⚙️ Configuration (The Variable Column)All primary settings are located at the bottom of the script in a clear "column" for quick adjustments:VariableContextPurposeFILL_TYPEArtistic StyleChoose 'spiral' or 'concentric' for the dot interior.BRUSH_WIDTHHardwareThe physical diameter of your brush (critical for halftone density).OVERLAPDensityStep-over ratio (0.8 = 80% overlap) to ensure solid fills.MAX_DISTPaint ManagementMax travel distance (mm) before returning to the dip tray.TARGET_WIDTHScaleScales the entire SVG halftone pattern to this width (mm).FEED_RATEPerformancePainting speed in mm/min.X/Y_OFFSETCalibrationThe starting coordinate (Origin) on your workspace.DIP_X/Y/ZHardwarePrecise coordinates of your paint reservoir.Z_SAFESafetyHeight for rapid travel between halftone dots.
🛠 UsageOpen dotsCombined.py and adjust the variables in the "GLAVNE NASTAVITVE" block.Run the script via terminal:Bashpython dotsCombined.py input_halftone.svg output_painting.gcode
📐 Logic Behind the Halftone FillsThe script calculates the necessary toolpath length for each halftone dot using the brush width and overlap. This ensures that the machine knows exactly when the brush is running dry based on the total surface area painted: