adapted from Dennis Luebke's qtetramesher code, to use static sofa libs