Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Firechief on January 08, 2018, 02:47:57 PM

Title: Tool Finding
Post by: Firechief on January 08, 2018, 02:47:57 PM
I heed some help with finding the current tool edge. I working on a XYZ 0. I got it to find XYZ 0 but the setting is to the side (XY) of the tool not the center. Any help with the lua code would be great.
Thanks

Title: Re: Tool Finding
Post by: Chaoticone on January 08, 2018, 04:12:22 PM
This should help

https://www.youtube.com/watch?v=VA49atQNzmg
Title: Re: Tool Finding
Post by: Firechief on January 09, 2018, 09:20:05 AM
I,m working in the Lua code with a coroutine. Got everything working finding all XYZ just need to get the center of the bit not the edge on the XY.
Thanks for your help
Title: Re: Tool Finding
Post by: DazTheGas on January 10, 2018, 04:10:30 AM
You can get the center of the tool by using

Code: [Select]
local center = mc.mcToolGetData(inst, mc.MTOOL_MILL_RAD, 1);
assuming you are using the tooltable, from here you can add or subtract it to your XY Coords

DazTheGas
Title: Re: Tool Finding
Post by: Firechief on January 12, 2018, 11:18:42 PM
Thank for the help...
I got this to work