Navigation: Up, Table of Contents, Bibliography, Index, Title Page

Elementary 3D objects

The three-dimensional kernel classes are contained in a representation class. Before you can declare one of the following classes, you have to include at least one of the following two statements:

#include <CGAL/Cartesian.h>
#include <CGAL/Homogeneous.h>

CGAL provides points, vectors, and directions. A point is a point in the three-dimensional Euclidean space 3, a vector is the difference of two points p3, p1 and denotes the direction and the distance from p1 to p3 in the vector space 3, and a direction represents the family of vectors that are positive multiples of each other. Their interface is described in Chapter reference.

Point_3<R>
Vector_3<R>
Direction_3<R>

Lines in CGAL are directed. Any two points on a line induce an orientation of this line. A ray is semi-infinite interval on a line, and this line is oriented from the finite endpoint of this interval towards any other point in this interval. A segment is a bounded interval on a directed line, and the endpoints are ordered so that they induce a direction which is the same as that of the line. Their interface is described in Chapter reference.

Line_3<R>
Ray_3<R>
Segment_3<R>

Planes are affine subspaces of dimension two, passing through three points, or a point and a line, ray, or segment. CGAL provides a correspondence between any plane in the ambient space 3 and the embedding of 2 in that space. Their interface is described in Chapter reference.

Plane_3<R>

Next we introduce the simplices triangle and tetrahedron. More complex polyhedra can be obtained from the basic library (Polyhedron_3), so they are not part of the kernel. The simplex interfaces are described in Chapter reference.

Triangle_3<R>
Tetrahedron_3<R>

Predicates and functions

For testing where a point p lies with respect to a plane defined by three points q, r and s, one may be tempted to construct the line Plane_3<R>(q,r,s) and use the method oriented_side(p). This may pay off if many tests with respect to the plane are made. Nevertheless, unless the number type is exact, the constructed plane is only approximated, and round-off errors may lead oriented_side(p) to return an orientation which is different from the orientation of p, q, r, and s. This is the well-known problem of robustness.

In CGAL, we provide predicates in which such geometric decisions are made directly with a reference to the input points p, q, r, s, without an intermediary object like a plane. This enables to use exact predicates that are cheaper than exact number types, a concept that has been the focus of much research recently in computational geometry. For the above test, the recommended way to get the result is to use orientation(p,q,r,s).

Consequently, we propose the most common predicates in Chapter reference. They use the elementary classes of the 3D kernel.

Finally, affine transformations allow to generate new object instances under arbitrary affine transformations. These transformations include translations, rotations and scaling. Most of the classes above have a member function transform(Aff_transformation t) which applies the transformation to the object instance. The interface of the transformation class is described in Chapter reference.

Aff_transformation_3<R>

CGAL also provides a set of functions that detect or compute the intersection between two objects of the 3D kernel, see Chapter reference.


Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The GALIA project. Jan 18, 2000.