Setting the coding parameters in cam.conf
The parameters for coding with the smart coding option can be set in the cam.conf file which is located in the project norms.
The cam.conf file included in the default norms contains the smart coding parameters with their default values. The parameters can be copied to the project's cam.conf file from the default norms and the values adjusted as desired.
General optimization settings
The parameters on the first two setting lines for the smart coding define how many calculation iterations the smart coding script performs (accuracy), and the step size for resizing text (nStepsTextResizing). The default values are 20 (iterations) and 2 (step size).
accuracy 20
nStepsTextResizing 2
Settings for markings and texts
The following can be set for the different marking and text types on the coded part (DXF).
-
Importance – Sets the priority for the different markings and texts. The smart coding algorithm places the marking and text types with higher importance in more prominent or "better" positions on the coded part.
-
Arrangement – Affects the size and position of the markings and texts on the coded part.
These settings are defned after the general optimization settings in the cam.conf file.
Marking and text types
The markings and text types for which settings can be defined are as follows:
-
Text along marking line (text_along_line)
-
Extra length marking (extra_length)
-
Bevel text (bevel_text)
-
Bevel model (bevel_model)
-
Part text (part_text)
-
Description text (description)
-
Reference marking (reference_marking)
-
Angle text (angle_text)
-
Bevel code (bevel_code)
Importance of different types of markings and texts
One group of setting lines in cam.conf defines the parameters for the importance (priority) of the different marking and text types. The more important the marking or text type is, the more prominent or 'better' placement it will get on the coded part.
The importance is defined as as a positive integer value. Possible values are 1, 2 and 3. A smaller value means a higher importance. Different text types may have the same importance.
Syntax:
<marking or text type>_importance <value>
txt_along_line_importance 2
extra_length_importance 2
bevel_text_importance 2
bevel_model_importance 3
part_txt_importance 1
description_importance 3
angle_marking_importance 2
reference_marking_importance 2
bevel_code_importance 1
Arrangement settings for markings and texts
After the importance settings in cam.conf, there are 9 groups of setting lines which control the arrangement of the different marking and text types. There are 9 similar (but not identical) setting lines for all of the marking and text types.
First setting line in the setting group
The first setting line for each marking and text type contains 11 parameters. For example:
txt_along_line
|
1
|
0
|
1
|
0
|
1
|
0
|
no
|
0.5
|
1.0
|
3.0
|
0.2
|
| Parameter # | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
The first 6 parameters are as follows:
|
# |
Parameter (used internally) |
Description |
Possible values |
Remarks |
|---|---|---|---|---|
| 1 | mayChangePlace | May the text change place | Boolean 0 or 1 (false or true) | |
| 2 | mayBeRotated | May the text be rotated | Boolean 0 or 1 (false or true) | If set to 0, disables the ability for the text to rotate. If the text runs along a curve, it will maintain its current orientation relative to the slope of the curve. When set to 1, the text might tilt or rotate to match the curve's angle. |
| 3 | mayTextSizeBeChanged | May text size be changed | Boolean 0 or 1 (false or true) | |
| 4 | mayTextRatioBeChanged | May text ratio be changed | Boolean 0 or 1 (false or true) | height/width ratio |
| 5 | isRelatedToMarkLine | Is the text along a curve | Boolean 0 or 1 (false or true) | |
| 6 | isRelatedToCountour | Is the text on a contour | Boolean 0 or 1 (false or true) |
The 7th parameter is the preferred position of the text on the coded part. The following table shows the possible values for the 7th parameter, and the area on the coded part each value places the marking or text.
| leftUpperCorner | middleTop | rightUpperCorner |
| leftMiddle | center | rightMiddle |
| leftLowerCorner | middleBottom | rightLowerCorner |
For example, with the following setting, the smart coding algorithm will try to place part texts in the center area of the coded part.
part_txt 1 1 1 0.5 0 0 center 0.4 0.5 3.0 3.0
When the 7th parameter is set to no, there is no preferred position for the marking or text type.
Note: For text types, when the text is on a curve, this parameter should be set to no.
Parameters 8–11 are as follows:
|
# |
Parameter (used internally) |
Description |
Possible values |
Remarks |
|---|---|---|---|---|
| 8 |
minTextHeight |
Minimum text height |
Any decimal value |
mm from the intial height of the text Affects only when text size may be changed (mayTextSizeBeChanged = 1). |
| 9 |
acceptableTextRatio |
Acceptable text ratio |
Any decimal value |
mm from initial height/width ratio Affects only when text ratio may be changed (mayTextRatioBeChanged = 1). |
| 10 |
maxDistanceFromCurve |
Maximum distance of text from a line or curve |
Any decimal value |
The maximum distance is calculated by multiplying this value by the text height. Affects only when text is along a line or curve. |
| 11 | desiredDistanceFromCurve | Preferred distance of text from line or curve | Any decimal value |
The height of the text iincluded in the value. Used for text when the text runs along a line or curve. |
Lines 2-8 in the setting group
Lines 2-8 in the arrangement settings define how important it is to avoid certain situations in the placement of the marking or text. The situations are represented by priority parameters.
Possible values for the priority parameters are low, medium and high. Value low means that it is not important to avoid the situation, for example.
|
Priority parameter |
Situation to avoid |
Remarks |
|---|---|---|
| IfOuside | Marking or text is completely or partially outside of the contour line of the part. The more distance to the contour line, the more additional importance this parameter gets. | |
| IfIntersections | Marking or text intersects with other markings or texts (there is an overlap). The more intersections, the more additional importance this parameter gets. | |
| AwayFromTarget | Marking or text has a long distance from the line or part contour that it belongs to. The longer the distance, the more additional importance this parameter gets. | |
| DifferentSlope | Text gets rotated relative to the line or part contour that it belongs to, in cases where there is little room for parallel placement along the line or contour to make it fit. The bigger the rotation angle, the more additional importance this parameter gets. | Used for text which runs along a line or curve. |
| DistanceToTarget | Text is not placed at the preferred distance to the line or curve it belongs to (it is either closer or farther away). Preferred distance is defined with the 11th parameter on the first line of the arrangement settings. The bigger the distance, the more additional importance this parameter gets. | Used for text which runs along a line or curve. |
|
CloseToOther |
Marking or text is placed very close to other markings or texts, or part contour. The closer the other markings or texts, or part contour, the more additional importance this parameter gets. |
|
|
NotPreferredPosition |
Text is not placed at the preferred distance. Preferred distance is defined with the 11th parameter on the first line of the arrangement settings. The bigger the distance, the more additional importance this parameter gets. |
Used for text which does not run along a line or curve and has a preferred distance. |
|
notAtCentre |
Text is not placed at the center of the line it belongs to. The farther from the center the text is, the more additional importance this parameter gets. |
Used for text which runs along a line or curve. |
Syntax:
<marking or text type>_<priority parameter> <value>
See Default arrangement settings for examples.
Default arrangement settings
The arrangement settings for the different marking and text types contained in the cam.conf file in the default norms are presented below.
Text along marking line
Setting lines for texts along marking lines begin with txt_along_line.
txt_along_line 1 0 1 0 1 0 no 0.5 1 3 0.2
txt_along_line_IfOuside high
txt_along_line_IfIntersections high
txt_along_line_AwayFromTarget medium
txt_along_line_DifferentSlope medium
txt_along_line_DistanceToTarget medium
txt_along_line_CloseToOther low
txt_along_line_NotPreferredPosition low
txt_along_line_notAtCentre medium
Extra length markings/text
Setting lines for extra length markings begin with extra_length.
extra_length 1 0 1 0 1 1 no 0.5 1 3.0 0.5
extra_length_IfOuside high
extra_length_IfIntersections high
extra_length_AwayFromTarget high
extra_length_DifferentSlope high
extra_length_DistanceToTarget medium
extra_length_CloseToOther medium
extra_length_NotPreferredPosition low
extra_length_notAtCentre low
Bevel code
bevel_code 0 0 0 0 1 1 no 1.0 1.0 0.0 0.0
bevel_code_IfOuside low
bevel_code_IfIntersections high
bevel_code_AwayFromTarget high
bevel_code_DifferentSlope high
bevel_code_DistanceToTarget medium
bevel_code_CloseToOther low
bevel_code_NotPreferredPosition low
bevel_code_notAtCentre low
Bevel text
Setting lines for bevel texts begin with bevel_text.
bevel_text 1 0 1 0 1 1 no 0.2 1 3.0 0.5
bevel_text_IfOuside high
bevel_text_IfIntersections high
bevel_text_AwayFromTarget high
bevel_text_DifferentSlope high
bevel_text_DistanceToTarget medium
bevel_text_CloseToOther medium
bevel_text_NotPreferredPosition low
bevel_text_notAtCentre medium
Bevel model
Setting lines for bevel models begin with bevel_model.
bevel_model 1 0 1 0 1 0 no 0.5 1 0.1 0.0
bevel_model_IfOuside high
bevel_model_IfIntersections high
bevel_model_AwayFromTarget medium
bevel_model_DifferentSlope medium
bevel_model_DistanceToTarget medium
bevel_model_CloseToOther low
bevel_model_NotPreferredPosition low
bevel_model_notAtCentre low
Part text
Setting lines for part texts begin with part_text.
part_txt 1 0 1 0 0 0 center 0.2 1.0 3.0 0.5
part_txt_IfOuside high
part_txt_IfIntersections high
part_txt_AwayFromTarget low
part_txt_DifferentSlope low
part_txt_DistanceToTarget medium
part_txt_CloseToOther low
part_txt_NotPreferredPosition low
part_txt_notAtCentre low
Description text
Setting lines for description texts begin with description.
description 1 0 1 0 1 1 no 0.5 1 3 0.5
description_IfOuside high
description_IfIntersections high
description_AwayFromTarget high
description_DifferentSlope high
description_DistanceToTarget medium
description_CloseToOther low
description_NotPreferredPosition low
description_notAtCentre low
Reference marking
Setting lines for reference markings begin with reference_marking.
reference_marking 1 0 1 0 1 0 no 0.5 1.0 3.0 0.5
reference_marking_IfOuside high
reference_marking_IfIntersections high
reference_marking_AwayFromTarget high
reference_marking_DifferentSlope medium
reference_marking_DistanceToTarget high
reference_marking_CloseToOther low
reference_marking_NotPreferredPosition low
reference_marking_notAtCentre low
Angle text
Setting lines for angle texts begin with angle_text.
angle_text 1 0 1 0 1 1 no 0.4 1.0 3.0 0.5
angle_text_IfOuside low
angle_text_IfIntersections high
angle_text_AwayFromTarget high
angle_text_DifferentSlope medium
angle_text_DistanceToTarget high
angle_text_CloseToOther low
angle_text_NotPreferredPosition low
angle_text_notAtCentre low