kopia lustrzana https://github.com/vilemduha/blendercam
progress for OCL waterline
rodzic
b1a7f136ab
commit
69e5476966
|
|
@ -47,10 +47,10 @@ class AsyncOperatorMixin:
|
|||
|
||||
def show_progress(self,context,text, n,value_type):
|
||||
if n is not None:
|
||||
progress_text = f"{text},{n:.2f}{value_type}"
|
||||
progress_text = f"{text}: {n:.2f}{value_type}"
|
||||
else:
|
||||
progress_text = f"{text}"
|
||||
bpy.context.workspace.status_text_set(progress_text + " Press ESC to cancel")
|
||||
bpy.context.workspace.status_text_set(progress_text + " (Press ESC to cancel)")
|
||||
sys.stdout.write(f"Progress: {progress_text}\n")
|
||||
sys.stdout.flush()
|
||||
|
||||
|
|
|
|||
|
|
@ -697,7 +697,7 @@ async def getPath3axis(context, operation):
|
|||
elif o.strategy == 'WATERLINE' and o.optimisation.use_opencamlib:
|
||||
utils.getAmbient(o)
|
||||
chunks = []
|
||||
oclGetWaterline(o, chunks)
|
||||
await oclGetWaterline(o, chunks)
|
||||
chunks = limitChunks(chunks, o)
|
||||
if (o.movement.type == 'CLIMB' and o.movement.spindle_rotation == 'CW') or (
|
||||
o.movement.type == 'CONVENTIONAL' and o.movement.spindle_rotation == 'CCW'):
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ from cam.collision import BULLET_SCALE
|
|||
from cam import simple
|
||||
from cam.chunk import camPathChunk
|
||||
from cam.simple import *
|
||||
from cam.async_op import progress_async
|
||||
from shapely import geometry as sgeometry
|
||||
from .oclSample import get_oclSTL
|
||||
|
||||
|
|
@ -127,7 +128,7 @@ def oclGetMedialAxis(operation, chunks):
|
|||
waterlineChunksFromOCL(operation, chunks)
|
||||
|
||||
|
||||
def oclGetWaterline(operation, chunks):
|
||||
async def oclGetWaterline(operation, chunks):
|
||||
layers = oclWaterlineLayerHeights(operation)
|
||||
oclSTL = get_oclSTL(operation)
|
||||
|
||||
|
|
@ -155,8 +156,8 @@ def oclGetWaterline(operation, chunks):
|
|||
waterline.setSTL(oclSTL)
|
||||
waterline.setCutter(cutter)
|
||||
waterline.setSampling(0.1)#TODO: add sampling setting to UI
|
||||
for height in layers:
|
||||
print(str(height) + '\n')
|
||||
for count,height in enumerate(layers):
|
||||
await progress_async("Waterline",int((100*count)/len(layers)))
|
||||
waterline.reset()
|
||||
waterline.setZ(height * OCL_SCALE)
|
||||
waterline.run2()
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue