Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Memory fills up very fast (and the program crashes)

Subject: CGAL users discussion list

List archive

[cgal-discuss] Memory fills up very fast (and the program crashes)


Chronological Thread 
  • From: Renato <>
  • To:
  • Subject: [cgal-discuss] Memory fills up very fast (and the program crashes)
  • Date: Sat, 6 Apr 2013 00:44:14 -0700 (PDT)

I'm using the kernel #include
<CGAL/Exact_predicates_exact_constructions_kernel_with_sqrt.h> because I
intend to use CSG operations.

The normals are computed by:

---------------------------------------------------------------------
void compute_normals_per_facet()
{
std::for_each(facets_begin(),facets_end(), Facet_normal());
}

...

struct Facet_normal
{
template <class Facet>
void operator()(Facet& f)
{
typename Facet::Halfedge_handle h = f.halfedge();
typename Facet::Normal_3 normal = CGAL::cross_product(
h->next()->vertex()->point() -
h->vertex()->point(),
h->next()->next()->vertex()->point() -
h->next()->vertex()->point());

f.normal() = normal / CGAL::sqrt((normal * normal));
}
};
---------------------------------------------------------------------

The f.normal() has correct values and everything works ok, but the computer
memory is filled very quickly (~2GB) and the program crashes.
I think it is expected.I have searched the cgal-discuss for answer but I've
got no solution.
Is there a way to have it working?

Thanks in advance!



--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Memory-fills-up-very-fast-and-the-program-crashes-tp4657129.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.18.

Top of Page