seperate 3D and 2D case as two different module

2D and 3D geometry are very different where a lot of quick adn dirty
trick can be used just for 2D case.