![]() |
![]() |
![]() |
![]() |
|
Library Usage |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
How to cut wood panels using GNCutter32.dllGNCutter32 provides simple and intuitive application programming interface (API). The basic operation is to create an instance of the CutEngine and call its methods to perform all necessary calculations. All objects in the library (Parts, Sheets, Cut-offs and Cuts) are zero-base indexed, which means if there are 10 parts then first has index 0 and the last is 9.
The following examples demonstrate how to solve different optimization tasks using GNCutter32.
All examples are written on C# language, but they're so simple and obvious that knowledge of C# is not mandatory.
First we have to create an instance of the library engine to perform all cutting calculations:
All examples use the following abbreviations:
Two parts simple cutting.There are two parts (w=30, h=20) and (w=40, h=30) and one sheet (w=100, h=110). We need to find out how to cut these parts from the sheet. The following code does it:
Calculator.Clear(); // Clear the previous settings and results At this point the calculation is done and we need to get results. More specifically we need to know how many and where cuts should be done. It's done by the following code:
int SheetNo,CutsCount;
Result cuts:
During the calculation the source parts get moved and sometime rotated, therefore we need to know the new coordinates of the parts and their rotation status. The following code can be used for this purpose:
int SheetNo,ResIndex; Result parts location:
The first part with (w=30, h=20) was rotated and it was placed after the second part at X=40 and Y=0. Two sheets simple cutting with cut-offs.There are ten parts with w=30, h=20 and ten parts with w=40, h=30 and one sheet size w=100, h=110. We need to find out how many sheets are required to cut these parts, part cuts and the size of the cut-offs (remaining parts). The following code does it:
Calculator.Clear(); // Clear the previous settings and results After the calculation is done we need to get results: First we would like to know how many sheets are needed to cut all parts. There is the property to get this info: Calculator.SheetCount, that is 2 in our example. Hence we need two sheets. Then we need to get the sequence of the part cuttings. As in the previous example it's done by two methods Calculator.GetGuillotineCutsCount to get the total number of cuts and Calculator.GetGuillotineCut to get each individual cut. Result cuts:
Third task is to get the list of all cut-offs (remaining parts) after the sheets were cut. It's done using the following code:
int SheetNo; For the example we got three cut-offs after all parts were cut. Result cut-offs (remaining parts):
Types cutting comparison.This example demonstrates how the different cut types perform for the same task. At the begging the following code initializes the list of parts and sizes of the sheet:
Calculator.Clear(); // Clear the previous settings and results Now we're ready to use the different cutting types and display the result for each of the type:
Calculator.GuillotineSheetSimple(); // Perform the simple XY-cut calculation The calculation produces the layout shown on the picture 3. This type requires two sheets to cut all parts.
Calculator.GuillotineSheetTwoStage(); // Perform the simple Two-stage XY-cut The calculation produces the layout shown on the picture 4. This type requires two sheets to cut all parts. This type produces better results than previous one because it has bigger utilization rate and it leaves bigger cut-off part on the second sheet.
Calculator.GuillotineSheet_Z(); // Perform the XYZ-cut calculation The calculation produces the layout shown on the picture 5. This type requires two sheets to cut all parts. This type produces almost the same quality results than previous one. The only improvement is the size of the cut-offs from the first sheet is bigger.
Calculator.GuillotineSheet_ZW(); // Perform the XYZW-cut calculation The calculation produces the layout shown on the picture 6. This type requires only one sheet to cut all parts, which can be considered as a very good improvement. However the improvement has reached by increasing the complexity of the cuts and not all the cutting machines can use this cut type.
Calculator.GuillotineSheet(); // Perform the standard guillotine cut calculation The calculation produces the layout shown on the picture 7. This type requires only one sheet to cut all parts and it produces the best layout among others and it's not surprising the layout is the most difficult to cut using the machines. This type of cutting can be used only for expensive materials when the objective is to reduce the waste as much as possible and complexity doesn't play an important role. Saw thickness (part-to-part gap).When the saw thickness cannot be neglected or higher degree of accuracy is required then GNCutter32 provides an easy way to account for such situation. Lets initialize the sample: Initialize the sample:
Calculator.Clear(); // Clear the previous settings and results
First perform the calculation without saw thickness:
Now specify the saw thickness:
Sheet trimming.Sheet trimming can be easily implemented in the library by the following code:
Calculator.Clear(); // Clear the previous settings and results
Lets now define the trim size from all sides of the sheet: At this point the calculation is done and we need to get results. More specifically we need to know how many and where trim cuts should be done. It's done by the following code:
int SheetNo,CutsCount;
Using different sheet sizes.
GNCutter32 supports the sheets with different sizes. It tries to use as fewer sheets as possible to cut
all parts with maximum utilization.
Calculator.Clear(); // Clear the previous settings and results
Now we can add the sheet sizes:
Layouts Minimization.The library GNCutter32 provides the functionality to minimize the number of the different layouts during the calculations. This is very important for wood cutting because the sheets with the same layout can be cut at once and hence the productivity can be increased dramatically.
Calculator.Clear(); // Clear the previous settings and results
Now we can get information about how many different layouts have been generated and get information about each layout. For the example we got the following layouts:
Pic. 13. 10 sheets with the same layout (left). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Copyright © 2004-2013 Optimalon Software Ltd. All rights reserved.