Adaptors for Curves and Surfaces

Some Open CASCADE Technology general algorithms may work theoretically on numerous types of curves or surfaces. To do this, they simply get the services required of the analysed curve or surface through an interface so as to a single API, whatever the type of curve or surface. These interfaces are called adaptors.

For example, Adaptor3d_Curve is the abstract class which provides the required services by an algorithm which uses any 3d curve.

The GeomAdaptor package provides interfaces:

The Geom2dAdaptor package provides interfaces :

The BRepAdaptor package provides interfaces:

When you write an algorithm which operates on geometric objects, use Adaptor3d (or Adaptor2d) objects. As a result, you can use the algorithm with any kind of object, if you provide for this object, an interface derived from Adaptor3d or Adaptor2d.

These interfaces are easy to use: simply create an adapted curve or surface from a Geom2d curve, and then use this adapted curve as an argument for the algorithm which requires it.