I am thinking about passing a small sphere and gradually inflate it to check which vertices in include and same time checking the distance from the sphere. If the center seems to be in the middle of two or more vertices, I can consider it a point in the approximate medial axis. How does the idea sound? Could any one give some more input about this or whether any simpler suggestion available? I know this is a trial and error methos. Thanks
Your idea sounds like it will work but you need to repeat it at intervals down the intestine and you would have to decide what is a good step size. My idea is basically the same except I would project a ray looking for a collision and then use a "hunt and peck" algorithm to find the next ray direction, keeping the longest ray as the next direction to follow. Combining the two may be even better where you calculate the ray length by using a sphere to following that ray until it collides with a intestine.
If this code only has to work for a specific model it is probably better to load the .obj into a 3d package and manually trace a path through it and export that path.
Thank you very much for the suggestion. Could you mention some 3D package convenient to deal with this model? I heard about blender, but never used it.
Blend is free and works fine. Carrara is cheap and quite good. Maya, 3D Studio are excellent and ridiculously expensive.
I'd try something like:
1) remove all duplicate vertices
2) manually choose several triangles from the start of the intestine, which form a ring
3) repeat until no triangles left:
3.1) pick the nearby triangle (which shares an edge edge with the previous triangle), which shares edges with as many known triangles.
3.2) average the vertex positions of the last 3-4 triangles marked. Insert that position as a new camera position keyframe.
3.3) optionally filter the resulting positions from 3.2, by removing keys that jump too forward. (if the next key is effectively moving the camera back).
Thanks every body for the suggestion. I want to start from some open edge as vertices at the open edge will form a ring and gradually stripping the vertices and creating new set of open edges.
But I need to do some pre processing to find the open edge at the very beginning. I would like to use Maya though I have never used it before for preprocessing purpose. I have attached one picture of my wire-framed model displayed using meshlab. I would like to disconnect those particular vertice-set as shown in figure and then start processing from that open edge. If I use Maya, can I do that kind of preprocessing and save that pre-processed model? Please let me know. As I never used any of these kind of tools, I am a bit worried whether it would be complicated to use it. Also I have limited time frame to submit my project.
I have not used Maya but all modelling tools have the ability to select a set of polygons (triangles) from a mesh and delete them; and all of them will export .objs