Diary #1 – Looking through a Boost.Python project; Mesh repair

This is the start of my attempt to write a daily account of the things I do. There won’t be much in-depth detail in these diaries, and I’m mostly writing for myself so that I have some sort of continuity of thought that persists beyond one day, so I’ll put Diary in the title to make it easy for you, the reader, to quickly skip these if you want.

I have been looking into Boost.Python recently and today I looked at the CGAL Python Bindings project. In retrospect, I should have known when I saw the handmade Makefile and instructions for the previous major version of CGAL that I was getting into some old, unmaintained code. On the other hand, it is a good thing I went through the exercise of going through the code and compiling some parts of it. For future reference, the current Python wrapper project for CGAL is actually called cgal-bindings and actually uses SWIG. I still don’t really want to get into SWIG because it’s another thing I have to learn, and my project already incorporates Boost so I’ll stick to that.

The other thing that I spent most of my time on was repairing the skull meshes that we have in the lab. A lot of these meshes have twists, tangles, and foldovers that are really gnarly and I didn’t know how to deal with them until recently I learned a thing or two about Blender. I remember when I first opened Blender up, couldn’t find a way to import my .off file, and just wanted to close it and be done with it. Now, I know enough to be able to do what I want as far as untangling these contorted meshes. I repaired 7 today, and I think I can finish the remaining 10 tomorrow.

twistedMesh

Above is an example of a gnarly part of the monkey skull mesh. What happened is that a narrow U-shaped patch actually crossed over on itself to become something like the lowercase Greek letter gamma. Here, you’re looking at it from the side, and the highlighted triangles indicate where two faces intersect with each other — this doesn’t happen in reality, so I have to manually pull them apart. Of course, the other gnarly part is the sharp triangles along the ridge line. I write a program to flatten meshes, but it blows up if the input mesh has such configuration of triangles.

untwistedMesh

Here’s an example of what I’m able to do through Blender now. I can pull the sides apart so that the self-intersections go away, and I can clean up the tuft of triangles along the ridge. It takes a bit of time, and it’s up to you to rebuild the shape in a reasonable way. But I’m glad that I can fix it now. I might make a video to demonstrate the technique at some point.

I didn’t get to read as much as I wanted to today. I have a paper on my stack about LDDMM and hippocampus shape that looks interesting, so I’ll read it tomorrow. For general reading, I’ve been saying that I want to get back into reading Chinese, but I’m sick of just reading the news. I bookmarked two blog portals (here and here) that my friends linked articles from on Facebook. I’ll probably spend a bit of time just browsing for a blog or two in a category I’m interested in tomorrow.

Advertisements