Subject: CGAL users discussion list
List archive
- From: Maarten Moesen <>
- To:
- Subject: Re: [cgal-discuss] exact constructions kernel + 2D mesher ?
- Date: Mon, 17 Dec 2007 19:47:46 +0100
- Organization: Katholieke Universiteit Leuven
Hello,
> Hi Maarten,
>
> As a workaround you might try to add
> #define CGAL_DONT_USE_LAZY_KERNEL 1
>
> It should compile.
I added it on the first line, but still it doesn't compile, failing
with:
test_mesher.cpp:43: instantiated from here
/usr/local/CGAL-3.3/include/CGAL/number_utils.h:90: error: no match for
call to ‘(CGAL::Null_functor) (const CGAL::Lazy_exact_nt<CGAL::Gmpq>&)’
I can use the _with_sqrt for some time.
Maybe converting from the exact_constructions to
exact_constructions_with_sqrt is also an option.
(Or even to inexact_constructions?)
Can you do these conversions anyway? Because I do not find manual pages
on how to properly convert between kernel or number types (except using
to_double() etc.) Maybe It's just me looking not well enough :).
Another thing that I do not find in the manual is: given for example a
Point_3, (but not the Kernel) can you extract the kernel_type from this
Point type? (By looking into the source, I found that Point_3::R may
work, but I don't find documentation on it)
Thanks!
Maarten
>
> andreas
>
>
> Maarten Moesen wrote:
> > Hello,
> >
> > When trying a 2D mesher example of CGAL together with the exact
> > constructions kernel I noticed that it doesn't compile on my PC (CGAL
> > 3.3.1 / linux32 / g++ 4.0) giving error messages summarized by:
> >
> > test.cpp:52: instantiated from here
> > /usr/local/CGAL-3.3/include/CGAL/Lazy.h:368: error: no matching function
> > for call to ‘exact(CGAL::Null_tag&)’
> > /usr/local/CGAL-3.3/include/CGAL/Lazy.h:83: note: candidates are: const
> > double& CGAL::exact(const double&)
> > ... and so on.
> >
> > This is only when using Exact_predicates_exact_constructions_kernel. For
> > Exact_predicates_inexact_constructions_kernel and
> > Exact_predicates_exact_constructions_kernel_with_sqrt it compiles (and
> > works :)
> >
> > Is this OK? I'd like to use the
> > Exact_predicates_exact_constructions_kernel because I'm planning to make
> > some constructions using NEF polyhedra earlier on in the process and
> > found out that exact_..._with_sqrt doesn't work together with these.
> > (Maybe a second mail)
> >
> > Thanks,
> >
> > Maarten Moesen
> >
> > Here's the code:
> >
> > #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
> > #include <CGAL/Constrained_Delaunay_triangulation_2.h>
> > #include <CGAL/Delaunay_mesher_2.h>
> > #include <CGAL/Delaunay_mesh_face_base_2.h>
> > #include <CGAL/Delaunay_mesh_size_criteria_2.h>
> >
> > #include <iostream>
> >
> > struct K : public CGAL::Exact_predicates_exact_constructions_kernel {};
> > typedef CGAL::Triangulation_vertex_base_2<K> Vb;
> > typedef CGAL::Delaunay_mesh_face_base_2<K> Fb;
> > typedef CGAL::Triangulation_data_structure_2<Vb, Fb> Tds;
> > typedef CGAL::Constrained_Delaunay_triangulation_2<K, Tds> CDT;
> > typedef CGAL::Delaunay_mesh_size_criteria_2<CDT> Criteria;
> > typedef CGAL::Delaunay_mesher_2<CDT, Criteria> Mesher;
> >
> > typedef CDT::Vertex_handle Vertex_handle;
> > typedef CDT::Point Point;
> >
> > int main()
> > {
> > CDT cdt;
> >
> > Vertex_handle va = cdt.insert(Point(-4,0));
> > Vertex_handle vb = cdt.insert(Point(0,-1));
> > Vertex_handle vc = cdt.insert(Point(4,0));
> > Vertex_handle vd = cdt.insert(Point(0,1));
> > cdt.insert(Point(2, 0.6));
> >
> > cdt.insert_constraint(va, vb);
> > cdt.insert_constraint(vb, vc);
> > cdt.insert_constraint(vc, vd);
> > cdt.insert_constraint(vd, va);
> >
> > std::cout << "Number of vertices: " << cdt.number_of_vertices() <<
> > std::endl;
> >
> > std::cout << "Meshing the triangulation with default criterias..."
> > << std::endl;
> >
> > Mesher mesher(cdt);
> > mesher.refine_mesh();
> >
> > std::cout << "Number of vertices: " << cdt.number_of_vertices() <<
> > std::endl;
> >
> > std::cout << "Meshing with new criterias..." << std::endl;
> > // 0.125 is the default shape bound. It corresponds to abound 20.6
> > degree.
> > // 0.5 is the upper bound on the length of the longuest edge.
> > // See reference manual for Delaunay_mesh_size_traits_2<K>.
> > mesher.set_criteria(Criteria(0.125, 0.5));
> > mesher.refine_mesh();
> >
> > std::cout << "Number of vertices: " << cdt.number_of_vertices() <<
> > std::endl;
> > }
> >
--
ir. Maarten Moesen
Department of Metallurgy and Materials Engineering (MTM)
K.U.Leuven
Kasteelpark Arenberg 44 - Bus 02450
B-3001 Heverlee, Belgium
tel. +32 (0)16 32 13 17
fax. +32 (0)16 32 19 90
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
- Computing a convex hull with points derived from Point_2, Ole Schulz-Trieglaff, 12/17/2007
- Re: [cgal-discuss] Computing a convex hull with points derived from Point_2, Michael Hoffmann, 12/17/2007
- Re: [cgal-discuss] Computing a convex hull with points derived from Point_2, Andreas Meyer, 12/17/2007
- exact constructions kernel + 2D mesher ?, Maarten Moesen, 12/17/2007
- Re: [cgal-discuss] exact constructions kernel + 2D mesher ?, Andreas Fabri, 12/17/2007
- Re: [cgal-discuss] exact constructions kernel + 2D mesher ?, Maarten Moesen, 12/17/2007
- Re: exact constructions kernel + NEF polyhedra?, Maarten Moesen, 12/17/2007
- Re: [cgal-discuss] exact constructions kernel + 2D mesher ?, Laurent Rineau, 12/17/2007
- Re: [cgal-discuss] exact constructions kernel + 2D mesher ?, Maarten Moesen, 12/18/2007
- Re: [cgal-discuss] exact constructions kernel + 2D mesher ?, Andreas Fabri, 12/17/2007
- Re: [cgal-discuss] Computing a convex hull with points derived from Point_2, Michael Hoffmann, 12/17/2007
Archive powered by MHonArc 2.6.16.