Home

Woodcutting

Online Cutting

Introduction

Library Usage

Products

Download

Purchase

Links

Awards

Contacts

How to cut wood panels using GNCutter32.dll

GNCutter32 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:
GNCutter32.CutEngine Calculator = new GNCutter32.CutEngine()

All examples use the following abbreviations:
w - width of the part or sheet;
h - height (length) of the part of sheet;
X - coordinate along X-axis;
Y - coordinate along Y-axis;
SheetNo - number (index) of the sheet.



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
Calculator.AddSheet(100, 110); // Specify one sheet
Calculator.AddPart(30, 20); // Add the first part
Calculator.AddPart(40, 30); // Add second part
Calculator.GuillotineSheetSimple(); // Perform the calculation

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;
double X1,Y1,X2,Y2;
// Get guillotine cuts for all sheets that have been cut
for (int SheetNo = 0; SheetNo < Calculator.UsedSheetCount; SheetNo++)
{

  // Get number of cuts for the specified sheet
  CutsCount = Calculator.GetSheetCutCount(SheetNo);
  for (int Iter = 0; Iter < CutsCount; Iter++)
  {

    // Each cut is defined by start point (X1,Y1) and end point (X2,Y2).
    Calculator.GetSheetCut(SheetNo, Iter, out X1, out Y1, out X2, out Y2);
  }
}

Two parts simple cutting
Pic. 1. Two parts simple cutting.

Result cuts:
Cut # SheetNo X1 Y1 X2 Y2
0 0 0 30 100 30
1 0 40 0 40 30
2 0 60 0 60 30

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;
double W,H,X,Y;
bool Rotated;
for (int iPart = 0; iPart < Calculator.PartCount; iPart++)
{

  // Get sizes and location of the source part with index iPart
   Calculator.GetResultPart(iPart, out SheetNo, out W, out H, out X, out Y, out Rotated);
}

Result parts location:
Part # SheetNo X Y Height Width Rotated
0 0 40 0 20 30 Yes
1 0 0 0 30 40 No

The first part with (w=30, h=20) was rotated and it was placed after the second part at X=40 and Y=0.

Top


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
Calculator.AddSheet(100, 110, 10); // Add 10 sheets
for (int Iter = 0; Iter < 10; Iter++)
{
   Calculator.AddPart(30, 20);
// Add the first part
   Calculator.Calculator.AddPart(40, 30); // Add the second part
}
Calculator.GuillotineSheetSimple();
// Perform the calculation

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:
Cut # SheetNo X1 Y1 X2 Y2
0 0 0 30 100 30
1 0 0 60 100 60
2 0 0 90 100 90
3 0 40 0 40 30
4 0 80 0 80 30
5 0 40 30 40 60
6 0 80 30 80 60
7 0 40 60 40 90
8 0 80 60 80 90
9 0 30 90 30 110
10 0 60 90 60 110
11 0 90 90 90 110
12 1 0 30 100 30
13 1 0 60 100 60
14 1 0 80 100 80
15 1 40 0 40 30
16 1 80 0 80 30
17 1 40 30 40 60
18 1 80 30 80 60
19 1 30 60 30 80
20 1 60 60 60 80

First sheet with one cut-off   Second sheet with two cut-offs
Pic. 2. Two sheets simple cutting with cut-offs.

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;
double W,H,X,Y;
for (int Iter = 0; Iter < Calculator.RemainingPartCount; Iter++)
{

  // Get sizes and location of the remaining part (cut-off) with index Iter
  Calculator.GetRemainingPart(Iter, out SheetNo, out W, out H, out X, out Y);
}

For the example we got three cut-offs after all parts were cut.

Result cut-offs (remaining parts):
Cut-off # SheetNo X Y Height Width
0 0 90 90 20 10
1 1 60 60 20 40
2 1 0 80 30 100

Top


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
Calculator.AddSheet(100, 110, 10); // Add 10 sheets
Calculator.AddPart(20, 15); // Add the first part
...
Calculator.AddPart(12, 27); // Add the last part

Now we're ready to use the different cutting types and display the result for each of the type:

XY-cut

First sheet with simple XY-cuts   Second sheet with simple XY-cuts
Pic. 3. Two sheets simple XY-cutting.

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.

Top


Two-Stage XY-cut

First sheet with simple two-stage XY-cuts   Second sheet with simple two-stage  XY-cuts
Pic. 4. Two sheets simple two-stage XY-cutting.

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.

Top


XYZ-cut

First sheet with XYZ-cuts   Second sheet with XYZ-cuts
Pic. 5. Two sheets XYZ-cutting.

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.

Top


XYZW-cut

All parts are cut from one sheet with XYZW-cuts
Pic. 6. One sheets XYZW-cutting.

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.

Top


Standard cut

All parts are cut from one sheet with standard guillotine cutting
Pic. 7. One sheet standard guillotine cutting.

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.

Top


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
Calculator.AddSheet(20, 30, 10); // Add 10 sheets
Calculator.AddPart(2, 5); // Add the first part
...
Calculator.AddPart(3, 7); // Add the last part

First perform the calculation without saw thickness:
Calculator.GuillotineSheet_Z(); // Perform XYZ-cut calculation
Result layout is shown on the picture 10a.

Now specify the saw thickness:
Calculator.SawWidth = 0.5; // Set the saw thickness (width) as 0.5
Calculator.GuillotineSheet_Z(); // Perform XYZ-cut calculation
Result layout is shown on the picture 10b.

XYZ-cuts without saw thickness            XYZ-cuts with taking in account saw thickness
Pic. 10a. Saw thickness = 0.    Pic. 10b. Saw thickness = 0.5

Top


Sheet trimming.

Sheet trimming can be easily implemented in the library by the following code:

Calculator.Clear(); // Clear the previous settings and results
Calculator.AddSheet(20, 30, 10); // Add 10 sheets
Calculator.AddPart(2, 5); // Add the first part
...
Calculator.AddPart(3, 7); // Add the last part

Lets now define the trim size from all sides of the sheet:
Calculator.TrimTop = 1; // Trim size at the top of the sheet
Calculator.TrimLeft = 2; // Trim size at the left sheet side
Calculator.TrimBottom = 2; // Trim size at the sheet bottom
Calculator.TrimRight = 1; // Trim size at the right sheet side

Calculator.GuillotineSheet_ZW(); // Perform XYZW-cut calculation

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;
double X1,Y1,X2,Y2;
// Get guillotine cuts for all sheets that have been cut
for (int SheetNo = 0; SheetNo < Calculator.UsedSheetCount; SheetNo++)
{

  // Get number of pre-cuts for the specified sheet
  CutsCount = Calculator.GetSheetTrimCutCount(SheetNo);
  for (int Iter = 0; Iter < CutsCount; Iter++)
  {

    // Each cut is defined by start point (X1,Y1) and end point (X2,Y2).
    Calculator.GetSheetTrimCut(SheetNo, Iter, out X1, out Y1, out X2, out Y2);
  }
}

Sheet trimming. Trim areas are grey - coloured
Pic. 11. Sheet trimming. Trim areas are grey - coloured

Top


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.
The following example shows how to use two sheets with sizes 15x15 and 20x20:

Calculator.Clear(); // Clear the previous settings and results
Calculator.AddPart(2, 5); // Add the first part
...
Calculator.AddPart(3, 7); // Add the last part

Now we can add the sheet sizes:
Calculator.AddSheet(15, 15); // Specify the first sheet
Calculator.AddSheet(20, 20); // Specify the second sheet

Calculator.GuillotineSheet_ZW(); // Perform XYZW-cut calculation

First sheet 15 by 15   Second sheet 20 by 20
Pic. 12. Two-sheet layout with different sheet sizes.

Top


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
Calculator.AddSheet(2000, 2000, 20); // Add 20 sheets
// Add parts
Calculator.AddPart(650, 550, 22);
Calculator.AddPart(650, 732, 26);
Calculator.AddPart(500, 430, 24);
Calculator.AddPart(163, 422, 32);
Calculator.AddPart(444, 363, 30);
Calculator.AddPart(104, 362, 32);
Calculator.AddPart(640, 200, 32);
Calculator.UseLayoutMinimization = true; // Specify layout minimization
Calculator.GuillotineSheet(); // Perform the standard calculation

Now we can get information about how many different layouts have been generated and get information about each layout.
int SheetNo, SheetCount;
// Get the number of layouts
int Count = Calculator.LayoutCount;
for (int Iter = 0; Iter < Count; Iter++)
{
// Get the first sheet in the layout (SheetNo) and
// count of the following sheets that share the layout of SheetNo.
Calculator.GetLayoutInfo(Iter, out int SheetNo, out int SheetCount);
}

For the example we got the following layouts:
Layout # SheetNo Count Comments
0 0 1   Sheets 0 has unique layout
1 1 10   Sheets 1-10 have the same layout and can be cut at the same time
2 11 1   Unique layout cut from sheet 11

Layout minimization example

Pic. 13. 10 sheets with the same layout (left).
Two sheets have unique layouts shown on the right.

Top


 

Copyright © 2004-2013 Optimalon Software Ltd. All rights reserved.