Hide menu
Loading...
Searching...
No Matches
Nesting Process

Overview

In manufacturing, the nesting process arranges patterns on flat materials, such as sheet metal, glass, wood, or plastic, to maximize material usage and minimize waste. This approach is widely used to reduce scrap and costs by creating efficient layouts on large sheets. The process uses a genetic algorithm to explore and optimize various layout possibilities, selecting configurations of patterns on sheet that minimize material usage and maximize space efficiency. The output of this process is Nesting_Data, representing the optimized patterns arrangement.

Scope of Accepted Geometries

The Nesting process works with 2d drawings without bending lines.

API Overview

The main class to start the nesting process is Nesting_Computer, responsible for calculating layouts based on specified parameters and material properties. In general, each material is represented as a rectangle defined by width and heights. If there isn't enough space on one material, the algorithm will search for space on other available materials.

Each pattern to be nested is added to the computer as a Drawing::View .

Once the parameters, materials, and patterns are defined, call the Nesting_Computer.Perform() method to generate Nesting_Data, a optimal arrangement of patterns across the materials. This Nesting_Data can be converted into a Drawing::Drawing for further processing. See Nesting Example.

The example of starting the nesting process is provided below:

using namespace cadex;
// Creating a Nesting_Computer instance
Nesting_Computer aComputer;
// Configuring nesting parameters
aParams.SetIterationCount(10); // Number of iterations for optimization; higher values improve results.
aParams.SetGenerationSize(10); // Initial count of random patterns; larger values may improve optimization.
aComputer.SetParameters(aParams);
// Define material size and quantity (e.g., 5 sheets of 100x100 mm)
aComputer.AddMaterial(100.0, 100.0, 5);
// Loading 3 patterns into the computer
Drawing::View aPattern = ...
aComputer.AddPattern(aPattern, 3);
// Start the Nesting process
Nesting_Data aData = aComputer.Perform();
// Convert nesting data to drawings
Drawing::Drawing aDrawing = aData.ToDrawing();
Represents a single 2D drawing of a model.
Definition Drawing.hxx:32
Represents a view on a drawing sheet.
Definition View.hxx:38
The nesting analyzing tool.
Definition Nesting_Computer.hxx:41
void AddMaterial(double theLength, double theWidth, size_t theQuantity)
Definition Nesting_Computer.cxx:87
Nesting_Data Perform(const cadex::ProgressStatus &theProgressStatus=cadex::ProgressStatus())
Definition Nesting_Computer.cxx:127
Defines parameters used in nesting process.
Definition Nesting_ComputerParameters.hxx:34
void SetIterationCount(size_t theIterationCount)
Definition Nesting_ComputerParameters.cxx:76
void SetGenerationSize(size_t theGenerationSize)
Definition Nesting_ComputerParameters.cxx:98
Contains information about nesting sheets.
Definition Nesting_Data.hxx:39
Drawing::Drawing ToDrawing() const
Definition Nesting_Data.cxx:80
Contains classes, namespaces, enums, types, and global functions related to Manufacturing Toolkit.
Definition LicenseManager_LicenseError.hxx:30

The image below shows a possible result generated with the defult configurations:

Draft Nesting Result