Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Is it possible to intersect polyhedrons with AABB_tree ?

Subject: CGAL users discussion list

List archive

[cgal-discuss] Is it possible to intersect polyhedrons with AABB_tree ?


Chronological Thread 
  • From: houssen <>
  • To: <>
  • Subject: [cgal-discuss] Is it possible to intersect polyhedrons with AABB_tree ?
  • Date: Thu, 19 Nov 2015 18:16:19 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:UHv+shKQ4FeCF2vwKtmcpTZWNBhigK39O0sv0rFitYgUKf7xwZ3uMQTl6Ol3ixeRBMOAu68C1bGd4v2ocFdDyKjCmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TWM5DIfUi/yKRBybrysXNWC0oLpjKvjptX6WEZhunmUWftKNhK4rAHc5IE9oLBJDeIP8CbPuWZCYO9MxGlldhq5lhf44dqsrtY4q3wD86Fpy8kVBa71dqB9Qb1DByk9KEg04tfqvF/NV13cyGEbVzAWlQdTGAXDpEX6WYrqqSb8nutl1zHcM9egHuN8Yiir86o+EEygsywALTNsqGw=

Hello,

Is it possible to intersect polyhedrons with AABB_tree ?

For now I end up with this code, but impossible to compile the last line of the main !...
Can somebody give me some clue / help on this ?

Franck# Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application.


project( 02.cgal_ )

cmake_minimum_required(VERSION 2.8.10)

find_package(CGAL QUIET COMPONENTS Core ) # CGAL 4.7

if ( CGAL_FOUND )

include( ${CGAL_USE_FILE} )

include( CGAL_CreateSingleSourceCGALProgram )

create_single_source_cgal_program( "intersect.cpp" )

else()

message(STATUS "This program requires the CGAL library, and will not be
compiled.")

endif()

#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Point_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/AABB_tree.h>
#include <CGAL/AABB_traits.h>
#include <CGAL/AABB_segment_primitive.h>
#include <CGAL/AABB_face_graph_triangle_primitive.h>
#include <list>

typedef CGAL::Exact_predicates_exact_constructions_kernel        Kernel;
typedef CGAL::Point_3<Kernel>                                    Point_3;
typedef CGAL::Polyhedron_3<Kernel>                               Polyhedron_3;
typedef Polyhedron_3::Vertex_const_iterator                      Polyhedron_3_Vertex_iterator;
typedef CGAL::AABB_face_graph_triangle_primitive<Polyhedron_3>   Polyhedron_3_Primitive;
typedef CGAL::AABB_traits<Kernel, Polyhedron_3_Primitive>        Polyhedron_3_Traits;
typedef CGAL::AABB_tree<Polyhedron_3_Traits>                     Polyhedron_3_Tree;
typedef Polyhedron_3_Tree::Object_and_primitive_id               Polyhedron_3_Object_and_primitive_id;

int main ()
{
  Polyhedron_3 P;
  Point_3 P1 (-1, -1, 0);
  Point_3 P2 ( 1, -1, 0);
  Point_3 P3 ( 1,  1, 0);
  Point_3 P4 (-1,  1, 0);
  P.make_triangle (P1, P2, P3);
  P.make_triangle (P1, P3, P4);

  Polyhedron_3 Q;
  Point_3 Q1 (0, 0, 0);
  Point_3 Q2 (2, 0, 0);
  Point_3 Q3 (2, 2, 0);
  Point_3 Q4 (0, 2, 0);
  Q.make_triangle (Q1, Q2, Q3);
  Q.make_triangle (Q1, Q3, Q4);

  Polyhedron_3_Tree poly_tree(CGAL::faces(P).first, CGAL::faces(P).second, P);
  poly_tree.accelerate_distance_queries();

  std::list<Polyhedron_3_Object_and_primitive_id> intersect_polys;
  //poly_tree.all_intersections(Q, std::back_inserter(intersect_polys));
  return 0;
}



Archive powered by MHonArc 2.6.18.

Top of Page