diff --git a/src/GeometryEvaluator.cc b/src/GeometryEvaluator.cc index a6a95f2d..c95bd279 100644 --- a/src/GeometryEvaluator.cc +++ b/src/GeometryEvaluator.cc @@ -436,7 +436,7 @@ Response GeometryEvaluator::visit(State &state, const RenderNode &node) else if (shared_ptr N = dynamic_pointer_cast(geom)) { // If we got a const object, make a copy shared_ptr newN; - if (res.isConst()) newN.reset(new CGAL_Nef_polyhedron(*N)); + if (res.isConst()) newN.reset(N->copy()); else newN = dynamic_pointer_cast(res.ptr()); newN->setConvexity(node.convexity); geom = newN; @@ -552,7 +552,7 @@ Response GeometryEvaluator::visit(State &state, const TransformNode &node) assert(N); // If we got a const object, make a copy shared_ptr newN; - if (res.isConst()) newN.reset(new CGAL_Nef_polyhedron(*N)); + if (res.isConst()) newN.reset(N->copy()); else newN = dynamic_pointer_cast(res.ptr()); newN->transform(node.matrix); geom = newN; @@ -969,7 +969,7 @@ Response GeometryEvaluator::visit(State &state, const CgaladvNode &node) if (N) { // If we got a const object, make a copy shared_ptr newN; - if (res.isConst()) newN.reset(new CGAL_Nef_polyhedron(*N)); + if (res.isConst()) newN.reset(N->copy()); else newN = dynamic_pointer_cast(res.ptr()); applyResize3D(*newN, node.newsize, node.autosize); geom = newN;