SetPart
Name
SetPart
When to use it
After setting the NumberOfParts property and anytime before the starting the optimization.
Prototype
SetPart(
Index: long /*[in]*/,
Type: long/*[in]*/,
NumberOfVertices: long/*[in]*/,
CenterX: double/*[in]*/,
CenterY: double/*[in]*/,
Radius : double/*[in]*/,
NumberOfHoles: long/*[in]*/,
RotationStep: double/*[in]*/,
RotationCenterX: double/*[in]*/,
RotationCenterY: double/*[in]*/,
AllowMirroring: long/*[in]*/,
Priority: long /*[in]*/,
UserDefinedData: long /*[in]*/
);
Explanation
With this method you may set the dimensions of each piece to be cut.
The number of pieces to be cut is given by the NumberOfParts property.
The dimensions of each piece can be get using the GetPart method.
Parameters
Index - the index of the piece whose information are set. This number is in range [0...NumberOfParts - 1].
Type: 0 for polygons and 1 for circles.
NumberOfVertices - number of vertices of the polygon. The vertices must be given in the counter-clock way using SetPartVertex method.
CenterX, CenterY: center of the circle (has meaning only if Type is 1).
Radius : radius of the circle.
NumberOfHoles: number of holes in the part.
RotationStep - The step with which the piece may be rotated for a better fit. Smaller steps are better but it can take a longer time. Rotation is given in degrees (between 0 and 360).
RotationCenterX, RotationCenterY - the rotation point around which the rotation is made. This parameter is ignored if RotationCenter is greater than 0.
AllowMirroring - specify if the piece can be rotated on a different face (1 if yes, 0 if not). Mirroring is performed by using Oy as reference (that is x = 10 becomes x = -10).
Priority - The priority for cutting a piece. 0 is the highest priority. Pieces with a higher priority are nested before pieces with a lower priority.
UserDefinedData- an user defined value. For instance it can hold the row index where the part is stored in a grid. Or, it can store a pointer to some user defined structure.
Next to call
SetPartVertex, SetPartArc, SetPartHole, SetPartHoleVertex, SetPartHoleArc.
See also
NumberOfParts, GetPart, RotationCenter, SetPartVertex, SetPartArc, SetPartHole, SetPartHoleVertex.