From 6e5a5f1f8636000abcad6802a565bdbfc2a90b9e Mon Sep 17 00:00:00 2001 From: Franky464 <36291976+Franky464@users.noreply.github.com> Date: Tue, 8 Sep 2026 16:11:23 +0200 Subject: [PATCH 01/10] Add Utility G-code Generator plugin details --- plugins/registry.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/registry.json b/plugins/registry.json index 531ad9c..b8a4488 100644 --- a/plugins/registry.json +++ b/plugins/registry.json @@ -72,6 +72,14 @@ "version": "1.0.0", "author": "Lytke", "base": "https://raw.githubusercontent.com/figamore/FigUI/main/plugins/draw/" - } + }, + { + "id": "Utility-G-code_Generator", + "name": "Utility G-code Generator", + "description": "Generate utility G-code (surfacing, contour drilling, matrix, corner radius, oblong hole, threading) with live preview.", + "version": "1.0.2", + "author": "Franky464", + "base": "https://raw.githubusercontent.com/figamore/FigUI/main/plugins/Utility-G-code_Generator/" + } ] } From 2fb1fea52a5eefba085f9ea8e7740e7f23da2014 Mon Sep 17 00:00:00 2001 From: Franky464 <36291976+Franky464@users.noreply.github.com> Date: Tue, 8 Sep 2026 16:13:15 +0200 Subject: [PATCH 02/10] Fix formatting in registry.json for G-code Generator --- plugins/registry.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/registry.json b/plugins/registry.json index b8a4488..af5b2c6 100644 --- a/plugins/registry.json +++ b/plugins/registry.json @@ -74,12 +74,12 @@ "base": "https://raw.githubusercontent.com/figamore/FigUI/main/plugins/draw/" }, { - "id": "Utility-G-code_Generator", - "name": "Utility G-code Generator", - "description": "Generate utility G-code (surfacing, contour drilling, matrix, corner radius, oblong hole, threading) with live preview.", - "version": "1.0.2", - "author": "Franky464", - "base": "https://raw.githubusercontent.com/figamore/FigUI/main/plugins/Utility-G-code_Generator/" + "id": "Utility-G-code_Generator", + "name": "Utility G-code Generator", + "description": "Generate utility G-code (surfacing, contour drilling, matrix, corner radius, oblong hole, threading) with live preview.", + "version": "1.0.2", + "author": "Franky464", + "base": "https://raw.githubusercontent.com/figamore/FigUI/main/plugins/Utility-G-code_Generator/" } ] } From 86f6468b19319a8a84de13d5439a5628c7f88d56 Mon Sep 17 00:00:00 2001 From: Franky464 <36291976+Franky464@users.noreply.github.com> Date: Tue, 8 Sep 2026 16:56:08 +0200 Subject: [PATCH 03/10] Fix id format for Utility G-code Generator --- plugins/registry.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/registry.json b/plugins/registry.json index af5b2c6..f470203 100644 --- a/plugins/registry.json +++ b/plugins/registry.json @@ -74,7 +74,7 @@ "base": "https://raw.githubusercontent.com/figamore/FigUI/main/plugins/draw/" }, { - "id": "Utility-G-code_Generator", + "id": "Utility-G-code Generator", "name": "Utility G-code Generator", "description": "Generate utility G-code (surfacing, contour drilling, matrix, corner radius, oblong hole, threading) with live preview.", "version": "1.0.2", From 1b4ac1ddeae3254ea7393baa694f4a6d756cebf8 Mon Sep 17 00:00:00 2001 From: Franky464 <36291976+Franky464@users.noreply.github.com> Date: Tue, 8 Sep 2026 17:01:41 +0200 Subject: [PATCH 04/10] Revise plugin.json description and features Updated the plugin description for clarity and added a live preview feature. --- plugins/Utility-G-code_Generator/plugin.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Utility-G-code_Generator/plugin.json b/plugins/Utility-G-code_Generator/plugin.json index f06763c..cc83d56 100644 --- a/plugins/Utility-G-code_Generator/plugin.json +++ b/plugins/Utility-G-code_Generator/plugin.json @@ -1,10 +1,10 @@ { "name": "Utility-G-code Generator", - "description": "Générateur G-code multi-opérations : surfaçage, perçages contour, matrice, rayon 90°, trou oblong, filetage. Pour FigUI / FluidNC.", + "description": "Generate utility G-code (surfacing, contour drilling, matrix, corner radius, oblong hole, threading) with live preview", "version": "1.0.2", "layout": "full", "icon": "icon.png", "layoutTablet": "full", "entry": "index.html", "files": ["index.html","settings.json","icon.png"] -} \ No newline at end of file +} From 4f3c5d3ad8f39593b617bd23f03836b19aa9d209 Mon Sep 17 00:00:00 2001 From: Franky464 <36291976+Franky464@users.noreply.github.com> Date: Thu, 10 Sep 2026 13:00:45 +0200 Subject: [PATCH 05/10] Update Utility G-code Generator version to 1.2.1 --- plugins/registry.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/registry.json b/plugins/registry.json index f470203..1e84914 100644 --- a/plugins/registry.json +++ b/plugins/registry.json @@ -77,7 +77,7 @@ "id": "Utility-G-code Generator", "name": "Utility G-code Generator", "description": "Generate utility G-code (surfacing, contour drilling, matrix, corner radius, oblong hole, threading) with live preview.", - "version": "1.0.2", + "version": "1.2.1", "author": "Franky464", "base": "https://raw.githubusercontent.com/figamore/FigUI/main/plugins/Utility-G-code_Generator/" } From 23abbf2efd2d1be2783d0b6d3395be5d7177568b Mon Sep 17 00:00:00 2001 From: Franky464 <36291976+Franky464@users.noreply.github.com> Date: Thu, 10 Sep 2026 13:10:23 +0200 Subject: [PATCH 06/10] New features such as rectangular or circular patterns from any of 6 current configuration. The mode 7 enable to repeat any of the 6 modes configuration. The plugin uses general themes. A detailed multilingual help was added. --- plugins/Utility-G-code_Generator/Readme.md | 8 +- plugins/Utility-G-code_Generator/index.html | 1215 +++++++++++++++-- plugins/Utility-G-code_Generator/plugin.json | 6 +- .../Utility-G-code_Generator/settings.json | 100 +- 4 files changed, 1140 insertions(+), 189 deletions(-) diff --git a/plugins/Utility-G-code_Generator/Readme.md b/plugins/Utility-G-code_Generator/Readme.md index 0e1a435..a4b52c5 100644 --- a/plugins/Utility-G-code_Generator/Readme.md +++ b/plugins/Utility-G-code_Generator/Readme.md @@ -1,4 +1,4 @@ -J'ai crée ce script pour faciliter l'utilisation de ma CNC. +J'ai crée ce script qui est un "couteau suisse" pour faciliter l'utilisation de ma CNC. Biensûr il existe des outils CAO et calcul de parcours d'outil qui font tout celà mais c'est assez lourd d'utilisation, chaque modification implique de revenir la source et de reproduire le Gcode. Cet outil intégré en plugin permet dans FigUI sur FluidNC permet tout en restant dans l'interface de créer et modifier instantanéement le gcode. Par exemple un surfaçage : on positionne la broche, en quelque clics on peut lancer le surfaçage et le corriger immédiatement (sans aucun transfer de fichiers. @@ -8,12 +8,13 @@ Un trou oblong, idem on défini X Y la largeur , taille de fraise... Un rayonage sur le plan X/Y peut être assez lourd via la CAO, ici on defini le coin, le sens, le rayon... en Fin programmer un filetage est extrèment lourd, tu choisi Vis ou ecrou, le pas la profondeur de passe, le nombre de fillets, c'est immédiat.. NB un filletage est aussi une bonne façon de réaliser un trou borgne, car le mouvement sera hélicoïdal avec un tour plat à fond de fillet.. +Le dernier mode (Créer schéma 7) permet de créer une répétition linéaire ou circulaire de l'une des 6 définitions. Pour lancer le plugin, depuis l'interface FigUI (plugin), la fenêtre s'ouvre directement sur les derniers paramètres utilisés ou les valeurs pas défaut. les modifications des champs s'exécutent instantanément (le g-code ainsi que le visuel), [Ouvrir dans le viewer] pour basculer sur FigUI, le retour vers le plugin reprendra les dernières valeurs. -I created this script to make my CNC easier to use. +I created this script that is a "swiss knife" to make my CNC easier to use. Of course there are CAD and toolpath calculation tools that do all this but it is quite cumbersome to use, each modification involves returning to the source and reproducing the Gcode. This tool integrated into a plugin allows in FigUI on FluidNC to instantly create and modify the gcode while remaining in the interface. For example surfacing: we position the spindle, in a few clicks we can start the surfacing and correct it immediately (without any file transfer) @@ -26,5 +27,6 @@ NB threading is also a good way to make a blind hole, because the movement will To launch the plugin, from the FigUI interface (plugin), the window opens directly on the last parameters used or the default values. field modifications are executed instantly (the g-code as well as the visual), [Open in viewer] to switch to FigUI, returning to the plugin will return to the last values. +The last mode (Create Pattern 7) enable to create a rectangular or circular pattern from one of the 6 previous definitions. -https://github.com/Franky464/Utility-G-code_Generator_FigUI_Plugin +https://github.com/Franky464/Utility-G-code_Generator_FigUI_Plugin \ No newline at end of file diff --git a/plugins/Utility-G-code_Generator/index.html b/plugins/Utility-G-code_Generator/index.html index d4e253c..bced42c 100644 --- a/plugins/Utility-G-code_Generator/index.html +++ b/plugins/Utility-G-code_Generator/index.html @@ -113,7 +113,7 @@ .viz-wrap { flex: 1; position: relative; - background: #0a0e16; + background: var(--bg, #0a0e16); min-height: 0; display: flex; flex-direction: column; @@ -139,7 +139,7 @@ font-weight: 700; letter-spacing: .06em; color: var(--text-muted, #6a7898); - background: rgba(12,16,24,.7); + background: color-mix(in srgb, var(--surface, #151c28) 85%, transparent); padding: 1px 5px; border-radius: 3px; pointer-events: none; @@ -150,17 +150,17 @@ left: 8px; bottom: 8px; font-size: 11px; color: var(--text-muted, #6a7898); - background: rgba(12,16,24,.85); - border: 1px solid var(--border, #222840); + background: color-mix(in srgb, var(--surface, #151c28) 90%, transparent); + border-color: var(--border, #222840); border-radius: 4px; padding: 6px 8px; pointer-events: none; } .viz-legend span { display: inline-block; width: 18px; height: 2px; vertical-align: middle; margin-right: 6px; } -.leg-rapid { border-top: 2px dashed #64748b; height: 0; } -.leg-cut { background: #f0a030; } -.leg-start { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; } -.leg-plunge { width: 6px; height: 6px; border-radius: 50%; background: #f0a030; } +.leg-rapid { border-top-color: var(--text-muted, #64748b); } +.leg-cut { background: var(--accent, #f0a030); } +.leg-start { background: var(--ok, #22c55e); } +.leg-plunge { background: var(--accent, #f0a030); } .action-bar { padding: 8px 12px; background: var(--surface, #151c28); @@ -186,6 +186,97 @@ } .language-section { padding-top: 8px; padding-bottom: 8px; } .language-section select { font-weight: 600; } + +.help-overlay { + position: fixed; inset: 0; z-index: 1000; + background: rgba(0,0,0,.65); + display: flex; align-items: center; justify-content: center; + padding: 16px; +} +.help-overlay.hidden { display: none !important; } +.help-dialog { + width: min(720px, 100%); + max-height: min(90vh, 900px); + background: var(--surface, #151c28); + border: 1px solid var(--border, #222840); + border-radius: 10px; + display: flex; flex-direction: column; + overflow: hidden; + box-shadow: 0 12px 40px rgba(0,0,0,.45); +} +.help-header { + flex-shrink: 0; + display: flex; align-items: center; gap: 10px; + padding: 12px 14px; + border-bottom: 1px solid var(--border, #222840); + background: var(--elevated, #1a2235); +} +.help-header h2 { + font-size: 15px; font-weight: 700; flex: 1; margin: 0; + color: var(--text-primary, #e2e6f4); +} +.help-close { + padding: 6px 12px; + background: var(--elevated, #1a2235); + border: 1px solid var(--border, #222840); + color: var(--text-primary, #e2e6f4); + border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; +} +.help-close:hover { border-color: var(--accent, #f0a030); } +.help-nav { + flex-shrink: 0; + display: flex; flex-wrap: wrap; gap: 6px; + padding: 8px 12px; + border-bottom: 1px solid var(--border, #222840); +} +.help-nav button { + padding: 4px 10px; + font-size: 12px; font-weight: 600; + background: var(--elevated, #1a2235); + border: 1px solid var(--border, #222840); + color: var(--text-muted, #6a7898); + border-radius: 4px; cursor: pointer; +} +.help-nav button:hover, .help-nav button.active { + border-color: var(--accent, #f0a030); + color: var(--text-primary, #e2e6f4); +} +.help-body { + flex: 1; overflow-y: auto; + padding: 14px 18px 24px; + font-size: 13px; line-height: 1.55; + color: var(--text-primary, #e2e6f4); +} +.help-body h3 { + font-size: 15px; margin: 18px 0 8px; + color: var(--accent, #f0a030); + scroll-margin-top: 12px; +} +.help-body h3:first-child { margin-top: 0; } +.help-body h4 { font-size: 13px; margin: 12px 0 6px; color: #94a3b8; } +.help-body p, .help-body li { margin-bottom: 6px; color: #c8d0e0; } +.help-body ul { padding-left: 18px; margin-bottom: 8px; } +.help-body table { + width: 100%; border-collapse: collapse; margin: 8px 0 12px; + font-size: 12px; +} +.help-body th, .help-body td { + border: 1px solid var(--border, #222840); + padding: 6px 8px; text-align: left; vertical-align: top; +} +.help-body th { background: var(--elevated, #1a2235); color: #94a3b8; } +.help-body code { + font-family: ui-monospace, monospace; + font-size: 12px; + background: #0a0e16; + padding: 1px 5px; border-radius: 3px; +} +.help-body .tip { + border-left: 3px solid var(--accent, #f0a030); + padding: 6px 10px; margin: 8px 0; + background: rgba(240,160,48,.08); + border-radius: 0 4px 4px 0; +} + \ No newline at end of file diff --git a/plugins/Utility-G-code_Generator/plugin.json b/plugins/Utility-G-code_Generator/plugin.json index cc83d56..61f4e05 100644 --- a/plugins/Utility-G-code_Generator/plugin.json +++ b/plugins/Utility-G-code_Generator/plugin.json @@ -1,10 +1,10 @@ { "name": "Utility-G-code Generator", - "description": "Generate utility G-code (surfacing, contour drilling, matrix, corner radius, oblong hole, threading) with live preview", - "version": "1.0.2", + "description": "Générateur G-code multi-opérations : surfaçage, perçages contour, matrice, rayon 90°, trou oblong, filetage. Pour FigUI / FluidNC.", + "version": "1.2.1", "layout": "full", "icon": "icon.png", "layoutTablet": "full", "entry": "index.html", "files": ["index.html","settings.json","icon.png"] -} +} \ No newline at end of file diff --git a/plugins/Utility-G-code_Generator/settings.json b/plugins/Utility-G-code_Generator/settings.json index f2dd57b..fe2891b 100644 --- a/plugins/Utility-G-code_Generator/settings.json +++ b/plugins/Utility-G-code_Generator/settings.json @@ -1,99 +1 @@ -{ - "last_operation": "4", - "project_name": "Demo", - "machine": "CNC_450x800", - "global_units": "mm", - "global_feed_rate_percent": "50%", - "language": "fr", - "surfacing": { - "start_x": 0, - "start_y": 0, - "start_z": 0, - "clearance_height": 5, - "tool_diameter": 5, - "spindle_speed": 24000, - "feed_rate": 1000, - "depth_per_pass": 1, - "total_depth": 2, - "width_x": 100, - "length_y": 100, - "overlap_percent": 50, - "path_type": "conventional" - }, - "contour_drilling": { - "start_x": 10, - "start_y": 10, - "start_z": 0, - "clearance_height": 5, - "tool_diameter": 10, - "spindle_speed": 1000, - "feed_rate": 1200, - "depth_per_pass": 1, - "total_depth": 5, - "hole_diameter": 30, - "drilling_type": "blind", - "path_type": "conventional", - "overlap_percent": 75 - }, - "matrix_drilling": { - "start_x": 0, - "start_y": 0, - "start_z": 0, - "clearance_height": 5, - "tool_diameter": 10, - "spindle_speed": 1000, - "feed_rate": 1800, - "depth_per_pass": 1, - "total_depth": 2, - "num_cols": 3, - "num_rows": 4, - "spacing_x": 10, - "spacing_y": 10, - "deburr_height": 2 - }, - "corner_radius": { - "start_x": 0, - "start_y": 0, - "start_z": 0, - "clearance_height": 5, - "tool_diameter": 10, - "spindle_speed": 1000, - "feed_rate": 1800, - "depth_per_pass": 1, - "total_depth": 2, - "radius": 20, - "corner_type": "front_left", - "path_type": "climb" - }, - "oblong_hole": { - "start_x": 0, - "start_y": 0, - "start_z": 0, - "clearance_height": 5, - "tool_diameter": 50, - "spindle_speed": 1000, - "feed_rate": 1800, - "depth_per_pass": 1, - "total_depth": 2, - "length_x": 20, - "length_y": 20, - "width": 60, - "path_type": "conventional" - }, - "threading": { - "start_x": 0, - "start_y": 0, - "start_z": 0, - "clearance_height": 5, - "tool_diameter": 6, - "spindle_speed": 1000, - "feed_rate": 1800, - "depth_per_pass": 1, - "total_depth": 2, - "hole_diameter": 30, - "thread_type": "nut_internal", - "path_type": "right", - "thread_pitch": 2, - "thread_number": 30 - } -} \ No newline at end of file +{"last_operation":"7","project_name":"demonstration","machine":"CNC_450x800","global_units":"mm","global_feed_rate_percent":"50%","language":"fr","startup_codes":"M7 M8 M3 G04 P1","surfacing":{"start_x":0,"start_y":0,"start_z":0,"clearance_height":5,"tool_diameter":10,"spindle_speed":1000,"feed_rate":1800,"depth_per_pass":1,"total_depth":2,"width_x":100,"length_y":100,"overlap_percent":50,"path_type":"alternate"},"contour_drilling":{"start_x":0,"start_y":0,"start_z":0,"clearance_height":5,"tool_diameter":6,"spindle_speed":1000,"feed_rate":1778,"depth_per_pass":0.5,"total_depth":2,"hole_diameter":10,"drilling_type":"contour","path_type":"conventional","overlap_percent":50},"matrix_drilling":{"start_x":0,"start_y":0,"start_z":0,"clearance_height":5,"tool_diameter":4,"spindle_speed":1000,"feed_rate":1800,"depth_per_pass":1,"total_depth":5,"matrix_layout":"polar","num_cols":4,"num_rows":5,"spacing_x":40,"spacing_y":30,"polar_radius":20,"polar_num_holes":11,"polar_start_angle":90,"polar_total_angle":360},"corner_radius":{"start_x":0,"start_y":0,"start_z":0,"clearance_height":5,"tool_diameter":10,"spindle_speed":1000,"feed_rate":1800,"depth_per_pass":1,"total_depth":2,"radius":10,"corner_type":"front_left","path_type":"conventional"},"oblong_hole":{"start_x":0,"start_y":0,"start_z":0,"clearance_height":5,"tool_diameter":4,"spindle_speed":1000,"feed_rate":1800,"depth_per_pass":1,"total_depth":2,"length_x":20,"length_y":0,"width":10,"path_type":"climb"},"threading":{"start_x":0,"start_y":0,"start_z":0,"clearance_height":5,"tool_diameter":6,"spindle_speed":1000,"feed_rate":50,"depth_per_pass":0.5,"total_depth":1.3,"hole_diameter":8,"thread_type":"nut_internal","path_type":"right","thread_pitch":1.25,"thread_number":8},"schema_pattern":{"start_x":0,"start_y":0,"start_z":0,"clearance_height":5,"tool_diameter":4,"spindle_speed":1000,"feed_rate":1800,"depth_per_pass":1,"total_depth":5,"schema_source":"2","schema_layout":"rectangular","schema_num_x":10,"schema_num_y":10,"schema_step_x":20,"schema_step_y":20,"schema_polar_radius":50,"schema_polar_num":6,"schema_polar_start":0,"schema_polar_total":360}} \ No newline at end of file From ecc40334b4642f22da6ec8914fb2a7a0f8c20974 Mon Sep 17 00:00:00 2001 From: Franky464 <36291976+Franky464@users.noreply.github.com> Date: Sun, 13 Sep 2026 18:16:19 +0200 Subject: [PATCH 07/10] Oblong path corrected The offset was wrong on oblong --- plugins/Utility-G-code_Generator/index.html | 94 +++++++++++++------- plugins/Utility-G-code_Generator/plugin.json | 2 +- 2 files changed, 61 insertions(+), 35 deletions(-) diff --git a/plugins/Utility-G-code_Generator/index.html b/plugins/Utility-G-code_Generator/index.html index bced42c..02a667e 100644 --- a/plugins/Utility-G-code_Generator/index.html +++ b/plugins/Utility-G-code_Generator/index.html @@ -557,7 +557,7 @@ spindleSpeed: "Broche RPM", feedRate: "Avance (mm/min)", depthPerPass: "Prof. / passe", - totalDepth: "Prof. totale (mm) au diamètre", + totalDepth: "Prof. totale (mm)", surfacing: "Surfaçage", contourDrilling: "Perçage détourage", matrixDrilling: "Schéma perçage", @@ -2134,54 +2134,80 @@ function genOblong(p) { if (p.width < p.tool_diameter) throw new Error(tr('widthToolError')); if (p.depth_per_pass > p.total_depth) throw new Error(tr('depthPassError')); + const numPassesZ = Math.ceil(p.total_depth / p.depth_per_pass); - const halfW = (p.width - p.tool_diameter) / 2, halfLx = p.length_x / 2, halfLy = p.length_y / 2; + const r = (p.width - p.tool_diameter) / 2; + const tcHalfX = (p.length_x - p.tool_diameter) / 2; + const tcHalfY = (p.length_y - p.tool_diameter) / 2; + const halfLx = tcHalfX - r; + const halfLy = tcHalfY - r; + + if (halfLx < 0 || halfLy < 0) + throw new Error('Corner radius too large for length_x/length_y'); + const plunge = p.feed_rate * p.plunge_percent / 100; - const conv = p.path_type === 'conventional'; + const conv = p.path_type === 'conventional'; let g = []; + + // Point de départ du contour (sur le segment droit inférieur) + const startMachX = p.start_x - halfLx; // ex: -2.5 + const startMachY = p.start_y - tcHalfY; // ex: -30 + g.push('; Oblong hole'); g.push('G90'); g.push(`G00 Z${fmt(p.clearance_height)} F${Math.round(p.feed_rate)}`); - g.push(`G00 X${fmt(p.start_x)} Y${fmt(p.start_y)} F${Math.round(p.feed_rate)}`); + g.push(`G00 X${fmt(p.start_x)} Y${fmt(p.start_y)} F${Math.round(p.feed_rate)}`); + + // Aller directement au point de départ du contour en G0 + g.push(`G00 X${fmt(startMachX)} Y${fmt(startMachY)} F${Math.round(p.feed_rate)}`); + for (let i = 0; i < numPassesZ; i++) { const targetZ = p.start_z - Math.min((i + 1) * p.depth_per_pass, p.total_depth); g.push(`; Pass ${i + 1} at Z=${fmt(targetZ)}`); + + // Plongée uniquement + g.push(`G01 Z${fmt(targetZ)} F${fmt(plunge)}`); + + g.push('G91'); + if (conv) { - g.push('G90'); - g.push(`G01 X${fmt(p.start_x)} Y${fmt(p.start_y - halfW)} F${Math.round(p.feed_rate)}`); - g.push(`G01 Z${fmt(targetZ)} F${fmt(plunge)}`); - g.push('G91'); - g.push(`G01 X${fmt(-halfLx)} Y${fmt(-halfLy)}`); - g.push(`G02 X${fmt(-halfW)} Y${fmt(halfW)} I0.000 J${fmt(halfW)} F${Math.round(p.feed_rate)}`); - g.push(`G01 X0.000 Y${fmt(p.length_y)} F${Math.round(p.feed_rate)}`); - g.push(`G02 X${fmt(halfW)} Y${fmt(halfW)} I${fmt(halfW)} J0.000 F${Math.round(p.feed_rate)}`); - g.push(`G01 X${fmt(p.length_x)} Y0.000 F${Math.round(p.feed_rate)}`); - g.push(`G02 X${fmt(halfW)} Y${fmt(-halfW)} I0.000 J${fmt(-halfW)} F${Math.round(p.feed_rate)}`); - g.push(`G01 X0.000 Y${fmt(-p.length_y)} F${Math.round(p.feed_rate)}`); - g.push(`G02 X${fmt(-halfW)} Y${fmt(-halfW)} I${fmt(-halfW)} J0.000 F${Math.round(p.feed_rate)}`); - g.push(`G01 X${fmt(-p.length_x)} Y0.000 F${Math.round(p.feed_rate)}`); - g.push('G90'); + // Conventional (G02) – sens horaire + // Départ : (-halfLx, -tcHalfY) + g.push(`G02 X${fmt(-r)} Y${fmt(r)} I0.000 J${fmt(r)} F${Math.round(p.feed_rate)}`); + g.push(`G01 X0.000 Y${fmt(2 * halfLy)} F${Math.round(p.feed_rate)}`); + g.push(`G02 X${fmt(r)} Y${fmt(r)} I${fmt(r)} J0.000 F${Math.round(p.feed_rate)}`); + g.push(`G01 X${fmt(2 * halfLx)} Y0.000 F${Math.round(p.feed_rate)}`); + g.push(`G02 X${fmt(r)} Y${fmt(-r)} I0.000 J${fmt(-r)} F${Math.round(p.feed_rate)}`); + g.push(`G01 X0.000 Y${fmt(-2 * halfLy)} F${Math.round(p.feed_rate)}`); + g.push(`G02 X${fmt(-r)} Y${fmt(-r)} I${fmt(-r)} J0.000 F${Math.round(p.feed_rate)}`); + g.push(`G01 X${fmt(-2 * halfLx)} Y0.000 F${Math.round(p.feed_rate)}`); } else { - g.push('G90'); - g.push(`G01 X${fmt(p.start_x - halfW)} Y${fmt(p.start_y - p.length_y)} F${Math.round(p.feed_rate)}`); - g.push(`G01 Z${fmt(targetZ)} F${fmt(plunge)}`); - g.push('G91'); - g.push(`G01 X${fmt(-halfLx)} Y${fmt(halfLy)}`); - g.push(`G03 X${fmt(halfW)} Y${fmt(-halfW)} I${fmt(halfW)} J0.000 F${Math.round(p.feed_rate)}`); - g.push(`G01 X${fmt(p.length_x)} Y0.000 F${Math.round(p.feed_rate)}`); - g.push(`G03 X${fmt(halfW)} Y${fmt(halfW)} I0.000 J${fmt(halfW)} F${Math.round(p.feed_rate)}`); - g.push(`G01 X0.000 Y${fmt(p.length_y)} F${Math.round(p.feed_rate)}`); - g.push(`G03 X${fmt(-halfW)} Y${fmt(halfW)} I${fmt(-halfW)} J0.000 F${Math.round(p.feed_rate)}`); - g.push(`G01 X${fmt(-p.length_x)} Y0.000 F${Math.round(p.feed_rate)}`); - g.push(`G03 X${fmt(-halfW)} Y${fmt(-halfW)} I0.000 J${fmt(-halfW)} F${Math.round(p.feed_rate)}`); - g.push(`G01 X0.000 Y${fmt(-p.length_y)} F${Math.round(p.feed_rate)}`); - g.push('G90'); + // Climb (G03) – sens anti-horaire + // Même point de départ + g.push(`G01 X${fmt(2 * halfLx)} Y0.000 F${Math.round(p.feed_rate)}`); + g.push(`G03 X${fmt(r)} Y${fmt(r)} I0.000 J${fmt(r)} F${Math.round(p.feed_rate)}`); + g.push(`G01 X0.000 Y${fmt(2 * halfLy)} F${Math.round(p.feed_rate)}`); + g.push(`G03 X${fmt(-r)} Y${fmt(r)} I${fmt(-r)} J0.000 F${Math.round(p.feed_rate)}`); + g.push(`G01 X${fmt(-2 * halfLx)} Y0.000 F${Math.round(p.feed_rate)}`); + g.push(`G03 X${fmt(-r)} Y${fmt(-r)} I0.000 J${fmt(-r)} F${Math.round(p.feed_rate)}`); + g.push(`G01 X0.000 Y${fmt(-2 * halfLy)} F${Math.round(p.feed_rate)}`); + g.push(`G03 X${fmt(r)} Y${fmt(-r)} I${fmt(r)} J0.000 F${Math.round(p.feed_rate)}`); } + + g.push('G90'); } + + // Remontée UNIQUEMENT à la fin g.push(`G00 Z${fmt(p.clearance_height)} F${Math.round(p.feed_rate)}`); - g.push(`G00 X${fmt(p.start_x)} Y${fmt(p.start_y)} F${Math.round(p.feed_rate)}`); + g.push(`G00 X${fmt(p.start_x)} Y${fmt(p.start_y)} F${Math.round(p.feed_rate)}`); g.push('G90'); - return { body: g.join('\n'), stockX: p.length_x + p.tool_diameter, stockY: p.length_y + p.tool_diameter, stockZ: p.start_z + p.total_depth }; + + return { + body: g.join('\n'), + stockX: p.length_x + p.tool_diameter, + stockY: p.length_y + p.tool_diameter, + stockZ: p.start_z + p.total_depth + }; } function genThreading(p) { diff --git a/plugins/Utility-G-code_Generator/plugin.json b/plugins/Utility-G-code_Generator/plugin.json index 61f4e05..f1aa2a2 100644 --- a/plugins/Utility-G-code_Generator/plugin.json +++ b/plugins/Utility-G-code_Generator/plugin.json @@ -1,7 +1,7 @@ { "name": "Utility-G-code Generator", "description": "Générateur G-code multi-opérations : surfaçage, perçages contour, matrice, rayon 90°, trou oblong, filetage. Pour FigUI / FluidNC.", - "version": "1.2.1", + "version": "1.2.2", "layout": "full", "icon": "icon.png", "layoutTablet": "full", From 3107f3dbd50191faae5ccab87c4a6119f6d305cc Mon Sep 17 00:00:00 2001 From: Franky464 <36291976+Franky464@users.noreply.github.com> Date: Sun, 13 Sep 2026 18:17:02 +0200 Subject: [PATCH 08/10] Update Utility G-code Generator version to 1.2.2 --- plugins/registry.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/registry.json b/plugins/registry.json index 1e84914..22f8e4c 100644 --- a/plugins/registry.json +++ b/plugins/registry.json @@ -77,7 +77,7 @@ "id": "Utility-G-code Generator", "name": "Utility G-code Generator", "description": "Generate utility G-code (surfacing, contour drilling, matrix, corner radius, oblong hole, threading) with live preview.", - "version": "1.2.1", + "version": "1.2.2", "author": "Franky464", "base": "https://raw.githubusercontent.com/figamore/FigUI/main/plugins/Utility-G-code_Generator/" } From 853c86d150a8958be0bc5513b99f48fc3f16f1da Mon Sep 17 00:00:00 2001 From: Franky464 <36291976+Franky464@users.noreply.github.com> Date: Thu, 17 Sep 2026 19:54:56 +0200 Subject: [PATCH 09/10] Update Utility G-code Generator version to 1.3.1 --- plugins/registry.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/registry.json b/plugins/registry.json index 22f8e4c..e3da077 100644 --- a/plugins/registry.json +++ b/plugins/registry.json @@ -77,7 +77,7 @@ "id": "Utility-G-code Generator", "name": "Utility G-code Generator", "description": "Generate utility G-code (surfacing, contour drilling, matrix, corner radius, oblong hole, threading) with live preview.", - "version": "1.2.2", + "version": "1.3.1", "author": "Franky464", "base": "https://raw.githubusercontent.com/figamore/FigUI/main/plugins/Utility-G-code_Generator/" } From bcef6d2e0bebb58c7a993a2d77e58151f74242b5 Mon Sep 17 00:00:00 2001 From: Franky464 <36291976+Franky464@users.noreply.github.com> Date: Thu, 17 Sep 2026 19:59:58 +0200 Subject: [PATCH 10/10] Visualisation of the part on the preview The mode radius, needed more exutufaceplicit description such as where to rezero the machine. (now just rezero X by touch then Y by touch, the plugin will know xhare to start). Every mode now display both the tool path and milled surface. Miscelaneous ergonomic improvements.. --- plugins/Utility-G-code_Generator/index.html | 749 ++++++++++++++++--- plugins/Utility-G-code_Generator/plugin.json | 2 +- 2 files changed, 645 insertions(+), 106 deletions(-) diff --git a/plugins/Utility-G-code_Generator/index.html b/plugins/Utility-G-code_Generator/index.html index 02a667e..1a02f76 100644 --- a/plugins/Utility-G-code_Generator/index.html +++ b/plugins/Utility-G-code_Generator/index.html @@ -30,10 +30,10 @@ display: flex; flex-direction: column; gap: 5px; } .section-title { - font-size: 11px; font-weight: 700; + font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted, #6a7898); - margin-bottom: 2px; + margin-bottom: 0px; } label { color: var(--text-muted, #6a7898); font-size: 12px; margin-top: 2px; } input[type=number], input[type=text], select { @@ -78,7 +78,7 @@ .main-split { flex: 1; display: grid; - grid-template-columns: 1fr 2fr; + grid-template-columns: 1fr 3fr; min-height: 0; overflow: hidden; } @@ -109,6 +109,10 @@ font-family: ui-monospace, monospace; font-size: 11px; line-height: 1.45; padding: 10px; + overflow: auto; /* scroll vertical + horizontal si trop large */ + white-space: pre; /* ne pas casser les lignes G-code */ + overflow-wrap: normal; + word-break: normal; } .viz-wrap { flex: 1; @@ -145,28 +149,80 @@ pointer-events: none; z-index: 2; } +.--legend { + position: absolute; + left: 8px; + bottom: 8px; + font-size: 12px; + line-height: 1.45; + color: var(--text-muted, #6a7898); + background: color-mix(in srgb, var(--surface, #151c28) 92%, transparent); + border: 1px solid var(--border, #222840); + border-radius: 6px; + padding: 8px 12px; + pointer-events: none; + white-space: nowrap; /* empêche les retours à la ligne */ + min-width: 160px; +} .viz-legend { position: absolute; - left: 8px; bottom: 8px; - font-size: 11px; + left: 8px; + bottom: 8px; + font-size: 12px; + line-height: 1.45; color: var(--text-muted, #6a7898); - background: color-mix(in srgb, var(--surface, #151c28) 90%, transparent); - border-color: var(--border, #222840); - border-radius: 4px; - padding: 6px 8px; + background: color-mix(in srgb, var(--surface, #151c28) 92%, transparent); + border: 1px solid var(--border, #222840); + border-radius: 6px; + padding: 8px 12px; pointer-events: none; + white-space: nowrap; + min-width: 160px; + z-index: 3; +} +.viz-legend > div { + display: flex; + align-items: center; + gap: 8px; + margin: 3px 0; +} +.viz-legend span.leg-start, +.viz-legend span.leg-rapid, +.viz-legend span.leg-cut, +.viz-legend span.leg-plunge, +.viz-legend span.leg-part { + display: inline-block; + width: 20px; + height: 3px; + flex-shrink: 0; + border-radius: 1px; } -.viz-legend span { display: inline-block; width: 18px; height: 2px; vertical-align: middle; margin-right: 6px; } -.leg-rapid { border-top-color: var(--text-muted, #64748b); } -.leg-cut { background: var(--accent, #f0a030); } -.leg-start { background: var(--ok, #22c55e); } +.leg-start { background: var(--ok, #22c55e); } +.leg-rapid { background: transparent; border-top: 2px dashed var(--text-muted, #64748b); height: 0; } +.leg-cut { background: var(--accent, #f0a030); } .leg-plunge { background: var(--accent, #f0a030); } +.leg-part { background: transparent; border-top: 2px dashed #38bdf8; height: 0; } +/* Point Zéro : pastille ronde (hors règle des traits) */ +.viz-legend span.leg-zero { + display: inline-block; + width: 10px; + height: 10px; + flex-shrink: 0; + border-radius: 50%; + background: #38bdf8; + margin: 0 5px; +} + .action-bar { padding: 8px 12px; background: var(--surface, #151c28); border-top: 1px solid var(--border, #222840); - display: flex; align-items: center; gap: 8px; flex-shrink: 0; + display: flex; + align-items: center; + gap: 8px; + flex-shrink: 0; } + .action-btn { padding: 7px 14px; background: var(--elevated, #1a2235); @@ -177,8 +233,16 @@ .action-btn:hover { border-color: var(--accent, #f0a030); } .action-btn:disabled { opacity: .4; cursor: default; } #status { font-size: 12px; color: var(--text-muted, #6a7898); flex: 1; text-align: right; } -#status.ok { color: #22c55e; } -#status.err { color: #ef4444; } +#status.ok { color: #22c55e; + font-size: 24px; /* double de 12px */ + font-weight: 700; /* gras */ + line-height: 1.2; } +#status.err { + color: #ef4444; + font-size: 24px; /* double de 12px */ + font-weight: 700; /* gras */ + line-height: 1.2; +} .hidden { display: none !important; } @media (max-width: 900px) { .main-split { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; } @@ -280,6 +344,8 @@