kopia lustrzana https://github.com/vilemduha/blendercam
fixed silhouette getting
rodzic
cdefe77546
commit
5619be07dd
|
@ -625,10 +625,20 @@ async def medial_axis(o):
|
|||
ob.data.resolution_u = 64
|
||||
|
||||
polys = utils.getOperationSilhouete(o)
|
||||
mpoly = sgeometry.shape(polys)
|
||||
if isinstance(polys, list):
|
||||
if len(polys)==1 and isinstance(polys[0],shapely.MultiPolygon):
|
||||
mpoly=polys[0]
|
||||
else:
|
||||
mpoly=sgeometry.MultiPolygon(polys)
|
||||
elif isinstance(polys,shapely.MultiPolygon):
|
||||
# just a multipolygon
|
||||
mpoly=polys
|
||||
else:
|
||||
raise CamException("Failed getting object silhouette. Is input curve closed?")
|
||||
|
||||
mpoly_boundary = mpoly.boundary
|
||||
ipol = 0
|
||||
for poly in polys.geoms:
|
||||
for poly in mpoly.geoms:
|
||||
ipol = ipol + 1
|
||||
schunks = shapelyToChunks(poly, -1)
|
||||
schunks = chunksRefineThreshold(schunks, o.medial_axis_subdivision,
|
||||
|
|
|
@ -675,6 +675,7 @@ async def sampleChunksNAxis(o, pathSamples, layers):
|
|||
lastrunchunks.append([])
|
||||
n = 0
|
||||
|
||||
last_percent=-1
|
||||
lastz = minz
|
||||
for patternchunk in pathSamples:
|
||||
# print (patternchunk.endpoints)
|
||||
|
@ -689,7 +690,6 @@ async def sampleChunksNAxis(o, pathSamples, layers):
|
|||
# for t in range(0,threads):
|
||||
# print(len(patternchunk.startpoints),len( patternchunk.endpoints))
|
||||
spl = len(patternchunk.startpoints)
|
||||
last_percent=-1
|
||||
for si in range(0, spl): # ,startp in enumerate(patternchunk.startpoints):
|
||||
# #TODO: seems we are writing into the source chunk ,
|
||||
# and that is why we need to write endpoints everywhere too?
|
||||
|
@ -1334,7 +1334,7 @@ def getObjectSilhouete(stype, objects=None, use_modifiers=False):
|
|||
print(time.time() - t)
|
||||
|
||||
t = time.time()
|
||||
silhouete = p # [polygon_utils_cam.Shapely2Polygon(p)]
|
||||
silhouete = [p] # [polygon_utils_cam.Shapely2Polygon(p)]
|
||||
|
||||
return silhouete
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue