How can I get a mesh facet with a given index? Essentially, I'd like to replace the for
loop through the facet iterator in the following code with something less wasteful:
mesh = Mesh('mymesh.xml')
mesh.init()
bbox = mesh.bounding_box_tree()
(idx, distance) = bbox.compute_closest_entitity(Point(1, 1, 1))
# Now it gets ugly:
it = facets(mesh)
for i in xrange(idx):
next(it)
my_facet = next(it)
Is there a way to do something like
my_facet = mesh.get_facet(idx)
instead?