Files
create/src/Mod/Path/PathScripts/nc/swap.py
sliptonic b67f6f1886 Extensive Path Workbench improvements.
Implement libarea improvements for profile
Implement libarea pocketing.
consolidate occ and libarea pocketing operation into one with algorithm
switch
consolidate occ aand libarea profile op into one with algorithm switch
add basic engraving operation.
Add rough UI for profile holding tags
implement holding tags for libarea profile.
implement basic defaults for depth settings.
First move in Drilling is rapid to clearance height.

UI needs lots of work but is usable.
2016-05-23 13:04:58 -03:00

55 lines
1.6 KiB
Python

################################################################################
# attach.py
#
# NC code creator for attaching Z coordinates to a surface
#
import recreator
import nc
swap = False
PUT_Y_VALUE_IN_A = 1
################################################################################
class Creator(recreator.Redirector):
def __init__(self, original, type, factor):
recreator.Redirector.__init__(self, original)
self.factor = factor
self.type = type
def feed(self, x=None, y=None, z=None, a=None, b=None, c=None):
if self.type == PUT_Y_VALUE_IN_A:
a = None
if y != None: a = y * self.factor
self.original.feed(x, None, z, a, b, c)
def rapid(self, x=None, y=None, z=None, a=None, b=None, c=None):
if self.type == PUT_Y_VALUE_IN_A:
a = None
if y != None: a = y * self.factor
self.original.rapid(x, None, z, a, b, c)
def arc(self, x=None, y=None, z=None, i=None, j=None, k=None, r=None, ccw = True):
# to do
pass
################################################################################
def use_a_for_y(radius):
cancel_swap()
if radius < 0.001:
return
global swap
radians_factor = 1 / radius
factor = radians_factor * 180 / 3.1415926535897932384
nc.creator = Creator(nc.creator, PUT_Y_VALUE_IN_A, factor)
swap = True
def cancel_swap():
global swap
if swap:
nc.creator = nc.creator.original
swap = False