mirror of https://github.com/vitalif/openscad
bugfix: When trying to copy Nef polyhderons, we were just copying pointers, defeating the const
parent
fbcb807463
commit
1b77d945be
|
@ -436,7 +436,7 @@ Response GeometryEvaluator::visit(State &state, const RenderNode &node)
|
|||
else if (shared_ptr<const CGAL_Nef_polyhedron> N = dynamic_pointer_cast<const CGAL_Nef_polyhedron>(geom)) {
|
||||
// If we got a const object, make a copy
|
||||
shared_ptr<CGAL_Nef_polyhedron> newN;
|
||||
if (res.isConst()) newN.reset(new CGAL_Nef_polyhedron(*N));
|
||||
if (res.isConst()) newN.reset(N->copy());
|
||||
else newN = dynamic_pointer_cast<CGAL_Nef_polyhedron>(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<CGAL_Nef_polyhedron> newN;
|
||||
if (res.isConst()) newN.reset(new CGAL_Nef_polyhedron(*N));
|
||||
if (res.isConst()) newN.reset(N->copy());
|
||||
else newN = dynamic_pointer_cast<CGAL_Nef_polyhedron>(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<CGAL_Nef_polyhedron> newN;
|
||||
if (res.isConst()) newN.reset(new CGAL_Nef_polyhedron(*N));
|
||||
if (res.isConst()) newN.reset(N->copy());
|
||||
else newN = dynamic_pointer_cast<CGAL_Nef_polyhedron>(res.ptr());
|
||||
applyResize3D(*newN, node.newsize, node.autosize);
|
||||
geom = newN;
|
||||
|
|
Loading…
Reference in New Issue