Rotation of a mesh. dolfin::Mesh::rotate

Issue #909 new
Óscar Crego created an issue

If I do the rotation of 90 degrees around all axis I hope to get the original postition but it is not so.

    mesh_solid = BoxMesh(p_init,p_fin,10,10,10)
    file = File("./rot.pvd")
    U = FunctionSpace(mesh_solid, "CG", 1)
    u1 = Function(U)
    u1.interpolate(Expression('x[1]', degree=1))
    file << (u1, 0.0)
    for i in range(3):
        mesh_solid.rotate(90.0,i, Point(np.array([0.0,0.0,0.0])))
    file << (u1, 1.0)

I found that the rotation around y-axis is clockwise while around x-axis and z-axis are counter-clockwise. I think that the mistake is in the line 167 of /dolfin/mesh/MeshTransformation.cpp, this line should be

 R00 = S00; R02 = S10; R20 = S01; R22 = S11;

instead of

R00 = S00; R02 = S01; R20 = S10; R22 = S11;

Comments (1)

  1. Log in to comment