Yesss, I found Peter's script on Github Probe: Hole Center · Issue #145 · OpenBuilds/OpenBuilds-CONTROL You and Peter can be part of the high-level cooks @Peter Van Der Walt @Misterg Congratulations and thank you for theses superb useful tools
@Peter Van Der Walt @Misterg The 3D probe is operational, it works in parallel with the XYZ+ probe with the macro. Thank you very much for your details!
Hello ! Sorry to ask a silly question, but how to get this file (Alternative UI ), because Center Finder V2.zip gives me default UI, I did not find the link Thanks for all
Hi Super Team! I changed the variable and it works very well. @Misterg I have another good ... or bad question: Could you tell me how to display the external measurement result of the probe as it displays in the Peter script
Small display issue in dark mode. Its hard to see with the fg-black you have on the button icon. There's no need to call out the color. By default its black in light mode and white in dark mode. With fg-black removed
Sharing my updates: - Round to 3 digits after comma - Added fractional measurement for inches - Split output into 2 lines Code: Math.gcd= function(a, b){ if(b) return Math.gcd(b, a%b); return Math.abs(a); } Math.roundFraction= function(n, prec, up){ var s= String(n), p= s.indexOf('.'); if(p== -1) return s; var i= Math.floor(n) || '', dec= s.substring(p), m= prec || Math.pow(10, dec.length-1), num= up=== 1? Math.ceil(dec*m): Math.round(dec*m), den= m, g= Math.gcd(num, den); if(den/g==1) return String(i+(num/g)); if(i) i= i+'"-'; return i+ String(num/g)+'/'+String(den/g); } const round = (n, dp) => { const h = +('1'.padEnd(dp + 1, '0')) // 10 or 100 or 1000 or etc return Math.round(n * h) / h } if (typeof object !== 'undefined') { var precision = 32 var string = "" if (object.userData.inch) { string += "Width (X): " + round((object.userData.bbbox2.max.x - object.userData.bbbox2.min.x), 3) + "inch (" + Math.roundFraction(object.userData.bbbox2.max.x - object.userData.bbbox2.min.x, precision) + ") <br/> " + "Height (Y): " + round((object.userData.bbbox2.max.y - object.userData.bbbox2.min.y), 3) + "inch (" + Math.roundFraction(object.userData.bbbox2.max.y - object.userData.bbbox2.min.y, precision) + ")"; } else { string += "Width (X): " + round((object.userData.bbbox2.max.x - object.userData.bbbox2.min.x), 3) + "mm" + " / " + "Height (Y): " + round((object.userData.bbbox2.max.y - object.userData.bbbox2.min.y), 3) + "mm"; } console.log(string) Metro.dialog.create({ title: "Stock Size needed", clsDialog: "dark", content: ` To run this job, you need a piece of stock:<hr> ` + string + ` `, actions: [{ caption: "Cancel", cls: "js-dialog-close alert", }] }); }
Is there a way to probe and find center of 2 point like a slot ou a groove? i never messed with macro and dint want to break something so im asking here 1st thanks
I think so far only this one Getting started with Javascript Macros in CONTROL / Library of Macros created by the community that you will need to modify to do only X or only Y (right now it does both for circular holes, squares, rectangles etc. first in one Direction then the other)
Since a lot is possible to adapt the UI with the javascript macro's, like adding/removing interface buttons... would it also be possible in this route to have the serial and Macro tab show side by side (50%/50%) instead of on separate tabs?
uhao super!! but it's possible add also the information about toolpath that I've insert in my Gcode for postprocessor?
I havent fully tested this, but should work. Put the following code into a javascript macro and set it to run at startup. Code: $('#macros').insertAfter('#console') $('#consoletab').html('<i class="fas fa-fw fa-terminal fg-darkGreen"></i> Console / Macros') $('#tab-four').remove() $('#macrostab').remove() $("#macros").css({"height": "calc(100vh - 535px)", "overflow-y": "auto"})
Yes, thanks! I was wondering if in this screen the information on the size of the piece would come out, also including the depth of the Z, and the information on the cutter to use (if they exist in the original Gcode). For example To do this job you need a piece of this size x ---- y---- z--- and these tools (tool size),(tool name) Are you saying it can be done?
Yes for Z. Locate this line: Code: if (object.userData.inch) { and replace by: Code: if (object.userData.inch) { string += "Width (X): " + round((object.userData.bbbox2.max.x - object.userData.bbbox2.min.x), 3) + "inch (" + Math.roundFraction(object.userData.bbbox2.max.x - object.userData.bbbox2.min.x, precision) + ") <br/> " + "Height (Y): " + round((object.userData.bbbox2.max.y - object.userData.bbbox2.min.y), 3) + "inch (" + Math.roundFraction(object.userData.bbbox2.max.y - object.userData.bbbox2.min.y, precision) + ")<br/>" + "Depth (Z): " + round((object.userData.bbbox2.max.z - object.userData.bbbox2.min.z), 3) + "inch (" + Math.roundFraction(object.userData.bbbox2.max.z - object.userData.bbbox2.min.z, precision) + ")"; } else { string += "Width (X): " + round((object.userData.bbbox2.max.x - object.userData.bbbox2.min.x), 2) + "mm" + "<br/>" + "Height (Y): " + round((object.userData.bbbox2.max.y - object.userData.bbbox2.min.y), 2) + "mm<br/>" + "Depth (Z): " + round((object.userData.bbbox2.max.z - object.userData.bbbox2.min.z), 2) + "mm"; }
Works flawless, thx! I'm struggling on how to adapt it to start with that panel active; discovered it is already named tab-one, while it boots up with the 3Dview which is tab-three??
Tab numbers have little to do with it. They are just names. Control does "start" with the console tab active. So Im assuming you mean after loading a file?
I'll have to check tomorrow when it is connected to the controller, but when not connected the application 'starts' with the 3D view tab for me.
It does, then when you connect we switch to the log tab to show you the connection. When you load a file we switch to 3D view. Load a file but 3D view is broken or disabled > we switch to Gcode editor tab for you. Always relevant context
This is Fantastic thanks!! I've tested this, if it were possible you could insert the fact that the close button closes (now I have to make several clicks) and that the alarm goes off after 3 seconds (or if I can set it, can you tell me how to do it? I tried to change the timeout but I'm doing something wrong ). It's seems like that are opened 15 screen of the same alert Furthermore, if possible, could it be made to work once the file has been loaded or even with a push button? so if I forget the parameters I can recall them Thank you very much and congratulations, super work!!
My guess is that you've clicked the macro button several times and its loaded the function several times. Its meant to be run once at startup, so edit the macro and select "Run Macro on startup". Save and restart Control. If you need to recall the info, click on the GCODE Editor tab. Its all the start of the file
Now done (V2.3) - thanks again. Getting started with Javascript Macros in CONTROL / Library of Macros created by the community
Just as well! I'm not sure if this is still required, but I finally got around to it in V2.1 Getting started with Javascript Macros in CONTROL / Library of Macros created by the community (* My excuse is that I don't like posting anything I haven't tested, and didn't have a working PC on my machine for a while.)