kopia lustrzana https://github.com/vilemduha/blendercam
take vcarve angle into consideration for opencamlib
rodzic
4baab3bfb7
commit
6200ac0d6f
|
|
@ -1,7 +1,6 @@
|
|||
import os
|
||||
import ocl
|
||||
import tempfile
|
||||
import pyocl
|
||||
import camvtk
|
||||
|
||||
stl = camvtk.STLSurf(os.path.join(tempfile.gettempdir(), "model0.stl"))
|
||||
|
|
@ -13,6 +12,8 @@ camvtk.vtkPolyData2OCLSTL(stl_polydata, stl_surf)
|
|||
with open(os.path.join(tempfile.gettempdir(), 'ocl_settings.txt'), 'r') as csv_file:
|
||||
op_cutter_type = csv_file.readline().split()[0]
|
||||
op_cutter_diameter = float(csv_file.readline())
|
||||
if op_cutter_type == "VCARVE":
|
||||
op_cutter_tip_angle = float(csv_file.readline())
|
||||
op_minz = float(csv_file.readline())
|
||||
|
||||
cutter = None
|
||||
|
|
@ -23,7 +24,7 @@ if op_cutter_type == 'END':
|
|||
elif op_cutter_type == 'BALLNOSE':
|
||||
cutter = ocl.BallCutter(op_cutter_diameter * 1000, cutter_length)
|
||||
elif op_cutter_type == 'VCARVE':
|
||||
cutter = ocl.ConeCutter(op_cutter_diameter * 1000, 1, cutter_length)
|
||||
cutter = ocl.ConeCutter(op_cutter_diameter * 1000, op_cutter_tip_angle, cutter_length)
|
||||
else:
|
||||
print("Cutter unsupported: {0}\n".format(op_cutter_type))
|
||||
quit()
|
||||
|
|
|
|||
|
|
@ -6,11 +6,13 @@ stl = camvtk.STLSurf(tempfile.gettempdir() + "/model0.stl")
|
|||
stl_polydata = stl.src.GetOutput()
|
||||
stl_surf = ocl.STLSurf()
|
||||
camvtk.vtkPolyData2OCLSTL(stl_polydata, stl_surf)
|
||||
csv_file = open(tempfile.gettempdir() + '/ocl_settings.txt', 'r')
|
||||
op_cutter_type = csv_file.readline().split()[0]
|
||||
op_cutter_diameter = float(csv_file.readline())
|
||||
op_minz = float(csv_file.readline())
|
||||
csv_file.close();
|
||||
|
||||
with open(tempfile.gettempdir() + '/ocl_settings.txt', 'r') as csv_file:
|
||||
op_cutter_type = csv_file.readline().split()[0]
|
||||
op_cutter_diameter = float(csv_file.readline())
|
||||
if op_cutter_type == "VCARVE":
|
||||
op_cutter_tip_angle = float(csv_file.readline())
|
||||
op_minz = float(csv_file.readline())
|
||||
|
||||
cutter_length = 150
|
||||
if op_cutter_type == 'END':
|
||||
|
|
@ -18,7 +20,7 @@ if op_cutter_type == 'END':
|
|||
elif op_cutter_type == 'BALLNOSE':
|
||||
cutter = ocl.BallCutter(op_cutter_diameter * 1000, cutter_length)
|
||||
elif op_cutter_type == 'VCARVE':
|
||||
cutter = ocl.ConeCutter(op_cutter_diameter * 1000, 1, cutter_length)
|
||||
cutter = ocl.ConeCutter(op_cutter_diameter * 1000, op_cutter_tip_angle, cutter_length)
|
||||
else:
|
||||
print("Cutter unsupported: " + op_cutter_type + '\n')
|
||||
quit()
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ def operationSettingsToCSV(operation):
|
|||
with open(os.path.join(tempfile.gettempdir(), 'ocl_settings.txt'), 'w') as csv_file:
|
||||
csv_file.write("{}\n".format(operation.cutter_type))
|
||||
csv_file.write("{}\n".format(operation.cutter_diameter))
|
||||
if operation.cutter_type == "VCARVE":
|
||||
csv_file.write("{}\n".format(operation.cutter_tip_angle))
|
||||
csv_file.write("{}\n".format(operation.minz))
|
||||
|
||||
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue