Hello Guest it is March 28, 2024, 08:34:17 AM

Author Topic: Rotational offset on Z plane  (Read 11561 times)

0 Members and 1 Guest are viewing this topic.

Rotational offset on Z plane
« on: December 01, 2010, 01:18:57 PM »
I've always thought that it would be handy to have a button on screen that would rotate the part in Mach.  That way if it doesn't fit in the space intended on the sheet it could be rotated on the shop floor to match the material without generating a new g-code file.  Is this possible?  I know you can do work offsets, but I'm not sure about setting offsets that would effectively rotate the part on the Z plane.  A quick test shows that simply swapping x of y and y for x in the code effectively rotates the part 90 degrees, so one not so elegant solution would be to go through the loaded g-code file, swap it's contents over to a teach file swapping x or y and y for x, then loading the teach file.

Offsets would be so much cooler.
Re: Rotational offset on Z plane
« Reply #1 on: December 01, 2010, 01:20:46 PM »
Now that I think of it, I'm not sure there is even a way to read a file line by line in VB Script.  Is there a way?

EDIT:  Looks like you can use regular VB Script in Mach.  Don;t know why, but I was thinking mach used it's own limited subset of the language. 
« Last Edit: December 01, 2010, 01:36:23 PM by rrc1962 »

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Rotational offset on Z plane
« Reply #2 on: December 01, 2010, 01:45:22 PM »
How about just using the G68 Corrd rotation(;-) to rotate the part.

Just a thought, (;-) TP
Re: Rotational offset on Z plane
« Reply #3 on: December 01, 2010, 03:07:17 PM »
I created a DRO box, I just type in the angle I want, or
I also have a probing routine that finds the angle by touching off two sides and computes it for me, then moves to the new 0,0 point

So it is possible, though it can get confusing watching the numbers on the screen, ;)
« Last Edit: December 01, 2010, 03:10:01 PM by Ya-Nvr-No »
Re: Rotational offset on Z plane
« Reply #4 on: December 01, 2010, 03:11:09 PM »
Exactly what I was looking for.  Thank very much.

Is there a way to get the X an Y bounds of a part file so you could rotate on the center of the part?

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Rotational offset on Z plane
« Reply #5 on: December 01, 2010, 04:23:50 PM »
You can use the program extents.  X min/max Ymin/max But that does not always give you the geometric center of the part just the center of the program.

(;-) TP
Re: Rotational offset on Z plane
« Reply #6 on: December 01, 2010, 06:20:39 PM »
Once I have the 0,0 (lower left corner) point,  I have a routine that finds the center of a block/rectangle  based on its rough size, and then makes a new 0,0 point to the center coordinates. There is always a way to get what you want. That's why we love this program, even with the minor issues. It just keeps getting better with everyone's input.
Re: Rotational offset on Z plane
« Reply #7 on: December 01, 2010, 09:07:17 PM »
I've got it working great.  The only problem is that Mach doesn't play well with IJ arcs and circles after a G68.  I found a post that said that R mode arcs work fine.  Just don't know if it's worth all that just to rotate the part.  Most, if not all of my part files have IJ arcs.
Re: Rotational offset on Z plane
« Reply #8 on: December 02, 2010, 06:06:22 AM »
Hi, Can you not tweak your post processor to only use the R word for arcs. That is just what I have had to do for my -1 scaling problem. I was able to find the place in the pp that determined the type of code to use for arcs and changed it accordingly.

Mike
Re: Rotational offset on Z plane
« Reply #9 on: December 02, 2010, 09:38:00 AM »
Yes, I can, but I'm told that R has some accuracy issues at certain angles.