Finding a polygon island

From The Foundry MODO SDK wiki
Revision as of 09:56, 26 November 2015 by GwynneR (Talk | contribs)

Jump to: navigation, search


Find a polygon island starting with a single selected polygon (TD SDK).


import modo
# Get the selected mesh
m = modo.Mesh()
# And the selected polyons
queue = list(m.geometry.polygons.selected)
island = set()
while queue:
	poly = queue.pop()
	if not poly in island:
		queue.extend( poly.neighbours ) list(island), True )