===== How to add Shape to Shape Library ===== There are 3 files should be created to build new Library Shape: - **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) - **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. - **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 #101=#101-#21 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 #101=#11 JUMP 50 N500 M05 G90 M30 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.
Sample Shape 1 Выборка
26 Diameter, mm Диаметр, mm -15 Depth, mm Глубина, mm 2 Step X, mm Шаг X, mm 3 Step Z, mm Шаг Z, mm 10 Off X, mm Отвод X, мм 200 Feed Start Подача врезания Х 800 Feed, mm/min Подача, мм/мин 2 Tool Diameter, mm Диаметр инструмента, мм 10 Tool Lift, mm Безопасная высота, мм
Graphic preview for the Shape is {{ lib-002.png }} Shape Setup dialog will be - {{ mycnc:mycnc-lib-010.png?700 }}