User Tools

Site Tools

Translations of this page:


MyCNC Shop

MyCNC website

myCNC Price List


How to add Shape to Shape Library

There are 3 files should be created to build new Library Shape:

  1. G-code file with Shape Toolpath Programming. A Shape dimension, cutting and nesting parameters can be programmed through Macro Language extension Variables. File should have extension lbf (Library file)
  2. XML file with definition of Variables used in the Shape toolpath programming (lbf). Variables definition includes Variable address, name, minimum and maximum range, initial value, step for variable change (if SpinBox GUI widget used). MyCNC software use this XML file to build Setup dialog to program Shape parameters, then myCNC software initializes Variables listed in XML file accordingly current Variable Values.
  3. SVG - Shape preview graphic image file in SVG format (Scalable Vector Graphic)

All 3 files should be placed in Library folder.

  • For Linux ~/myCNC/lib
  • For Windows C:/MyCNC64/lib

Shape Example 1

G90 G17 G40 G80 G00 
S20000 M03 
#101=0 ; Start Z
if [ #101 gt #11 ] 20
#101=#11 (if Step Z more than Depth Z, limit it)
N20 G0 X0. Y0. A0.
#102=[ #10 - #50] / 2; Last X corrected by Tool Radius
N50 G0 Z#60 
#100=#20 (Current X = Step X )
N100 G1 X#100 Y0. A0. 
G1 G94 Z#101 F#40
G3 X#100 Y0. I[0-#100] J0. F#41
if [ #100  GE #102 ]  200 
#100 = #100 + #20
if [ #100  LE #102 ]  100 
#100 = #102
JUMP 100
N200 G00 Z#60 
if [ #101 LE  #11 ] 500 (goto finish)
#101=#101-#21 (Current Z = Step Z )
if [ #101 GT  #11 ] 50

Shape G-code uses Variables:

  • #10, #11 - Dimension and Cut depth
  • #20, #21 - Steps for X and Z for each pass
  • #40, #41 - Feed rates
  • #50, #60 - Tool diameter and Safe Height

To generate correct g-code this parameters should be listed XML configuration file. Sections Item represent each Parameter. Item attribute number represent Parameter address. For example first Item in XML file has number 10, Item value is “26”, then value “26” will be loaded into Parameter #10 before loading LBF file.

<?xml version="1.0" encoding="UTF-8"?>
<mycnc-shape-variables version="1.0">
        <message>Sample Shape 1</message>
        <value number="10" type="numpad" step="0.1" min="0" max="10000">26</value>
        <message>Diameter, mm</message>
        <message_ru>Диаметр, mm</message_ru>
        <value number="11" type="numpad" step="0.1" min="-1000" max="0">-15</value>
        <message>Depth, mm</message>
        <message_ru>Глубина, mm</message_ru>
        <value number="20" type="numpad" step="0.1" min="0" max="10000">2</value>
        <message>Step X, mm</message>
        <message_ru>Шаг X, mm</message_ru>
        <value number="21" type="numpad" step="0.1" min="0" max="10000">3</value>
        <message>Step Z, mm</message>
        <message_ru>Шаг Z, mm</message_ru>
        <value number="30" type="numpad" step="10" min="0" max="10000">10</value>
        <message>Off X, mm</message>
        <message_ru>Отвод X, мм</message_ru>
        <value number="40" type="numpad" step="10" min="0" max="3000">200</value>
        <message>Feed Start</message>
        <message_ru>Подача врезания Х</message_ru>
        <value number="41" type="numpad" step="10" min="0" max="3000">800</value>
        <message>Feed, mm/min</message>
        <message_ru>Подача, мм/мин</message_ru>
        <value number="50" type="numpad" step="0.1" min="0" max="50">2</value>
        <message>Tool Diameter, mm</message>
        <message_ru>Диаметр инструмента, мм</message_ru>
        <value number="60" type="numpad" step="0.1" min="0" max="1000">10</value>
        <message>Tool Lift, mm</message>
        <message_ru>Безопасная высота, мм</message_ru>

Graphic preview for the Shape is Shape Setup dialog will be -

mycnc/mycnc_add_shape_to_library.txt · Last modified: 2017/09/12 15:00 by skirillov

Translations of this page: