Skip to content

Latest commit

Β 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

nc-helper-go

Go Version Code Style: Google .NET Version Tekla API FOSSA Status

πŸ› οΈ Description

This project provides a comprehensive suite of utilities designed to automate the creation, transformation, and conversion of files for CNC machines. It streamlines the workflow from engineering designs to machine-ready programs, particularly focusing on the crucial step of converting Tekla Structures (NC1) files into DXF, and subsequently into various CNC machine formats (.txt, .g, .nc, .cnc, .tap, .wkf, etc.). The utilities also facilitate the adjustment of files for specific CNC machines, including those from Hypertherm, ensuring optimal compatibility and performance. Furthermore, it supports integration with nesting software like Pronest for optimized material utilization. Our tools ensure precision, reduce manual effort, and enhance compatibility across diverse CNC controllers and equipment.

This project provides two main utilities for engineering file processing:

  • wkf-rotator.exe β€” Rotate WKF files by 90, 180, or 270 degrees using a graphical window.
  • wkf-creator.exe β€” Convert DXF (AutoCAD) files to WKF format (supports only LINE and CIRCLE entities).
  • pronest-helper.exe β€” Utility for adjusting NC files for specific Hypertherm post-processors (e.g., MicroEdge Pro).
  • Convert_DSTV2DXF.dll β€” Example of converting Tekla Structures DSTV files to DXF.

🎯 Purpose

nc-helper-go is designed to assist engineers, technologists, and CNC operators in preparing, converting, and post-processing files for CNC equipment. The toolkit supports workflows for:

  • Converting engineering drawings (DXF, DSTV, etc.) to machine-ready formats (WKF, DXF, etc.)
  • Rotating, normalizing, and validating geometry for compatibility with specific CNC controllers
  • Batch processing and integration with Windows context menu for fast file operations
  • Supporting both simple (rectangular) and complex (arbitrary polygonal) part geometries

✨ Features

  • DXF to WKF conversion with correct home calculation and contour ordering
  • WKF rotation with GUI angle selection and home-aware transformation
  • DSTV (NC1) to DXF conversion using Tekla DSTV2DXF integration
  • Context menu integration for one-click file processing in Windows Explorer
  • Support for both metric and imperial workflows
  • Extensible architecture for adding new file formats and CNC post-processors

πŸ’‘ Typical Use Cases

  • Sheet metal, plate, and profile cutting
  • Automated preparation of drilling, milling, and punching programs
  • Rapid conversion of engineering drawings to CNC-ready files
  • Batch conversion and rotation of part files for different machine setups

πŸ“ Project Structure

nc-helper-go/
β”œβ”€ cmd/
β”‚   β”œβ”€ wkf-rotator/      # main.go for WKF rotation
β”‚   └─ wkf-creator/      # main.go for DXF β†’ WKF
β”œβ”€ internal/
β”‚   β”œβ”€ wkf/              # rotate.go β€” functions for coordinate rotation
β”‚   └─ dxf/              # parse.go β€” functions for DXF parsing
β”œβ”€ bin/                  # Third-party tools (e.g., Tekla DSTV2DXF)
β”œβ”€ post/                 # Archives with Postprocessors for specific CNC models
β”œβ”€ abstract/             # Mathematical and formal algorithm descriptions
β”œβ”€ Makefile              # build commands
β”œβ”€ go.mod                # Go dependencies

βš™οΈ Build Instructions

  1. Install Go 1.18+ (https://golang.org/dl/)
  2. Install dependencies:
    make install
  3. Build the desired utility:
    • For DXF β†’ WKF:
      make dxf2wkf
    • For WKF rotation:
      make rotate-wkf

This will produce wkf-creator.exe and wkf-rotator.exe in the project root.

πŸš€ Usage

wkf-rotator.exe

  • Run the exe with the path to a WKF file as an argument.
  • A window will prompt for the rotation angle (90, 180, 270).
  • A new file with the suffix _90DEG.wkf, _180DEG.wkf, or _270DEG.wkf will be created in the same folder.

wkf-creator.exe

  • Run the exe with the path to a DXF file as an argument.
  • A .wkf file will be created in the same folder.

πŸ–±οΈ Integration with Windows Context Menu

For WKF Rotation

  1. Create a wkf-rotate.bat file:
    @echo off
    start "" "%~dp0wkf-rotator.exe" "%~1"
  2. Create a reg file (e.g., ctx-cmd-rotator.reg):
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\SystemFileAssociations\.wkf\shell\ΠŸΠΎΠ²Π΅Ρ€Π½ΡƒΡ‚ΡŒ WKF]
    @="ΠŸΠΎΠ²Π΅Ρ€Π½ΡƒΡ‚ΡŒ WKF"
    "Icon"="%SystemRoot%\\System32\\imageres.dll,194"
    
    [HKEY_CLASSES_ROOT\SystemFileAssociations\.wkf\shell\ΠŸΠΎΠ²Π΅Ρ€Π½ΡƒΡ‚ΡŒ WKF\command]
    @="\"D:\\wkf-rotate.bat\" \"%1\""
    • Specify the absolute path to your wkf-rotate.bat.
  3. Save the reg file in UTF-16 LE encoding and apply it by double-clicking.

For Creating WKF from DXF

  1. Create a dxf2wkf.bat file:
    @echo off
    start "" "%~dp0wkf-creator.exe" "%~1"
  2. Create a reg file (e.g., ctx-cmd-creator.reg):
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\SystemFileAssociations\.dxf\shell\Π‘ΠΎΠ·Π΄Π°Ρ‚ΡŒ WKF]
    @="Π‘ΠΎΠ·Π΄Π°Ρ‚ΡŒ WKF"
    "Icon"="C:\\Windows\\System32\\imageres.dll,226"
    
    [HKEY_CLASSES_ROOT\SystemFileAssociations\.dxf\shell\Π‘ΠΎΠ·Π΄Π°Ρ‚ΡŒ WKF\command]
    @="\"D:\\dxf2wkf.bat\" \"%1\""
    • Specify the absolute path to your dxf2wkf.bat.
  3. Save the reg file in UTF-16 LE encoding and apply it by double-clicking.

πŸ“ Notes

  • For correct reg file operation, use absolute paths and UTF-16 LE encoding.
  • For hidden execution, use a PowerShell or VBS wrapper (see discussion above).
  • To remove a menu item, delete the corresponding registry keys.

πŸ“„ License

This project is licensed under the MIT License.


nc-helper-go streamlines the path from engineering drawing to CNC machine, reducing manual work and minimizing errors in file preparation for a wide range of controllers and equipment.

About

A set of utilities for automated creation and transformation of files for CNC machines operating on various controllers

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages