Cura 在切片过程中将浮动打印投射到构建板上
3D打印
ultimaker-cura
多材料
2021-05-03 19:31:20
1个回答
我一直在玩这个并想出了一个解决方案,所以我想我会分享,以防其他人将来遇到这个问题。在 Ultimaker Cura 中,我在切割零件之前启用了支撑和 z-hopping,然后我运行了这个 Python 函数来移除支撑并设置挤出机。
import re
def float_part(file):
printString = ';LAYER:'
partString = ';(.*?).stl'
with open( file , 'r') as content_file:
content = content_file.read()
printArea = re.search( printString , content ).span(0)[0]
partArea = re.search( partString , content ).span(0)[0]
uncommentedLine = partArea - re.search( '\n.*?(?<!;)\n' , content[ partArea:printArea:-1 ] ).span(0)[0]
lastExtrusion = uncommentedLine - re.search( 'E' , content[ uncommentedLine:printArea:-1 ] ).span(0)[0]
secondLastExtrusion = lastExtrusion - re.search( 'E' , content[ lastExtrusion-1:printArea:-1 ] ).span(0)[0]
lastExtrusionAmount = float(re.search( '\d+(\.\d+)?', content[lastExtrusion:] ).group(0))
secondLastExtrusionAmount = float(re.search( '\d+(\.\d+)?', content[secondLastExtrusion:] ).group(0))
ResetCommand = '\nG92 E' + str(lastExtrusionAmount) + '\n'
with open( file , 'w') as content_file:
content_file.write( content[0:printArea] + ResetCommand + content[uncommentedLine:] )