# some kind of dynamic and localized subdivision surface modifier - type algorithm?

In a previous, excellent answer it was proposed that it might be helpful to subdivide some triangles in my mesh at certain times during the animation to prevent them from overlapping adjacent faces when the mesh is very highly distorted. It's best to look at the question and answer there now.

OK you're back. The trajectory of the ~10,000 vertices of the original icosphere mesh are pre-calculated and stored in a NumPy array. A "badness" detector could search for highly stretched edges, but then what? If it inserted real vertices, I think it might be tricky to try to remove them later, and keep the rest lined up with NumPy. I could try to figure out a way to script that, but I wonder if there might be other ways, or possibly something existing in Blender already?

I am re-linking @TLousky 's image here:

• you warp this mesh so much that the points that where previously beside each-other are no longer neighbours, so while the topology is still valid.. it produces that wacky result. I think you might investigate how to triangulate this mesh using something like: n-e-r-v-o-u-s.com/blog/?p=3093 "Ball-Pivot algorithm" – zeffii Sep 6 '15 at 14:30
• That's a good point @zeffii , and link. The original task (section 8.1 here ) is supposed to be challenging to visualize, and it sure is. Ultimately need to keep the icosphere's original vertices in their correct place, but adding vertices is fine. I think Blender is incredibly useful and flexible, and can do just about anything, so long as StackExchange is here too! :) – uhoh Sep 7 '15 at 3:35
• These videos are not exactly what we're talking about here @zeffii but roughly this kind of thing. – uhoh Sep 7 '15 at 4:16
• It seems the paper suggests to do the deformation first, then make a heat map of the faces relative deformation (edge, surface area), then on a fresh icoshphere apply a new subdivision with relative weights according to the heat map produced, then deform that one. might be possible. see blender.stackexchange.com/questions/29106/tesselate-a-plane – zeffii Sep 7 '15 at 7:18
• "decimation" .. not subdivision. – zeffii Sep 7 '15 at 7:36

Well, as I originally suggested in the previous question, you can always try using the Remesh modifier. It dynamically generates a clean mesh with ~equal size quads out of the volume of your mesh.

I'd recommend using the smooth mode and an octtree depth of 7 or more to get accurate reconstruction of your mesh.

ADDED: It also helps to add a smooth modifier on top of the remesh modifier, because the mesh generated by the remesh modifier is still a but funky due to the issues with the original mesh.

myObject.select = True # Replace myObject with a reference to your actual mesh object
bpy.context.scene.objects.active = myObject

m = bpy.context.object.modifiers['Remesh']
m.mode         = 'SMOOTH'
m.octree_depth = 7


• This is interesting! I'm putting it just before the i_frame loop near line 100, but so far I get an error about context (I'm just using one of the two objects) I'll check to see if it works with the key_blocking or one of the other keyfaming methods in the three answers to this question. stay tuned..... – uhoh Sep 6 '15 at 13:03