2D Geometry Types

The Geom2d package provides an implementation of 2D geometric objects complying with STEP, part 42. In particular, it provides functions for:

- description of points, vectors and curves,

- their positioning in the plane using coordinate systems,

- their geometric transformation, by applying translations, rotations, symmetries, scaling transformations and combinations thereof.

The key characteristic of Geom2d curves is that they are parameterized. Each class provides functions to work with the parametric equation of the curve, and, in particular, to compute the point of parameter u on a curve and the derivative vectors of order 1, 2.., N at this point.

As a consequence of the parameterization, a Geom2d curve is naturally oriented.

Parameterization and orientation differentiate elementary Geom2d curves from their equivalent as provided by the gp package. The Geom2d package provides conversion functions to transform a Geom2d object into a gp object, and vice-versa, when this is possible.

Moreover, the Geom2d package provides more complex curves, including Bezier curves, BSpline curves, trimmed curves and offset curves.

Geom2d objects are organized according to an inheritance structure over several levels. Thus, an ellipse (specific class Geom2d_Ellipse) is also a conical curve and inherits from the abstract class Geom2d_Conic, while a Bezier curve (concrete class Geom2d_BezierCurve) is also a bounded curve and inherits from the abstract class Geom2d_BoundedCurve; both these examples are also curves (abstract class Geom2d_Curve). Curves, points and vectors inherit from the abstract class Geom2d_Geometry which describes the properties common to any geometric object from the Geom2d package.

This inheritance structure is open and it is possible to describe new objects which inherit from those provided in the Geom2d package, provided that they respect the behavior of the classes from which they are to inherit.

Finally, Geom2d objects can be shared within more complex data structures. This is why they are used within topological data structures, for example.

The Geom2d package uses the services of the gp package to:

- implement elementary algebraic calculus and basic analytic geometry,

- describe geometric transformations which can be applied to Geom2d objects,

- describe the elementary data structures of Geom2d objects.

However, the Geom2d package essentially provides data structures and not algorithms. You can refer to the GCE2d package to find more evolved construction algorithms for Geom2d objects.