solved Adapt origin setting of Z-Axis to mill positive depths

theaudiopile

Aktiver Benutzer
Member
Country flag
Is it possible to set the origin to the bottom of the work piece instead of the top? (My program will machine the thickness of the finished part.) I've tried a bunch of different layer naming options and it seems to still always cut into -Z. If not, a possible workaround could be to use an offset (like with a G55) maybe? Just looking for the best/simplest way to handle it. Thanks!
 

chrisko

Moderator
Staff member
Moderator
Country flag
Hi theaudiopile,
welcome to our new forum. Your the first one writing a thread here ....

I am sorry to say, but this is currently not possible. It will always cut in the -Z direction. It would be possible to start with positive values by setting the safe margin but it would start cutting at the slice depth (which is negative again). However one possibility would be to adapt the code for your purpose, which is always possible. If you open to do it for your purpose i can point you to the locations where to do it.

regards
Christian
 

theaudiopile

Aktiver Benutzer
Member
Country flag
Any pointers woud be a huge help. I'm very new to python (I've only written a few simple scripts for use in Rhinoceros/Grasshopper so far) so I don't know how well I'll do with it but if nothing else, it's a good way to learn something new!
 

chrisko

Moderator
Staff member
Moderator
Country flag
I will send you the points in the code, which i think are intersting / may be required to change. Please use the newest development version as a basis.

As a starting point where the code ist exported but i dont think you need to change here
dxf2gcode / SourceCode / [a35445] /source/dxf2gcode/postpro/postprocessor.py

I think you need to change only in this function
dxf2gcode / SourceCode / [a35445] /source/dxf2gcode/core/shape.py

check for the following variables, this should be the ones which are intersting for you:
Python:
Please, Log in or Register to view codes content!

I propose to change the Topic name to something more specific like: "Adapt origin setting of Z-Axis to mill positive depths". If you can't do it i will change it for if you agree ...
 

theaudiopile

Aktiver Benutzer
Member
Country flag
Unfortunately, I am unable to get the source to run on my system to test it:

File "dxf2gcode.py", line 1209, in <module>
from dxf2gcode_ui5 import Ui_MainWindow
ModuleNotFoundError: No module named 'dxf2gcode_ui5'
 

chrisko

Moderator
Staff member
Moderator
Country flag
Ok, i see. did you read the README :)
I know it's difficult to find in there, as it's very long, but you need to run the following commands first:
Code:
Please, Log in or Register to view codes content!

I think the second one generated the ui file. Since it's platform dependent its not part of the source, but you need to generate it first.
 

theaudiopile

Aktiver Benutzer
Member
Country flag
Ok, i see. did you read the README :)
I know it's difficult to find. But i think you need to run the following commands first:
Code:
Please, Log in or Register to view codes content!

I think the second one generated the ui file. Since it's platform dependent its not part of the source, but you need to generate it first.
I didn't realize that was a prerequisite, I was only following this part:

- Development:
For development/debugging purposes you may run the program directly from
the source code directory by typing (depending on operating system):
- Unix: $ python3 ./dxf2gcode.py
- Windows: python.exe ./dxf2gcode.py

After running both those commands dxf2gcode.py loaded up the GUI for me so I believe that part is sorted now.


Thanks!
 
Last edited:

theaudiopile

Aktiver Benutzer
Member
Country flag
I believe I've figured it out. It was just below the location you suggested in shape.py, I removed the negative from line 401 (depth = -abs(self.axis3_mill_depth):
Code:
Please, Log in or Register to view codes content!

For anyone trying this, one thing to note is the way this impacts the variables:
Z Retraction Area must be greater than your workpiece starting thickness (there is no warning for this if you're wrong)
Z Safety Margin same as above
Z Workpiece Top is the material thickness
Z Infeed Depth remains the same, it still functions as a depth per pass
Z Final Mill Depth is the Z height of the final mill plane instead of the depth of cut.

My use case is automated through the layer naming convention so I don't have any need for a safe Z check but for anyone using this method manually it may be worth adding in a few lines for that to save material/cutters/machinery from potentially getting ruined.

I'm just starting to test this more extensively, if I discover any further issues I'll post them up.

EDIT 1: It seems that the Z Safety Margin is not affected by the Automatic Tool Config Variable. I only ever use one clearance plane so I was able to set a default in Machine Config>Retraction Coordinate to sort that out for me.

Cheers!
 
Last edited:

chrisko

Moderator
Staff member
Moderator
Country flag
If thats really all, i think i can just change it in the development code. As it will still work for both ways, am i right?
 

theaudiopile

Aktiver Benutzer
Member
Country flag
If thats really all, i think i can just change it in the development code. As it will still work for both ways, am i right?
I think there would need to be an option to switch between the two, the behaviour is different enough that changing it would be an issue for most, if not everyone, already using it.
 

Users Who Are Viewing This Thread (Total: 1, Members: 0, Guests: 1)

Who Read This Thread (Total Members: 1)

Top