35 #include <CGAL/Exact_predicates_exact_constructions_kernel.h> 36 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> 37 #include <CGAL/intersections.h> 38 #include <CGAL/Bbox_3.h> 39 #include <CGAL/Bbox_2.h> 40 #include <CGAL/Timer.h> 41 #include <CGAL/Triangulation_3.h> 42 #include <CGAL/Triangulation_2.h> 43 #include <CGAL/Polyhedron_3.h> 44 #include <CGAL/Tetrahedron_3.h> 45 #include <CGAL/convex_hull_3.h> 46 #include <CGAL/squared_distance_3.h> 47 #include <CGAL/box_intersection_d.h> 48 #include <CGAL/centroid.h> 49 #include <CGAL/number_utils.h> 51 typedef CGAL::Exact_predicates_exact_constructions_kernel
Kernel;
52 typedef CGAL::Exact_predicates_inexact_constructions_kernel
IK;
62 typedef CGAL::Plane_3<Kernel>
Plane_3;
117 Point_3 s1B(cel.xmin(), cel.ymin(), cel.zmin());
118 Point_3 r1B(cel.xmax(), cel.ymin(), cel.zmin());
119 Point_3 t1B(cel.xmax(), cel.ymax(), cel.zmin());
120 Point_3 v1B(cel.xmin(), cel.ymax(), cel.zmin());
122 Point_3 s2B(cel.xmin(), cel.ymin(), cel.zmax());
123 Point_3 r2B(cel.xmax(), cel.ymin(), cel.zmax());
124 Point_3 t2B(cel.xmax(), cel.ymax(), cel.zmax());
125 Point_3 v2B(cel.xmin(), cel.ymax(), cel.zmax());
130 trianglesB.push_back(Tri1B);
131 trianglesB.push_back(Tri2B);
137 trianglesB.push_back(Tri5B);
138 trianglesB.push_back(Tri6B);
143 trianglesB.push_back(Tri9B);
144 trianglesB.push_back(Tri10B);
150 trianglesB.push_back(Tri13B);
151 trianglesB.push_back(Tri14B);
157 trianglesB.push_back(Tri17B);
158 trianglesB.push_back(Tri18B);
164 trianglesB.push_back(Tri21B);
165 trianglesB.push_back(Tri22B);
175 std::vector<Point_3> result;
178 const CGAL::Object& intersec = CGAL::intersection(seg,t);
179 if(CGAL::assign(P,intersec)){
182 else if(CGAL::assign(s,intersec)){
183 result.push_back(s.operator[](0));
184 result.push_back(s.operator[](1));
198 std::vector<Point_3> result;
200 for(
int k=0;k<3;k++){
204 Segment_3 arete(t1.operator[](k),t1.operator[](kp));
205 const CGAL::Object& intersec = CGAL::intersection(arete,t2);
206 if(CGAL::assign(P,intersec)){
209 else if(CGAL::assign(seg,intersec)){
210 result.push_back(seg.operator[](0));
211 result.push_back(seg.operator[](1));
215 for(
int k=0;k<3;k++){
219 Segment_3 arete(t2.operator[](k),t2.operator[](kp));
220 const CGAL::Object& intersec = CGAL::intersection(arete,t1);
221 if(CGAL::assign(P,intersec)){
224 else if(CGAL::assign(seg,intersec)){
225 result.push_back(seg.operator[](0));
226 result.push_back(seg.operator[](1));
237 return tetra.has_on_bounded_side(P);
242 bool coplanar(std::vector<Point_3>::iterator begin, std::vector<Point_3>::iterator end)
246 bool test_confondus=
true;
249 std::vector<Point_3>::iterator it;
250 for(it=begin;it!=end && test_confondus;it++){
252 test_confondus = (P1==P2);
257 bool test_collinear=
true;
259 std::vector<Point_3>::iterator iter;
260 for(iter=it;iter!=end && test_collinear;iter++){
262 test_collinear = CGAL::collinear(P1,P2,P3);
268 for(std::vector<Point_3>::iterator iterat=iter;iterat!=end && test;iterat++){
Polyhedron_3::Plane_iterator Plane_iterator
Definition: intersections.hpp:82
InexactPolyhedron_3::Plane_iterator InexactPlane_iterator
Definition: intersections.hpp:87
CGAL::Triangulation_3< IK > InexactTriangulation
Definition: intersections.hpp:72
InexactPolyhedron_3::Halfedge_around_vertex_circulator InexactHalfedge_around_vertex_circulator
Definition: intersections.hpp:88
Polyhedron_3::Facet Facet
Definition: intersections.hpp:79
CGAL::Triangle_3< IK > InexactTriangle_3
Definition: intersections.hpp:61
CGAL::Triangle_2< Kernel > Triangle_2
Definition: intersections.hpp:97
InexactPolyhedron_3::Vertex_iterator InexactVertex_iterator
Definition: intersections.hpp:86
Kernel::Line_3 Line_3
Definition: intersections.hpp:58
CGAL::Exact_predicates_exact_constructions_kernel Kernel
Definition: intersections.hpp:51
Triangles_2::iterator Triangle2_iterator
Definition: intersections.hpp:102
CGAL::Bbox_2 Bbox_2
Definition: intersections.hpp:101
Polyhedron_3::Halfedge_around_vertex_circulator Halfedge_around_vertex_circulator
Definition: intersections.hpp:83
InexactPolyhedron_3::Facet InexactFacet
Definition: intersections.hpp:84
CGAL::Aff_transformation_3< Kernel > Aff_transformation_3
Definition: intersections.hpp:73
Kernel::Point_2 Point_2
Definition: intersections.hpp:95
InexactTriangulation::Finite_cells_iterator InexactFinite_cells_iterator
Definition: intersections.hpp:78
ExactTriangulation::Finite_cells_iterator ExactFinite_cells_iterator
Definition: intersections.hpp:76
InexactPolyhedron_3::Facet_iterator InexactFacet_iterator
Definition: intersections.hpp:85
std::vector< Triangle_3 > Triangles
Definition: intersections.hpp:63
CGAL::Triangle_3< Kernel > Triangle_3
Definition: intersections.hpp:60
CGAL::Polyhedron_3< Kernel > Polyhedron_3
Definition: intersections.hpp:70
Triangles::iterator Triangle3_iterator
Definition: intersections.hpp:89
bool coplanar(std::vector< Point_3 >::iterator begin, std::vector< Point_3 >::iterator end)
Test whether points are coplanar.
Definition: intersections.hpp:242
Kernel::Segment_2 Segment_2
Definition: intersections.hpp:100
Kernel::Point_3 Point_3
Definition: intersections.hpp:55
Polyhedron_3::Facet_iterator Facet_iterator
Definition: intersections.hpp:80
std::vector< Point_3 > intersection_bis(const Segment_3 &seg, const Triangle_3 &t)
Edge/triangle intersection.
Definition: intersections.hpp:173
CGAL::Tetrahedron_3< IK > InexactTetrahedron
Definition: intersections.hpp:65
std::vector< Point_2 > Points_2
Definition: intersections.hpp:99
CGAL::Cartesian_converter< IK, Kernel > Inexact_to_Exact
Definition: intersections.hpp:54
Kernel::Plane_3 Plane_3
Definition: intersections.hpp:59
CGAL::Bbox_3 Bbox
Definition: intersections.hpp:68
void triang_cellule(const Bbox &cel, Triangles &trianglesB)
Triangulation of the faces of a fluid cubic cell.
Definition: intersections.hpp:113
Kernel::Vector_3 Vector_3
Definition: intersections.hpp:57
Kernel::Segment_3 Segment_3
Definition: intersections.hpp:67
CGAL::Tetrahedron_3< Kernel > Tetrahedron
Definition: intersections.hpp:64
ExactTriangulation::Finite_facets_iterator ExactFinite_faces_iterator
Definition: intersections.hpp:75
Polyhedron_3::Vertex_iterator Vertex_iterator
Definition: intersections.hpp:81
double P(double x, double y, double z, double dx, double dy, double dz)
Definition: parametres.cpp:310
CGAL::Cartesian_converter< Kernel, IK > Exact_to_Inexact
Definition: intersections.hpp:53
InexactTriangulation::Finite_facets_iterator InexactFinite_faces_iterator
Definition: intersections.hpp:77
IK::Point_3 InexactPoint_3
Definition: intersections.hpp:56
bool inside_tetra(const Tetrahedron &tetra, const Point_3 &P)
Definition: intersections.hpp:236
CGAL::Triangulation_2< Kernel > Triangulation_2
Definition: intersections.hpp:92
CGAL::Exact_predicates_inexact_constructions_kernel IK
Definition: intersections.hpp:52
std::vector< Triangle_2 > Triangles_2
Definition: intersections.hpp:98
CGAL::Polyhedron_3< IK > InexactPolyhedron_3
Definition: intersections.hpp:69
CGAL::Triangulation_3< Kernel > ExactTriangulation
Definition: intersections.hpp:71
std::vector< Point_3 > Points
Definition: intersections.hpp:66