FreeCAD/src/Mod/Path/PathScripts/depth_params.py
sliptonic 940f52db90 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

32 lines
1.4 KiB
Python

import math
class depth_params:
def __init__(self, clearance_height, rapid_safety_space, start_depth, step_down, z_finish_depth, z_thru_depth, final_depth, user_depths):
self.clearance_height = clearance_height
self.rapid_safety_space = math.fabs(rapid_safety_space)
self.start_depth = start_depth
self.step_down = math.fabs(step_down)
self.z_finish_depth = math.fabs(z_finish_depth)
self.z_thru_depth = math.fabs(z_thru_depth)
self.final_depth = final_depth
self.user_depths = user_depths
def get_depths(self):
if self.user_depths != None:
depths = self.user_depths
else:
depth = self.final_depth - self.z_thru_depth
depths = [depth]
depth += self.z_finish_depth
if depth + 0.0000001 < self.start_depth:
if self.z_finish_depth > 0.0000001: depths.insert(0, depth)
depth += self.z_thru_depth
layer_count = int((self.start_depth - depth) / self.step_down - 0.0000001) + 1
if layer_count > 0:
layer_depth = (self.start_depth - depth)/layer_count
for i in range(1, layer_count):
depth += layer_depth
depths.insert(0, depth)
return depths