Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] 3D boolean operation - result gets deleted

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] 3D boolean operation - result gets deleted


Chronological Thread 
  • From: Andreas Fabri <>
  • To:
  • Subject: Re: [cgal-discuss] 3D boolean operation - result gets deleted
  • Date: Fri, 13 Jan 2012 10:49:31 +0100
  • Organization: GeometryFactory

On 13/01/2012 10:12, Veerle wrote:
Hello,

I'm new to CGAL and I'm trying to use the 3D boolean operation on
Nef_polyhedron_3.

I was able to construct two objects (surface1 and surface2) by reading
off-files and converting the polyhedron to Nef_polyhedron_3:
Nef_polyhedron_3 surface1;
Nef_polyhedron_3 surface2;

Then I substract both surfaces and the result is in result_surface:
Nef_polyhedron_3 result_surface = surface1 - surface2;

Now I want to return the result_surface in my function to be able to use it
in another function. However, since result_surface is no pointer, it gets
deleted at the moment that I leave my function. Is there a way to return
this without it being deleted? I was thinking of returning a copy of
result_surface, but I couldn't find a copy constructor for Nef_polyhedron_3.

Thanks

--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/3D-boolean-operation-result-gets-deleted-tp4291727p4291727.html
Sent from the cgal-discuss mailing list archive at Nabble.com.


Taken that the assignment worked, just return the result from
your function and make an assignment in the calling function.


Nef_polyhedron_3 surface = myFct(surface1, surface2);


andreas

--
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912 skype: andreas.fabri



Archive powered by MHonArc 2.6.16.

Top of Page