kopia lustrzana https://github.com/vilemduha/blendercam
enabled bridges and autobridges for more operations and meshes
Now meshes can generate autobridges too, and many 3d operations have bridges enabled, some will not work yet probably, but only the experimental ones...pull/62/head
rodzic
45aa751e0a
commit
3628f1d7c8
|
|
@ -441,18 +441,6 @@ class CAM_OPERATION_PROPERTIES_Panel(CAMButtonsPanel, bpy.types.Panel):
|
|||
layout.prop(ao,'dist_between_paths')
|
||||
layout.prop(ao,'movement_insideout')
|
||||
layout.prop(ao,'dont_merge')
|
||||
layout.prop(ao,'use_bridges')
|
||||
if ao.use_bridges:
|
||||
#layout.prop(ao,'bridges_placement')
|
||||
layout.prop(ao,'bridges_width')
|
||||
layout.prop(ao,'bridges_height')
|
||||
|
||||
layout.prop_search(ao, "bridges_group_name", bpy.data, "groups")
|
||||
#layout.prop(ao,'bridges_group_name')
|
||||
#if ao.bridges_placement == 'AUTO':
|
||||
# layout.prop(ao,'bridges_per_curve')
|
||||
# layout.prop(ao,'bridges_max_distance')
|
||||
layout.operator("scene.cam_bridges_add", text="Autogenerate bridges")
|
||||
elif ao.strategy=='WATERLINE':
|
||||
layout.prop(ao,'slice_detail')
|
||||
layout.prop(ao,'waterline_fill')
|
||||
|
|
@ -489,6 +477,20 @@ class CAM_OPERATION_PROPERTIES_Panel(CAMButtonsPanel, bpy.types.Panel):
|
|||
layout.prop(ao,'parallel_angle')
|
||||
|
||||
layout.prop(ao,'inverse')
|
||||
if ao.type!='POCKET' or ao.type!='DRILL' or ao.type !='CURVE' or ao.type != 'MEDIAL_AXIS':
|
||||
layout.prop(ao,'use_bridges')
|
||||
if ao.use_bridges:
|
||||
#layout.prop(ao,'bridges_placement')
|
||||
layout.prop(ao,'bridges_width')
|
||||
layout.prop(ao,'bridges_height')
|
||||
|
||||
layout.prop_search(ao, "bridges_group_name", bpy.data, "groups")
|
||||
#layout.prop(ao,'bridges_group_name')
|
||||
#if ao.bridges_placement == 'AUTO':
|
||||
# layout.prop(ao,'bridges_per_curve')
|
||||
# layout.prop(ao,'bridges_max_distance')
|
||||
layout.operator("scene.cam_bridges_add", text="Autogenerate bridges")
|
||||
|
||||
#elif ao.strategy=='SLICES':
|
||||
# layout.prop(ao,'slice_detail')
|
||||
#first attempt to draw object list for orientations:
|
||||
|
|
|
|||
|
|
@ -1983,9 +1983,9 @@ def addBridge(x,y,rot,sizex, sizey):
|
|||
def addAutoBridges(o):
|
||||
'''attempt to add auto bridges as set of curves'''
|
||||
getOperationSources(o)
|
||||
if not o.onlycurves:
|
||||
o.warnings+=('not curves')
|
||||
return;
|
||||
#if not o.onlycurves:
|
||||
# o.warnings+=('not curves')
|
||||
# return;
|
||||
bridgegroupname=o.bridges_group_name
|
||||
if bridgegroupname == '' or bpy.data.groups.get(bridgegroupname) == None:
|
||||
bridgegroupname = 'bridges_'+o.name
|
||||
|
|
@ -1994,26 +1994,28 @@ def addAutoBridges(o):
|
|||
o.bridges_group_name = bridgegroupname
|
||||
for ob in o.objects:
|
||||
|
||||
if ob.type=='CURVE':
|
||||
if ob.type=='CURVE' or ob.type=='TEXT':
|
||||
curve = curveToShapely(ob)
|
||||
#curve = shapelyToMultipolygon(curve)
|
||||
for c in curve:
|
||||
c=c.exterior
|
||||
minx, miny, maxx, maxy = c.bounds
|
||||
d1 = c.project(sgeometry.Point(maxx+1000, (maxy+miny)/2.0))
|
||||
p = c.interpolate(d1)
|
||||
g.objects.link( addBridge(p.x,p.y,-pi/2,o.bridges_width, o.cutter_diameter*1))
|
||||
d1 = c.project(sgeometry.Point(minx-1000, (maxy+miny)/2.0))
|
||||
p = c.interpolate(d1)
|
||||
g.objects.link( addBridge(p.x,p.y,pi/2,o.bridges_width, o.cutter_diameter*1))
|
||||
d1 = c.project(sgeometry.Point((minx + maxx)/2.0, maxy + 1000))
|
||||
p = c.interpolate(d1)
|
||||
g.objects.link( addBridge(p.x,p.y,0,o.bridges_width, o.cutter_diameter*1))
|
||||
d1 = c.project(sgeometry.Point((minx + maxx) / 2.0 , miny - 1000))
|
||||
p = c.interpolate(d1)
|
||||
g.objects.link( addBridge(p.x,p.y,pi,o.bridges_width, o.cutter_diameter*1))
|
||||
if ob.type == 'MESH':
|
||||
|
||||
curve = getObjectSilhouete('OBJECTS',[ob])
|
||||
#curve = shapelyToMultipolygon(curve)
|
||||
for c in curve:
|
||||
c=c.exterior
|
||||
minx, miny, maxx, maxy = c.bounds
|
||||
d1 = c.project(sgeometry.Point(maxx+1000, (maxy+miny)/2.0))
|
||||
p = c.interpolate(d1)
|
||||
g.objects.link( addBridge(p.x,p.y,-pi/2,o.bridges_width, o.cutter_diameter*1))
|
||||
d1 = c.project(sgeometry.Point(minx-1000, (maxy+miny)/2.0))
|
||||
p = c.interpolate(d1)
|
||||
g.objects.link( addBridge(p.x,p.y,pi/2,o.bridges_width, o.cutter_diameter*1))
|
||||
d1 = c.project(sgeometry.Point((minx + maxx)/2.0, maxy + 1000))
|
||||
p = c.interpolate(d1)
|
||||
g.objects.link( addBridge(p.x,p.y,0,o.bridges_width, o.cutter_diameter*1))
|
||||
d1 = c.project(sgeometry.Point((minx + maxx) / 2.0 , miny - 1000))
|
||||
p = c.interpolate(d1)
|
||||
g.objects.link( addBridge(p.x,p.y,pi,o.bridges_width, o.cutter_diameter*1))
|
||||
|
||||
mw=ob.matrix_world
|
||||
|
||||
def getBridgesPoly(o):
|
||||
if not hasattr(o, 'bridgespolyorig'):
|
||||
|
|
@ -2854,7 +2856,7 @@ def getPath3axis(context, operation):
|
|||
#return
|
||||
if o.strategy=='BLOCK' or o.strategy=='SPIRAL' or o.strategy=='CIRCLES' or o.strategy=='OUTLINEFILL':
|
||||
pathSamples=connectChunksLow(pathSamples,o)
|
||||
|
||||
|
||||
#print (minz)
|
||||
|
||||
|
||||
|
|
@ -2877,7 +2879,9 @@ def getPath3axis(context, operation):
|
|||
for ch in chunks:
|
||||
for vi in range(0,len(ch.points)):
|
||||
ch.points[vi]=(ch.points[vi][0],ch.points[vi][1],ch.points[vi][2]-o.carve_depth)
|
||||
|
||||
if o.use_bridges:
|
||||
for chunk in chunks:
|
||||
useBridges(chunk,o)
|
||||
chunksToMesh(chunks,o)
|
||||
|
||||
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue