Subject: CGAL users discussion list
List archive
- From: Roger Mason <>
- To:
- Subject: [cgal-discuss] Intersection of surfaces
- Date: Wed, 25 May 2011 07:53:07 -0700 (PDT)
Hello,
I wish to find the intersection of a (Delaunay) triangulated plane with a
(Delaunay) triangulated surface. I based my code on
demo/Geomview/gv_terrain.cpp in the (3.6.1) distribution. I think I might
be able to use the box intersection classes discussed in Chapter 61 of the
manual and I've looked at the examples therein, but I cannot see how to
adapt the code to my particular case. I am attaching my current code (with
calls to Geomview removed for brevity) below. If any one can give me some
help I'll be very grateful.
Thank you.
Roger
#include <CGAL/Cartesian.h>
#include <CGAL/Triangulation_euclidean_traits_xy_3.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/IO/Geomview_stream.h>
#include <CGAL/IO/Triangulation_geomview_ostream_2.h>
#include <CGAL/IO/Triangulation_geomview_ostream_3.h>
#include <CGAL/intersections.h>
#include <CGAL/Triangulation_vertex_base_with_info_3.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <iostream>
#include <fstream>
#include <unistd.h> // for sleep()
#include <vector>
#include <string>
typedef CGAL::Cartesian<double> K;
//typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Triangulation_euclidean_traits_xy_3<K> Gt3;
typedef Gt3::Point Point3;
//typedef CGAL::Triangulation_vertex_base_with_info_3<unsigned long, K> Vb;
//typedef CGAL::Triangulation_data_structure_3<Vb> Tds;
typedef CGAL::Delaunay_triangulation_2<Gt3> Terrain;
//typedef CGAL::Delaunay_triangulation_2<Gt3, Tds> Terrain;
//typedef CGAL::Delaunay_triangulation_3<K, Tds> Terrain;
//typedef Terrain::Cell_iterator Cell_iterator;
//typedef Terrain::Point Point3;
int main(int argc, char** argv)
{
std::vector<std::string> filenames;
for (int i = 1; i < argc; i++)
{
filenames.push_back(std::string(argv[i]));
}
std::vector<Terrain> Ss; // surfaces: Ss[0] is the landscape
// Instantiate the surfaces
for (int i = 0; i < argc-1; i++)
{
Terrain S;
Ss.push_back(S);
}
// Populate surfaces with data from files
Point3 s; // 3-tuple
for (int i = 0; i < argc-1; i++)
{
std::ifstream iFile2(filenames[i].c_str(), std::ios::in);
int count = 0;
while ( iFile2 >> s )
{
Ss[i].insert( s );
count++;
}
}
// Find intersections
// Get triangles from the surfaces (how?) and compare one by one?
// Use box intersections to find candidate triangles for detailed
comparison?
}
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Intersection-of-surfaces-tp3549940p3549940.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Intersection of surfaces, Roger Mason, 05/25/2011
- Re: [cgal-discuss] Intersection of surfaces, Sebastien Loriot (GeometryFactory), 05/25/2011
- [cgal-discuss] Re: Intersection of surfaces, Roger Mason, 05/25/2011
- Re: [cgal-discuss] Re: Intersection of surfaces, Sebastien Loriot (GeometryFactory), 05/26/2011
- [cgal-discuss] Re: Intersection of surfaces, Roger Mason, 05/26/2011
- [cgal-discuss] Re: Intersection of surfaces, Roger Mason, 05/30/2011
- Re: [cgal-discuss] Re: Intersection of surfaces, Andreas Fabri, 05/30/2011
- [cgal-discuss] Re: Intersection of surfaces, Roger Mason, 05/30/2011
- Re: [cgal-discuss] Re: Intersection of surfaces, Andreas Fabri, 05/30/2011
- [cgal-discuss] Re: Intersection of surfaces, Roger Mason, 05/30/2011
- Re: [cgal-discuss] Re: Intersection of surfaces, Francois Berenger, 05/31/2011
- [cgal-discuss] Re: Intersection of surfaces, Roger Mason, 05/30/2011
- Re: [cgal-discuss] Re: Intersection of surfaces, Andreas Fabri, 05/30/2011
- Re: [cgal-discuss] Re: Intersection of surfaces, Sebastien Loriot (GeometryFactory), 05/26/2011
- [cgal-discuss] Re: Intersection of surfaces, Roger Mason, 05/25/2011
- Re: [cgal-discuss] Intersection of surfaces, Sebastien Loriot (GeometryFactory), 05/25/2011
Archive powered by MHonArc 2.6.16.