kopia lustrzana https://github.com/vilemduha/blendercam
-ramps now work with pattern operations(parallel, spiral, e.t.c.) but with many bugs now...
rodzic
56115abed9
commit
20271996d5
|
|
@ -309,7 +309,7 @@ class camOperation(bpy.types.PropertyGroup):
|
|||
use_layers = bpy.props.BoolProperty(name="Use Layers",description="Use layers for roughing", default=True, update = updateRest)
|
||||
stepdown = bpy.props.FloatProperty(name="Step down", default=0.01, min=0.00001, max=32,precision=PRECISION, unit="LENGTH", update = updateRest)
|
||||
first_down = bpy.props.BoolProperty(name="First down",description="First go down on a contour, then go to the next one", default=False, update = updateRest)
|
||||
contour_ramp = bpy.props.BoolProperty(name="Ramp contour - EXPERIMENTAL",description="Ramps down the whole contour, so the cutline looks like helix", default=False, update = updateRest)
|
||||
ramp = bpy.props.BoolProperty(name="Ramp in - EXPERIMENTAL",description="Ramps down the whole contour, so the cutline looks like helix", default=False, update = updateRest)
|
||||
ramp_out = bpy.props.BoolProperty(name="Ramp out - EXPERIMENTAL",description="Ramp out to not leave mark on surface", default=False, update = updateRest)
|
||||
ramp_in_angle = bpy.props.FloatProperty(name="Ramp in angle", default=math.pi/6, min=0, max=math.pi*0.4999 , precision=1, subtype="ANGLE" , unit="ROTATION" , update = updateRest)
|
||||
ramp_out_angle = bpy.props.FloatProperty(name="Ramp out angle", default=math.pi/6, min=0, max=math.pi*0.4999 , precision=1, subtype="ANGLE" , unit="ROTATION" , update = updateRest)
|
||||
|
|
@ -1552,13 +1552,7 @@ class CAM_MOVEMENT_Panel(CAMButtonsPanel, bpy.types.Panel):
|
|||
if ao.strategy=='CUTOUT':
|
||||
layout.prop(ao,'first_down')
|
||||
#if ao.first_down:
|
||||
layout.prop(ao,'contour_ramp')
|
||||
if ao.contour_ramp:
|
||||
layout.prop(ao,'ramp_in_angle')
|
||||
layout.prop(ao,'ramp_out')
|
||||
if ao.ramp_out:
|
||||
|
||||
layout.prop(ao,'ramp_out_angle')
|
||||
|
||||
if ao.strategy=='POCKET':
|
||||
layout.prop(ao,'helix_enter')
|
||||
if ao.helix_enter:
|
||||
|
|
@ -1568,7 +1562,14 @@ class CAM_MOVEMENT_Panel(CAMButtonsPanel, bpy.types.Panel):
|
|||
if ao.retract_tangential:
|
||||
layout.prop(ao,'retract_radius')
|
||||
layout.prop(ao,'retract_height')
|
||||
|
||||
layout.prop(ao,'ramp')
|
||||
if ao.ramp:
|
||||
layout.prop(ao,'ramp_in_angle')
|
||||
layout.prop(ao,'ramp_out')
|
||||
if ao.ramp_out:
|
||||
|
||||
layout.prop(ao,'ramp_out_angle')
|
||||
|
||||
layout.prop(ao,'stay_low')
|
||||
layout.prop(ao,'protect_vertical')
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ class camPathChunk:
|
|||
#self.unsortedchildren=False
|
||||
self.sorted=False#if the chunk has allready been milled in the simulation
|
||||
self.length=0;#this is total length of this chunk.
|
||||
self.zstart=0# this is stored for ramps mainly, because they are added afterwards, but have to use layer info
|
||||
self.zend=0#
|
||||
|
||||
def copy(self):
|
||||
nchunk=camPathChunk([])
|
||||
|
|
@ -228,11 +230,12 @@ class camPathChunk:
|
|||
return chunk
|
||||
|
||||
def rampZigZag(self,zstart,zend,o):
|
||||
chunk=camPathChunk([])
|
||||
#print(zstart,zend)
|
||||
if zend<zstart:#this check here is only for stupid setup, when the chunks lie actually above operation start z.
|
||||
stepdown=zstart-zend
|
||||
ch=self
|
||||
chunk=camPathChunk([])
|
||||
|
||||
estlength=(zstart-zend)/tan(o.ramp_in_angle)
|
||||
ch.getLength()
|
||||
ramplength=estlength
|
||||
|
|
@ -247,7 +250,7 @@ class camPathChunk:
|
|||
else:
|
||||
zigzagtraveled=0.0
|
||||
haspoints=False
|
||||
ramppoints=[(ch.points[0][0],ch.points[0][1],max(ch.points[0][1],zstart))]
|
||||
ramppoints=[(ch.points[0][0],ch.points[0][1],ch.points[0][2])]
|
||||
i=1
|
||||
while not haspoints:
|
||||
p1=ramppoints[-1]
|
||||
|
|
@ -279,11 +282,11 @@ class camPathChunk:
|
|||
traveled+=d
|
||||
ratio=traveled/ramplength
|
||||
znew=zstart-stepdown*ratio
|
||||
chunk.points.append((p2[0],p2[1],max(ch.points[0][1],znew)))#max value here is so that it doesn't go below surface in the case of 3d paths
|
||||
chunk.points.append((p2[0],p2[1],max(p2[2],znew)))#max value here is so that it doesn't go below surface in the case of 3d paths
|
||||
|
||||
chunks = setChunksZ([ch],zend)
|
||||
chunk.points.extend(chunks[0].points)
|
||||
return chunk
|
||||
#chunks = setChunksZ([ch],zend)
|
||||
chunk.points.extend(ch.points)
|
||||
return chunk
|
||||
#def appendChunk(sorted,ch,o,pos)
|
||||
|
||||
def chunksCoherency(chunks):
|
||||
|
|
|
|||
|
|
@ -395,6 +395,10 @@ def sampleChunks(o,pathSamples,layers):
|
|||
chunks=[]
|
||||
|
||||
for i,l in enumerate(layers):
|
||||
if o.ramp:
|
||||
for ch in layerchunks[i]:
|
||||
ch.zstart=layers[i][0]
|
||||
ch.zend=layers[i][1]
|
||||
chunks.extend(layerchunks[i])
|
||||
timingadd(totaltime)
|
||||
timingprint(samplingtime)
|
||||
|
|
@ -2378,7 +2382,7 @@ def getPath3axis(context,operation):
|
|||
chunk.setZ(layer[1])
|
||||
|
||||
|
||||
if o.contour_ramp:#add ramps
|
||||
if o.ramp:#add ramps
|
||||
for chl in extendorder:
|
||||
chunk=chl[0]
|
||||
layer=chl[1]
|
||||
|
|
@ -2490,7 +2494,7 @@ def getPath3axis(context,operation):
|
|||
#if bpy.app.debug_value==1:
|
||||
|
||||
|
||||
chunksFromCurve=sortChunks(chunksFromCurve,o)
|
||||
chunksFromCurve=sortChunks(chunksFromCurve,o)
|
||||
|
||||
chunks=[]
|
||||
if o.use_layers:
|
||||
|
|
@ -2672,6 +2676,10 @@ def getPath3axis(context,operation):
|
|||
|
||||
if ((o.strategy=='PARALLEL' or o.strategy=='CROSS') or o.strategy=='PENCIL'):# and not o.parallel_step_back:
|
||||
chunks=sortChunks(chunks,o)
|
||||
if o.ramp:
|
||||
for ch in chunks:
|
||||
nchunk = ch.rampZigZag(ch.zstart, ch.points[0][2],o)
|
||||
ch.points=nchunk.points
|
||||
#print(chunks)
|
||||
if o.strategy=='CARVE':
|
||||
for ch in chunks:
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue