kopia lustrzana https://github.com/vilemduha/blendercam
Solution for using prepared geometry when packing curves
Left the old code commented until this gets further testing. Using prepared geometry is about 30% faster on my machine.pull/44/head
rodzic
e1f2d84f48
commit
cba5c83b99
|
@ -86,8 +86,8 @@ def packCurves():
|
|||
polyfield.append([[0,0],0.0,poly,ob,z])
|
||||
random.shuffle(polyfield)
|
||||
#primitive layout here:
|
||||
allpoly=sgeometry.Polygon()#main collision poly.
|
||||
|
||||
allpoly=prepared.prep(sgeometry.Polygon())#main collision poly.
|
||||
#allpoly=sgeometry.Polygon()#main collision poly.
|
||||
|
||||
shift=0.0015#one milimeter by now.
|
||||
rotchange=.3123456#in radians
|
||||
|
@ -137,7 +137,8 @@ def packCurves():
|
|||
#print(iter,p.bounds)
|
||||
|
||||
if xmin>0 and ymin>0 and ((direction=='Y' and xmax<sheetsizex) or (direction=='X' and ymax<sheetsizey)):
|
||||
if allpoly.disjoint(ptrans):
|
||||
if not allpoly.intersects(ptrans):
|
||||
#if allpoly.disjoint(ptrans):
|
||||
#print('gothit')
|
||||
#we do more good solutions, choose best out of them:
|
||||
hits+=1
|
||||
|
@ -192,9 +193,9 @@ def packCurves():
|
|||
'''
|
||||
#allpoly=npoly
|
||||
placedpolys.append(ptrans)
|
||||
#allpoly=prepared.prep(sgeometry.MultiPolygon(placedpolys))
|
||||
allpoly=prepared.prep(sgeometry.MultiPolygon(placedpolys))
|
||||
#*** temporary fix until prepared geometry code is setup properly
|
||||
allpoly=sgeometry.MultiPolygon(placedpolys)
|
||||
#allpoly=sgeometry.MultiPolygon(placedpolys)
|
||||
|
||||
#polygon_utils_cam.polyToMesh(allpoly,0.1)#debug visualisation
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue