A modern CNC CAM application with intelligent G-Code generation, live 3D preview, and direct SVG-to-toolpath conversion.
- Introduction
- System Overview
- Installation and Setup
- User Interface Guide
- Core Features
- Technical Architecture
- Advanced Features
- Tool Management
- Configuration and Settings
- Troubleshooting
- Development and Extension
- Appendices
NWSS-CNC is a professional 2D Computer-Aided Manufacturing (CAM) software designed to convert vector graphics (SVG files) into G-code for CNC machines. The application provides a complete workflow from design visualization to machine-ready code generation, featuring advanced path optimization, tool management, and real-time 3D visualization.
- SVG to G-Code Conversion: Import SVG files and convert them to optimized G-code
- Automatic Margin Detection: Intelligent removal of empty space from SVG imports for precise sizing
- 3D Visualization: Real-time 3D preview of toolpaths with advanced navigation controls
- Professional CAM Operations: Support for perimeter cutting, pocketing, punching, and engraving
- Tool Management: Comprehensive tool database with automatic parameter optimization
- Advanced Path Processing: Clipper2-based polygon operations for professional results
- Material Management: Precise material and bed size configuration
- Auto-scaling: Automatically scales large designs to fit within material bounds
- Smooth UX: Modern, professional interface with full customizability and user-experience prioritized
- First-time machinists
- CNC machine operators
- CAM professionals
- Hobbyists and makers
- Educational institutions
- Small to medium manufacturing shops
NWSS-CNC is built using Qt6 with C++17, providing cross-platform compatibility for Windows, macOS, and Linux. The application follows a modular architecture with clear separation between core processing logic and user interface components.
- Qt6 Framework: Cross-platform GUI framework
- OpenGL: 3D graphics rendering for toolpath visualization
- NanoSVG: Lightweight SVG parsing library
- Clipper2: Advanced 2D polygon clipping library
- Modern C++17: High-performance core algorithms
Input Formats:
- SVG (Scalable Vector Graphics) - Primary input format
- Existing G-code files for editing, visualization, and automatic conversion
- DXF (Drawing Exchange Format) - Future support planned
- Other vector formats (future support planned)
- STL - Future support planned for 3D models
Output Formats:
- G-code (ISO 6983 standard)
- Download the installer from the release page
- Run the installer as administrator
- Follow the installation wizard
- Launch NWSS-CNC from the desktop shortcut, start menu, or Program Files directory
- Download the .dmg file
- Open the disk image
- Drag NWSS-CNC to the Applications folder
- Launch from Applications or Launchpad
- If MacOS blocks the application, go to System Preferences > Security & Privacy and allow it under the "General" tab
- Download the AppImage or use the package manager
- Make the file executable:
chmod +x NWSS-CNC.AppImage
- Run the application:
./NWSS-CNC.AppImage
On first launch, NWSS-CNC presents a welcome dialog with options to:
- Create a new empty project
- Open an existing G-code file
- Import an SVG file for conversion
The application will automatically create default configuration files and tool databases.
The NWSS-CNC interface consists of several key areas:
- File Menu: New, Open, Save, Import SVG, Exit
- Edit Menu: Cut, Copy, Paste operations
- View Menu: Toggle docks, zoom controls
- Tools Menu: Tool management, settings
- Help Menu: About dialog, documentation
Quick access buttons for common operations:
- New file
- Open file
- Save file
- Import SVG
- Tool management
SVG Designer Tab:
- Vector graphics viewer and editor
- Material and bed boundary visualization
- Grid and snap controls
- Measurement tools
- Design transformation controls
G-Code Editor Tab:
- Syntax-highlighted G-code editor
- Line numbering
3D Viewer Tab:
- Interactive 3D toolpath visualization
- Navigation cube for view control
- CAD-style camera controls
- Real-time rendering of toolpaths
- Animation controls
- Level-of-detail (LOD) optimization
G-Code Options Panel:
- Material settings (width, height, thickness)
- Machine settings (bed size, units)
- Cutting parameters (feed rate, spindle speed, depth, pass count)
- Path optimization options
- Tool selection and parameters
- Cutting mode selection (perimeter or punchout)
Tool Management Panel:
- Tool library browser
- Tool parameter editor
- Material-specific recommendations
- Tool validation and warnings
- Current operation status
- Time estimates
- File information
NWSS-CNC features a professional black and orange theme optimized for CNC work environments:
- High contrast for readability
- Reduced eye strain during long sessions
- Professional appearance
- Customizable via Qt stylesheets
- Paths (lines, curves, bezier curves)
- Basic shapes (rectangles, circles, ellipses)
- Text (converted to paths)
- Groups and layers
- Transformations (scale, rotate, translate)
NWSS-CNC automatically detects and removes empty margins from imported SVG files to ensure precise sizing:
- Content Bounds Detection: Analyzes all visible shapes to find the actual content boundaries
- Margin Removal: Creates a cropped SVG with content repositioned to eliminate empty space
- Precise Sizing: When resizing a design to 25x25mm, the actual cutting area is exactly 25x25mm
- Auto-scaling: Large designs are automatically scaled down to fit within 90% of material space
- Maintains Aspect Ratio: Scaling preserves original proportions and centers the design
This feature eliminates the common issue where imported SVGs contain unexpected margins, ensuring that what you see matches what gets cut.
- Parsing: NanoSVG library parses SVG structure
- Shape Extraction: Individual shapes are identified and cataloged
- Content Analysis: Actual content bounds are calculated, excluding empty margins
- Margin Processing: Empty space is removed and content is repositioned as needed
- Auto-scaling: Large designs are scaled to fit material bounds if necessary
- Path Discretization: Curves are converted to linear segments
- Optimization: Redundant points are removed
- Validation: Geometry is checked for manufacturing feasibility
The discretization process converts smooth curves into discrete points suitable for CNC machining:
- Automatically adjusts point density based on curve complexity
- Maintains accuracy while minimizing file size
- Configurable tolerance settings
- User-defined number of points per curve segment
- Predictable output for specific requirements
- Compatible with older CNC controllers
- Cuts along the outline of shapes
- Supports inside, outside, and on-path offsets
- Automatic tool compensation
- Lead-in/lead-out options
- Complete material removal through thickness
- Optimized for parts production
- Automatic tab generation (future feature)
- Nest optimization support
- ISO 6983 compliant G-code
- Customizable header and footer
- Tool change sequences
- Spindle control commands
- Safety height management
- Path ordering for minimum travel time
- Rapid move optimization
- Redundant move elimination
- Linear interpolation for straight segments
class SVGParser {
// Parses SVG files using NanoSVG
// Extracts shape information and dimensions
// Provides access to raw SVG data
}
class Discretizer {
// Converts bezier curves to linear segments
// Implements adaptive and fixed sampling
// Handles path simplification
}
class GCodeGenerator {
// Generates ISO-compliant G-code
// Handles tool changes and parameters
// Implements path optimization
}
class CAMProcessor {
// Professional CAM operations using Clipper2
// Polygon hierarchy analysis
// Advanced toolpath generation
}
struct Point2D {
double x, y;
// Basic 2D point with utility methods
}
class Path {
std::vector<Point2D> m_points;
// Represents a sequence of connected points
// Includes length calculation and simplification
}
class Polygon {
std::vector<Point2D> m_points;
// Closed polygon for area operations
// Point-in-polygon testing
// Area calculation
}
- SVG Loading: File is parsed and validated
- Shape Extraction: Individual elements are identified
- Discretization: Curves are converted to point sequences
- Transformation: Scaling and positioning applied
- CAM Processing: Toolpaths are generated based on operation type
- Optimization: Paths are optimized for efficiency
- G-Code Generation: Final machine code is produced
- Validation: Output is checked for errors
- Core processing runs on background threads
- UI remains responsive during long operations
- Memory-efficient processing of large files
- Optimized data structures for speed
Advanced features for optimal CAM workflow:
- Automatic Margin Detection: Smart content boundary analysis eliminates empty space
- Precision Sizing: Ensures cut dimensions exactly match specified sizes
- Auto-scaling: Large designs automatically scaled to fit material with aspect ratio preservation
- Content Optimization: SVG files are intelligently cropped and repositioned for optimal machining
The CAMProcessor implements sophisticated polygon analysis to handle complex nested shapes:
- Automatic hole detection
- Parent-child relationships
- Optimal machining sequence
- Island machining support
Advanced 2D polygon operations powered by Clipper2:
- Union operations for combining shapes
- Difference operations for hole creation
- Intersection for feature detection
- Offset operations for tool compensation
- Inside Offset: Tool center runs inside the path (for cutting out parts)
- Outside Offset: Tool center runs outside the path (for pockets)
- On Path: Tool center follows the exact path (for engraving)
- Auto: Automatically determined based on shape analysis
- Automatic corner rounding for inside corners
- Sharp corner handling for outside corners
- Collision detection and avoidance
- Minimum feature size validation
- Minimum spanning tree algorithms
- Nearest neighbor heuristics
- Custom optimization for specific machine characteristics
- Bezier curve fitting for smoother motion
- Acceleration-aware path planning
- Jerk minimization for better surface finish
- OpenGL-based 3D graphics
- Smooth camera controls
- Multiple view modes (isometric, top, side)
- Interactive navigation cube
- Level-of-detail (LOD) rendering
- Frustum culling
- Batch rendering for large toolpaths
- Frame rate limiting
- Color-coded rapid vs. cutting moves
- Tool representation
- Material boundaries
- Grid and measurement overlays
struct Tool {
int id; // Unique identifier
std::string name; // Tool description
ToolType type; // End mill, ball nose, V-bit, etc.
double diameter; // Tool diameter (mm)
double length; // Overall length
double fluteLength; // Cutting length
int fluteCount; // Number of flutes
ToolMaterial material; // HSS, Carbide, etc.
ToolCoating coating; // TiN, TiAlN, etc.
double maxDepthOfCut; // Maximum depth per pass
double maxFeedRate; // Maximum feed rate
double maxSpindleSpeed; // Maximum RPM
double minSpindleSpeed; // Minimum RPM
std::string notes; // Additional information
bool isActive; // Tool availability
};
- End Mills: General purpose cutting tools
- Ball Nose: 3D contouring and finishing
- V-Bits: Engraving and chamfering
- Drills: Hole making
- Router Bits: Wood and plastic cutting
- Engraving Bits: Fine detail work
- Custom: User-defined tools
The system automatically calculates optimal feed rates based on:
- Tool material and coating
- Workpiece material
- Tool diameter and geometry
- Spindle speed
- Depth of cut
Automatically determines optimal RPM considering:
- Tool material and diameter
- Workpiece material properties
- Surface finish requirements
- Tool manufacturer recommendations
- Checks if tool can physically machine the geometry
- Warns about features smaller than tool diameter
- Suggests alternative tools when appropriate
- Ensures feed rates are within tool limits
- Validates spindle speeds against tool specifications
- Checks depth of cut against tool capabilities
class CNConfig {
// Machine physical properties
double m_bedWidth; // CNC bed width
double m_bedHeight; // CNC bed height
MeasurementUnit m_units; // mm or inches
// Material properties
double m_materialWidth; // Workpiece width
double m_materialHeight; // Workpiece height
double m_materialThickness; // Material thickness
// Cutting parameters
double m_feedRate; // XY feed rate
double m_plungeRate; // Z feed rate
int m_spindleSpeed; // Spindle RPM
double m_cutDepth; // Depth per pass
int m_passCount; // Number of passes
double m_safeHeight; // Safe travel height
};
struct DiscretizerConfig {
int bezierSamples; // Points per curve segment
double simplifyTolerance; // Path simplification threshold
double adaptiveSampling; // Adaptive sampling tolerance
double maxPointDistance; // Maximum point spacing
};
struct GCodeOptions {
bool includeComments; // Add descriptive comments
bool useInches; // Output in inches vs. mm
bool includeHeader; // Generate file header
bool optimizePaths; // Optimize path order
bool linearizePaths; // Combine straight segments
bool enableToolOffsets; // Apply tool compensation
CutoutMode cutoutMode; // Cutting operation type
double stepover; // Area cutting stepover
bool spiralIn; // Spiral cutting direction
};
Configuration files use INI format with sections:
[Machine]
BedWidth=300.0
BedHeight=200.0
Units=mm
[Material]
Width=100.0
Height=100.0
Thickness=3.0
[Cutting]
FeedRate=1000.0
PlungeRate=300.0
SpindleSpeed=12000
Problem: SVG file won't load or appears corrupted Solutions:
- Verify SVG file is valid XML
- Check for unsupported SVG features
- Try re-saving from original design software
- Use SVG optimization tools to clean up the file
Problem: Missing shapes or incorrect scaling Solutions:
- Check SVG viewBox and dimensions
- Verify units are consistent
- Use "Fit to View" in the designer
- Check for invisible layers or groups
Problem: Empty or invalid G-code output Solutions:
- Verify paths are properly closed
- Check material and bed size settings
- Ensure tool is selected and valid
- Review cutting parameters for sanity
Problem: Toolpaths appear incorrect in 3D view Solutions:
- Check tool offset settings
- Verify cutting mode selection
- Review stepover and overlap settings
- Check for self-intersecting geometry
Problem: Slow processing or UI lag Solutions:
- Reduce SVG complexity
- Lower discretization quality temporarily
- Close unnecessary applications
- Increase system RAM if possible
Problem: 3D viewer is slow or unresponsive Solutions:
- Update graphics drivers
- Reduce toolpath complexity
- Enable performance optimizations
- Use lower level of detail
This warning indicates that the selected tool cannot machine all features in the design. Consider:
- Using a smaller tool
- Modifying the design to accommodate the tool
- Using multiple tools for different features
Check that:
- Feed rates are within reasonable limits
- Spindle speed is appropriate for the tool
- Depth of cut doesn't exceed tool capabilities
- Material properties are correctly specified
The input geometry has overlapping or self-intersecting paths:
- Simplify the design
- Fix overlapping shapes in the original software
- Use the built-in geometry repair tools
- CMake 3.16 or later
- Qt6 (Core, Widgets, OpenGL, SVG components)
- C++17 compatible compiler
- Git for source code management
# Clone repository
git clone https://github.com/nwss/nwss-cnc.git
cd nwss-cnc
# Create build directory
mkdir build && cd build
# Configure with CMake
cmake ..
# Build
make -j4 # Linux/macOS
# or
cmake --build . --config Release # Windows
nwss-cnc/
├── include/
│ ├── core/ # Core processing classes
│ └── gui/ # User interface classes
├── src/
│ ├── core/ # Core implementation
│ ├── gui/ # GUI implementation
│ └── main.cpp # Application entry point
├── resources/ # Icons, fonts, themes
├── third_party/ # External libraries
├── example_files/ # Sample SVG files
└── docs/ # Documentation and images
To add new CAM operations:
- Extend the
CutoutMode
enum ingeometry.h
- Implement the algorithm in
CAMProcessor
- Add UI controls in
GCodeOptionsPanel
- Update the G-code generator
To add new GUI features:
- Create new Qt widgets in
include/gui/
- Implement in
src/gui/
- Integrate with
MainWindow
- Add to menu system and toolbars
To add new tool types:
- Extend the
ToolType
enum intool.h
- Update parameter calculation methods
- Add UI support in tool manager
- Update validation logic
G0
: Rapid positioning (non-cutting moves)G1
: Linear interpolation (cutting moves)G2/G3
: Circular interpolation (arcs)G17
: XY plane selectionG20/G21
: Inch/Metric unitsG90/G91
: Absolute/Incremental positioningG94
: Feed rate per minute mode
M3/M4
: Spindle start (clockwise/counterclockwise)M5
: Spindle stopM8/M9
: Coolant on/offM30
: Program end and return
- Paths with line, curve, and arc segments
- Basic shapes (rect, circle, ellipse, polygon)
- Groups and transformations
- Stroke properties
- Units and viewBox
- Text (converted to paths)
- Complex gradients (ignored)
- Filters and effects (ignored)
- Animations (ignored)
- Raster images
- Complex CSS styling
- JavaScript interactions
- External references
JSON format for tool library storage:
{
"tools": [
{
"id": 1,
"name": "1/8\" End Mill",
"type": "END_MILL",
"diameter": 3.175,
"material": "CARBIDE",
"maxFeedRate": 2000.0,
"maxSpindleSpeed": 18000
}
]
}
Ctrl+N
: New fileCtrl+O
: Open fileCtrl+S
: Save fileCtrl+Shift+S
: Save asCtrl+Q
: Quit application
Ctrl+A
: Select allDelete
: Delete selectedCtrl+Z
: UndoCtrl+Y
: RedoCtrl++
: Zoom inCtrl+-
: Zoom outCtrl+0
: Reset zoom
- Mouse drag: Rotate view
Shift+drag
: Pan view- Mouse wheel: Zoom
R
: Reset viewF
: Fit to view
- Always verify G-code before running on actual machine
- Check tool paths don't exceed material boundaries
- Verify safe height settings
- Use appropriate feeds and speeds for material
- Regularly backup tool databases and configurations
- Keep software updated
- Verify calculations with independent tools
- Test with scrap material first
NWSS-CNC represents a comprehensive solution for 2D CAM operations, combining professional-grade algorithms with an intuitive user interface. The software's modular architecture and extensive feature set make it suitable for both hobby and professional applications.
The application's commitment to open standards, cross-platform compatibility, and extensible design ensures it can adapt to evolving manufacturing needs while maintaining compatibility with existing workflows.
For additional support, contact me personally at [email protected], or open an issue here and I will get back to you as soon as possible.
This document serves as both a user guide and technical reference for NWSS-CNC version 1.0.0.