You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a project where I call colorize_by_geodesic_distance_from_a_given_point several thousand times, varying depending on the mesh. I've been looking into multiprocessing approaches given that I have quite a bit of CPU headroom, which I still think may have some merit, but I have been encountering issues with pickling that I lack the background to understand well enough to troubleshoot. If anyone has any experience or advice with this, I'd love to talk further.
However, in the meantime, I have to believe that there are ways to more efficiently apply the filter within meshlab. This is my current code:
#find faces from vertsfacesFromVertDic= {}
faceArray=ms.mesh(currentMeshNum).face_matrix()
forface_index, faceintqdm(enumerate(faceArray)):
forvertex_indexinface:
facesFromVertDic.setdefault(vertex_index, []).append(face_index)
defmultiSortedClosestFacesToPoint(coords):
""" returns: [0]-faces , [1]-ordered verts """ms.apply_filter("colorize_by_geodesic_distance_from_a_given_point",
startpoint=[coords[0], coords[1], coords[2]],
maxdistance=maxGeodesicDist) # stores the verts within the search cutoff in quality arraypointsWithinDist=where(ms.mesh(currentMeshNum).vertex_quality_array() >0)[0]
sortingInds=ms.mesh(currentMeshNum).vertex_quality_array()[pointsWithinDist].argsort()
sortedpoints=pointsWithinDist[sortingInds]
# find all facesallfaces= []
forpointinpointsWithinDist:
forfaceinfacesFromVertDic[point]:
allfaces.append(face)
unOrderedFaces=unique(asarray(allfaces))
# order FacessortingRefList= []
faceMatrix=ms.mesh(currentMeshNum).face_matrix()
forfaceinunOrderedFaces:
verts=faceMatrix[face] # problem childvertsListIdx= [idxforidx, elementinenumerate(sortedpoints) ifelementinverts]
sortingRefList.append(vertsListIdx[0])
sortingInds=asarray(sortingRefList).argsort()
orderedFaces=unOrderedFaces[sortingInds]
print("complete")
returnorderedFaces, sortedpoints
I've done quite a bit of profiling and found the ms.apply_filter call to be the most time intensive, taking about .25 seconds per iteration all told. Any and all advice or thoughts would be much appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I'm working on a project where I call colorize_by_geodesic_distance_from_a_given_point several thousand times, varying depending on the mesh. I've been looking into multiprocessing approaches given that I have quite a bit of CPU headroom, which I still think may have some merit, but I have been encountering issues with pickling that I lack the background to understand well enough to troubleshoot. If anyone has any experience or advice with this, I'd love to talk further.
However, in the meantime, I have to believe that there are ways to more efficiently apply the filter within meshlab. This is my current code:
I've done quite a bit of profiling and found the ms.apply_filter call to be the most time intensive, taking about .25 seconds per iteration all told. Any and all advice or thoughts would be much appreciated.
Thank you!
Owen
Beta Was this translation helpful? Give feedback.
All reactions