NEXACut Pro: A standalone application for automating and optimizing the CAM process on 3-axis CNC routers
- Standalone cross-platform application
- CNC stock is stored in SVG format, ensuring compatibility and easy integration
- Use of OpenCV facilitates the addition of previously used stock materials, streamlining workflow efficiency
- New part files are seamlessly converted from STL to SVG format
- Part placement optimization is achieved through a genetic nesting algorithm, minimizing wasted material and maximizing production efficiency.
- Integration with the Fusion 360 API enables full automation of CNC workflows
SVG is the format of choice for performing optimization calculations since it is universally supported, is relatively straightforward to convert both CAD and image files into, and is highly compatible with the NFP algorithm (see 'Optimization Algorithm').
The conversion process for CAD files follows a straightforward approach. Initially, it receives an STL file consisting of a list of facets with their respective points. The process identifies the axis with the fewest unique coordinates, assuming the CAD files are flat and parallel to a coordinate axis. It then 'flattens' the file by filtering out facets lying directly on the target plane, discarding unnecessary geometric data. Outside edges are then filtered out based on the fact that they, by definition, only belong to one facet.
The image conversion process consists of four key stages, achieved via the OpenCV image processing library in Python. Initially, the raw image undergoes resizing and binary conversion via thresholding. Then, additional filtering is applied to reduce noise and refine the binary representation.
Next, a feature detection algorithm is used to determine the key features of the image, including corners and edges. Although I attempted using OpenCV's default corner detection method, it proved cumbersome for the task, leading to the creation of a custom method which leverages dot product computations to evaluate changes in angles between points.
Once features are detected, the image is 'flattened' and resized to appropriate dimensions. This image is then converted to SVG format and can be used in the optimization algorithm.
Intuitive digitization of CNC stock allows for easily viewing available plates without wasting valuable production time. Each plate file within the stock is characterized by its material type and dimensions along with an optional SVG file. Stock files consist of a list of plates and are used during optimization calculations.
The optimization algorithm utilizes the concept of the no-fit polygon (NFP). Essentially, an NFP is the union of the area created by a polygon (A) and all possible positions of a polygon (B) around it. Random placements consisting of parts placed on possible NFP locations of existing plates in order of decreasing size are fed through a genetic algorithm, which filters out better placements based on the amount of wasted material and returns the heuristic ideal.