diff --git a/Implicit.hpp b/Implicit.hpp index 08d86e4..113c268 100644 --- a/Implicit.hpp +++ b/Implicit.hpp @@ -6,7 +6,7 @@ class ImplicitSurface { public: virtual double operator() (double x, double y, double z) const = 0; double operator()(const Point& pt) const; - Point getCenter() { return center;} + Point getCenter() const { return center;} protected: Point center; ImplicitSurface(Point _center) : center(_center) {} diff --git a/MarchingCubes.cpp b/MarchingCubes.cpp index 22cd064..c46f936 100644 --- a/MarchingCubes.cpp +++ b/MarchingCubes.cpp @@ -19,6 +19,7 @@ Mesh MarchingCubes::operator()() { Mesh output; without_hints(output); + output.translate(surface.getCenter()); return output; }