Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Assertion: CGAL/Interval_nt.h:88: !(i>s)

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Assertion: CGAL/Interval_nt.h:88: !(i>s)


Chronological Thread 
  • From: Bruce Duncan <>
  • To:
  • Subject: Re: [cgal-discuss] Assertion: CGAL/Interval_nt.h:88: !(i>s)
  • Date: Fri, 06 Aug 2010 16:37:36 +0100
  • Openpgp: id=BFD0445D
  • Organization: School of Engineering, University of Edinburgh

Hi Sylvain,

Thanks for your reply, which I guess you must make quite a lot! Sorry
for the silly question.

Sylvain Pion wrote:
> Le 06/08/10 14:02, Bruce Duncan a écrit :
>> For one of the assertions I'm hitting, I've created what I hope is a
>> small testcase. The code and the output on my machine is attached.
>
> The assertion means that an uninitialized variable has been used.
> And indeed the plane equations in the Polyhedron of CGAL needs manual
> construction. Seehttp://www.cgal.org/FAQ.html#polyhedron_normals .

I have tried to modify my program to use the Traits class as shown in
the example program.

I am now having trouble converting this Polyhedron to a Nef_polyhedron,
which I want to use for the boolean operations. Is this possible?

I haven't attached the compiler output this time, as it's very long.
Suffice to say it starts with "Nef_3/polyhedron_3_to_nef_3.h:218: error:
'class Vector_3' has no member named 'is_degenerate'"

What am I doing wrong?

Thanks,
Bruce
--
CLX Compute Cluster Developer (http://clx.see.ed.ac.uk/)
AL116, Alrick Building, King's Buildings. 0131 6505637
School of Engineering, University of Edinburgh

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Extended_homogeneous.h>
#include <CGAL/Quotient.h>
#include <CGAL/Gmpz.h>
#include <CGAL/Gmpzf.h>
#include <CGAL/Nef_polyhedron_3.h>
#include <CGAL/Polyhedron_traits_with_normals_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Nef_polyhedron_iostream_3.h>
#include <CGAL/IO/Polyhedron_VRML_2_ostream.h>
#include <CGAL/centroid.h>
#include <list>
#include <fstream>
#include <iostream>

typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
//typedef CGAL::Homogeneous<CGAL::Gmpzf> Kernel;
//typedef CGAL::Extended_homogeneous<CGAL::Gmpz> Kernel;
typedef CGAL::Polyhedron_traits_with_normals_3<Kernel> Traits;
typedef CGAL::Polyhedron_3<Traits> Polyhedron;
typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron;
typedef Polyhedron::Vertex_iterator Vertex_iterator;
typedef Kernel::Vector_3 Vector;
typedef Kernel::Direction_3 Direction;
typedef Kernel::Aff_transformation_3 Aff_transformation;
typedef Kernel::Plane_3 Plane_3;
typedef Kernel::Vector_3 Vector_3;
typedef Kernel::Point_3 Point_3;

struct Normal_vector {
    template <class Facet>
    typename Facet::Plane_3 operator()( Facet& f) {
        typename Facet::Halfedge_handle h = f.halfedge();
        // Facet::Plane_3 is the normal vector type. We assume the
        // CGAL Kernel here and use its global functions.
        return CGAL::cross_product(
            h->next()->vertex()->point() - h->vertex()->point(),
            h->next()->next()->vertex()->point() - h->next()->vertex()->point());
    }
};

int main() {
    Point_3 p( 1.0, 0.0, 0.0);
    Point_3 q( 0.0, 1.0, 0.0);
    Point_3 r( 0.0, 0.0, 1.0);
    Point_3 s( 0.0, 0.0, 0.0);
    Polyhedron P;

    P.make_tetrahedron( p, q, r, s);
    Nef_polyhedron N(P);

    Polyhedron P1;
    N.convert_to_polyhedron(P1);
    std::transform(P1.facets_begin(), P1.facets_end(), P1.planes_begin(),
                   Normal_vector());
    Polyhedron::Facet_const_iterator fi = P1.facets_begin();
    std::cerr << "Facet... " << &fi << std::endl;
    std::cerr << "fi->plane(): " << fi->plane() << std::endl;
    Direction d1(fi->plane());
    //++fi;
    //std::cout << (d1 == Direction(fi->plane())) << std::endl;

    return 0;
}

Attachment: signature.asc
Description: OpenPGP digital signature




Archive powered by MHonArc 2.6.16.

Top of Page