Constraint Tangent/en

Description
The Constraint tangent tool constrains a selected line (or an extension of it beyond its endpoints) to be tangential to a selected line, circle or arc in the sketch. Where the selected entities are two line segments, they are constrained to lie on the same line, i.e. be collinear.

Operation
Curve and a line.



Select the line and a circle in the sketch by clicking on them (highlighted in dark green).



Apply the Constraint tangent by either clicking on the Constrain tangent icon in the Sketcher Constraints toolbar or selecting the Constrain Tangent menu item from the Sketcher constraints sub-menu of the Sketcher menu, or the Part Design menu if the Part Design workbench is selected rather than the Sketcher workbench.



The line (or an extension of it beyond its endpoints) will be constrained to be tangent to the circle or arc by altering any or all of the line slope, the circle or arc radius or center point of the circle or arc depending upon what other constraints are operational in the sketch.

The tangent constraint can also operate on two selected points or a selected point and an edge(line)as illustrated in the following sequence.



Accepted selection:
 * endpoint of line/arc/arc-of-ellipse +  endpoint of line/arc/arc-of-ellipse (i.e., two endpoints of any two curves)



Apply the Tangent Constraint as before.



The line is constrained to be tangent to the arc and the two points become coincident with the straight line continuing the arc. ( If applied to two straight lines, they are forced to be collinear).

Similarly by selecting a point at the end of an arc and a line,



and applying the Tangent Constraint as before



the line is forced to be tangent to the arc at the point selected on the curve.

The placement of the point before the constraint is applied is a hint for the solver for where the tangency should be. With this constraint, one can constrain two ellipses to touch each other in two places.

Scripting
Tangent Constraint can be created from macros and from the python console by using the following:

where:
 * Sketch is a sketch object
 * icurve1, icurve2 are two integers identifying the curves to be made tangent. The integers are indexes in the sketch (the value, returned by Sketch.addGeometry).
 * pointpos1, pointpos2 should be 1 for start point and 2 for end point.
 * geoidpoint and pointpos in TangentViaPoint are the indexes specifying the point of tangency.