Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Trouble with Triangle_3_Segment_3_intersection.h

Subject: CGAL users discussion list

List archive

[cgal-discuss] Trouble with Triangle_3_Segment_3_intersection.h


Chronological Thread 
  • From: Matthew Denno <>
  • To:
  • Subject: [cgal-discuss] Trouble with Triangle_3_Segment_3_intersection.h
  • Date: Tue, 4 Aug 2009 23:49:34 -0400
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=VhqVJ2OmiD6R55t6KE2IcdmmqJe7vzn/KeDcENvw/UJrfufhGJGDJtMh412hVrfj8+ ZLVcY9teJvZrMZ6kUIiPS8YQ6PK5mAwORRV2Q5F1YSnkgGVS3nmXz5dkSX3ejjreWttV LC0Kd2zQqTfMVsDy14wXlSjnAFMmsqrU3Li4Q=

Hello,

I am trying to write a Triangle_3_Triangle_3 _intersection function based on the Triangle_3_Segment_3_intersection.h code (URL: https://scm.gforge.inria.fr/svn/cgal/trunk/AABB_tree/include/CGAL/AABB_intersections/Triangle_3_segment_3_intersection.h ).  I just started it so it is far from complete.  I understand that this code is not included in any of the releases yet (and is maybe not complete?), but I was hoping that someone could help me out with the errors I am getting (or maybe just say the code is not ready for use yet? :) ).  Below is the code that I am trying to use and the error that I am getting.

Thanks,

Matt

CODE:

#include "mainwindow.h"

#include "ui_mainwindow.h"

//

// CGAL Includes

#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>

#include <CGAL/Triangulation_euclidean_traits_xy_3.h>

#include <CGAL/Delaunay_triangulation_2.h>

#include <CGAL/intersections.h>

#include <CGAL/Triangle_3_segment_3_intersection.h>

//

// CGAL Typedefs

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;

typedef CGAL::Triangulation_euclidean_traits_xy_3<K> Gt;

typedef CGAL::Delaunay_triangulation_2<Gt> Delaunay;

typedef Delaunay::Finite_faces_iterator Face_iterator;

typedef Delaunay::Edge_iterator Edge_iterator;

typedef K::Point_3 Point;

typedef K::Triangle_3 Triangle;

typedef K::Segment_3 Segment;

MainWindow::MainWindow(QWidget *parent)

: QMainWindow(parent), ui(new Ui::MainWindowClass)

{

ui->setupUi(this);

}

MainWindow::~MainWindow()

{

delete ui;

}

void MainWindow::on_pushButton_clicked()

{

Point p1t1 = Point(0,0,0);

Point p2t1 = Point(10,10,0);

Point p3t1 = Point(0,10,0);

Point p1t2 = Point(0,10,-5);

Point p2t2 = Point(10,0,-5);

Point p3t2 = Point(5,5,5);

Segment s1t1 = Segment(p1t1,p2t1);

Segment s2t1 = Segment(p2t1, p3t1);

Segment s3t1 = Segment(p3t1, p1t1);

Segment s1t2 = Segment(p1t2, p2t2);

Segment s2t2 = Segment(p2t2, p3t2);

Segment s3t2 = Segment(p3t2, p1t2);

Triangle t1 = Triangle(p1t1,p2t1,p3t1);

Triangle t2 = Triangle(p1t2,p2t2,p3t2);

if(CGAL::do_intersect(t1,t2))

{

qDebug("Triangles Intersect");

if (CGAL::do_intersect(t1,s1t2))

{

qDebug("s1t2 intersects t1");

CGAL::Object obj = CGAL::intersection(t1,s1t2);

if (CGAL::object_cast<K::Point_3>(&obj))

{

qDebug("Object is a point");

}

}

if (CGAL::do_intersect(t1,s2t2))

{

qDebug("s2t2 intersects t1");

// CGAL::Object obj = CGAL::intersection(t1,s2t2);

// if (CGAL::object_cast<K::Point_3>(&obj))

// {

// qDebug("Object is a point");

// }

}

if (CGAL::do_intersect(t1,s3t2))

{

qDebug("s3t2 intersects t1");

// CGAL::Object obj = CGAL::intersection(t1,s3t2);

// if (CGAL::object_cast<K::Point_3>(&obj))

// {

// qDebug("Object is a point");

// }

}

if (CGAL::do_intersect(t2,s1t1))

{

qDebug("s1t1 intersects t2");

// CGAL::Object obj = CGAL::intersection(t2,s1t1);

// if (CGAL::object_cast<K::Point_3>(&obj))

// {

// qDebug("Object is a point");

// }

}

if (CGAL::do_intersect(t2,s2t1))

{

qDebug("s2t1 intersects t2");

// CGAL::Object obj = CGAL::intersection(t2,s2t1);

// if (CGAL::object_cast<K::Point_3>(&obj))

// {

// qDebug("Object is a point");

// }

}

if (CGAL::do_intersect(t2,s3t1))

{

// qDebug("s3t1 intersects t2");

// CGAL::Object obj = CGAL::intersection(t2,s3t1);

// if (CGAL::object_cast<K::Point_3>(&obj))

// {

// qDebug("Object is a point");

// }

}

}

}


ERROR:
/usr/include/CGAL/Kernel/function_objects.h:2360: error: no matching function for call to ‘intersection(const CGAL::Triangle_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double> > >&, const CGAL::Segment_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double> > >&, CGAL::Filtered_kernel<CGAL::Simple_cartesian<double> >)’



Archive powered by MHonArc 2.6.16.

Top of Page