I’m new to this forum, but have been using Blender and Python now for a few years. I am not a trained programmer (but simply an engineer with a lot of programming background). I recently wrote a script up for work using Blender & Python that is used for edge and feature detection based on a number of methods. I’m returning a number of important edges by selecting them in the bmesh object. (I’ll try and post code if I am permitted (because someone is paying me to do this it is considered their property…))
I am having issues with the next step: I need to sort these edges into small lists of edges that are joined. Currently I’m doing this by asking for a length comparison of the set operation done on the verts ids belonging to the list of all edges except current and the current list of edges. I gain lists by simply making each individual edge a list and slowly joining all the other lists together, until there are no more shared verts (i.e. everything has been grouped).
#PSEUDO CODE
while (all edges not grouped):
current_edges = edge_groups[0]
for i in range(0, len(egde_groups)):
current_verts = get_verts(current_edges)
other_verts = get_verts(edges_to_compare)
if len(set(current_verts).intersection(other_verts)):
group the lists (making sure not to duplicate groups)
reset the current_edges if current_edges has been changed...etc
#BECAUSE WE NOW MAY HAVE A NEW CONNECTION POINT
if current_edges is last in final list:
break
The problem is that when the mesh gets large or slightly “soft featured” this takes forever!
I’ve tried implementing a multicore solution using multiprocessing Python modules to split the initially selected edges into a number of smaller groups, but sadly I have Windows at work. Windows, as I have found, has an issue forking the process. (I would post a link to another forum thread for reference…but there are restrictive noob rules).
So now my question(s):
Is there a way around the Windows multicore issue with Blender-Python? (Keep in mind I’m not an admin at my workplace). If not, is there an easier/ less computationally intensive way to find groupings of edges in a set of predefined edges that which connected?