if True: param = { 'fileName': fileName, 'dxfTypes': ['LINE', 'ARC', 'CIRCLE'], 'layers': ['cable_hole'], 'depth': depth, 'startZ': startZ, 'safeZ': safeZ, 'toolDiam': toolDiam, 'direction': direction, 'cutterComp': 'inside', 'maxCutDepth': maxCutDepth, 'startDwell': startDwell, } circle = cnc_dxf.DxfCircBoundary(param) prog.add(circle) if True: param = { 'fileName': fileName, 'dxfTypes': ['LINE', 'ARC', 'CIRCLE'], 'layers': ['boundary'], 'depth': depth, 'startZ': startZ, 'safeZ': safeZ, 'toolDiam': toolDiam, 'direction': direction, 'cutterComp': 'outside', 'maxCutDepth': maxCutDepth, 'startDwell': startDwell,
prog.add(pocket) # inner boundary + duct hole innerParam = { 'fileName': fileName, 'layers': ['duct_hole', 'inner_boundary'], 'depth': depth, 'startZ': startZ, 'safeZ': safeZ, 'toolDiam': toolDiam, 'cutterComp': 'inside', 'direction': direction, 'maxCutDepth': maxCutDepth, 'startDwell': startDwell, } innerBoundary = cnc_dxf.DxfCircBoundary(innerParam) prog.add(innerBoundary) # outer boundary circles outerCircParam = { 'fileName': fileName, 'layers': ['outer_boundary_circ'], 'depth': depth, 'startZ': startZ, 'safeZ': safeZ, 'toolDiam': toolDiam, 'cutterComp': 'outside', 'direction': direction, 'maxCutDepth': maxCutDepth, 'startDwell': startDwell, }
prog.add(gcode_cmd.GenericStart()) prog.add(gcode_cmd.Space()) prog.add(gcode_cmd.FeedRate(feedrate)) param = { 'fileName': fileName, 'layers': ['M3_COUNTER_SINK'], 'depth': depth, 'startZ': startZ, 'safeZ': safeZ, 'overlap': overlap, 'overlapFinish': overlap, 'maxCutDepth': maxCutDepth, 'toolDiam': toolDiam, 'direction': direction, 'startDwell': startDwell, } if visualize: param['cutterComp'] = None pocket = cnc_dxf.DxfCircBoundary(param) else: pocket = cnc_dxf.DxfCircPocket(param) prog.add(pocket) prog.add(gcode_cmd.Space()) prog.add(gcode_cmd.End(), comment=True) baseName, dummy = os.path.splitext(__file__) fileName = '{0}.ngc'.format(baseName) print('generating: {0}'.format(fileName)) prog.write(fileName)
# Cut through holes if 1: layerNames = ['mount_carriage_thru_hole', 'mount_magnet_thru_hole'] param = { 'fileName': fileName, 'layers': layerNames, 'depth': thruDepth, 'startZ': startZ, 'safeZ': safeZ, 'toolDiam': toolDiam, 'toolOffset': 'inside', 'direction': direction, 'maxCutDepth': maxCutDepth, 'startDwell': startDwell, } boundary = cnc_dxf.DxfCircBoundary(param) prog.add(boundary) # Mill magnet pocket if 1: layerNames = ['adapter_magnet_pocket', 'guard_magnet_pocket'] param = { 'fileName': fileName, 'layers': layerNames, 'depth': magnetDepth, 'startZ': startZ, 'safeZ': safeZ, 'overlap': overlap, 'overlapFinish': overlapFinish, 'maxCutDepth': maxCutDepth, 'toolDiam': toolDiam,