Lines and Circles from Constraints

##

The Lines and Circles from Constraints component provides numerous construction algorithms for 2D circles or lines described with numeric or geometric constraints in relation to other curves. These constraints enable the following to be imposed:

- the radius of a circle,

- the angle that a straight line makes with another straight line,

- the tangency of a straight line or circle in relation to a curve,

- the passage of a straight line or circle through a point,

- the centering of a circle on a point or curve.

For example, these algorithms enable to easily construct a circle of a given radius, centered on a straight line and tangential to another circle.

The implemented algorithms are more complex than those provided by the Direct Constructions component for building 2D circles or lines.

The expression of a tangency problem generally leads to several results, according to the relative positions of the solution and the circles or straight lines in relation to which the tangency constraints are expressed. For example, consider the following case of a circle of a given radius (a small one) which is tangential to two secant circles C1 and C2:

Example of a Tangency Constraint

The diagram above clearly shows that there are 8 possible solutions.

In order to limit the number of solutions, we can try to express the relative position of the required solution in relation to the circles to which it is tangential. For example, if we specify that the solution is inside the circle C1 and outside the circle C2, only two solutions referenced 3 and 4 on the diagram respond to the problem posed.

This technique of qualification of a solution, in relation to the curves to which it is tangential, can be used in all algorithms for constructing a circle or a straight line by geometric constraints. Four qualifiers are used, which specify the following:

- the solution(s) must enclose the argument, or

- the solution(s) must be enclosed by the argument, or

- the solution(s) and the argument must be external to one another, or

- the relative position is not qualified, i.e. all solutions apply.

These definitions are very easy to interpret on a circle, where it is easy to identify the interior and exterior sides. In fact, for any kind of curve the interior is defined as the left-hand side of the curve in relation to its orientation.

Open CASCADE implements several categories of algorithms:

- analytic algorithms, where solutions are obtained by the resolution of an equation; such algorithms are used when the geometries which are worked on (tangency arguments, position of the center, etc.) are points, lines or circles;

- geometric algorithms, where the solution is generally obtained by calculating the intersection of parallel or bisecting curves built from geometric arguments; and

- iterative algorithms, where the solution is obtained by a process of iteration.

For each kind of geometric construction of a constrained line or circle, Open CASCADE provides two types of access to the user:

- algorithms from the package Geom2dGcc automatically select the algorithm best suited to the problem to be treated, both in the general case and in all types of specific cases; the arguments used are Geom2d objects; the solutions computed are gp objects;

- algorithms from the package GccAna only treat the problem analytically, and can only be used when the geometries to be worked on are lines or circles; the arguments used and solutions computed are gp objects.

The algorithms provided compute all solutions, which correspond to the geometric problem posed, except where the resolution is performed by an iterative algorithm.

Iterative algorithms compute only one solution, namely the one closest to an initial given position. This type of algorithm is used in the following cases:

- to build a circle, when an argument is more complex than a line or a circle, and where the radius is not known or difficult to determine: this is the case for a circle tangential to three geometric elements, or tangential to two geometric elements and centered on a curve;

- to build a line, when a tangency argument is more complex than a line or a circle.

Qualified curves (for tangency arguments) are provided either by:

- the GccEnt package, for direct use by GccAna algorithms, or

- the Geom2dGcc package, for general use by Geom2dGcc algorithms.

The GccEnt and Geom2dGcc packages also provide simple functions for building qualified curves in a very efficient way.

The GccAna package also provides algorithms for constructing bisecting loci between circles, lines or points. Bisecting loci between two geometric objects are such that each of their points is at the same distance from the two geometric objects. They are typically curves, such as circles, lines or conics for GccAna algorithms. Each elementary solution is given as an elementary bisecting locus object (line, circle, ellipse, hyperbola, parabola), described by the GccInt package.

Note: Curves used by GccAna algorithms to define the geometric problem to be solved, are 2D lines or circles from the gp package: they are not explicitly parameterized. However, these lines or circles retain an implicit parameterization, corresponding to that which they induce on equivalent Geom2d objects. This induced parameterization is the one used when returning parameter values on such curves, for instance with the functions Tangency1, Tangency2, Tangency3, Intersection2 and CenterOn3 provided by construction algorithms from the GccAna or Geom2dGcc packages.