# How to define a pgf curve with points instead of controls? [duplicate]

The syntax to produce a Bézier curve in pgf is

``````\pgfpathcurveto{first control point}{second control point}{target}
``````

This defines the curvature by control points. Considering the degrees of freedom the curve definition provides, it should also be possible to define the shape by stating two points on the curve.

TikZ provides this with the `smooth` parameter as shown in another answer. But within `\pgfdeclareshape`, TikZ luxury is not available. While declaring a shape to cleanly surround the text box, a pure pgf solution is needed. This would greatly simplify it to surround the text box by a curve.

The full code example can be found in a gist. In the result, the text box is marked in gray. The surrounding shape should exactly pass through the corner points of these gray rectangles.

So, is there some command like this?

``````\pgfpathcurvethrough{first relay point}{second relay point}{target}
``````
• You can use `\pgfplothandlercurveto` (= `smooth`) in PGF, too. However, it would be easier (especially for a closed curve) to use a simple calculated path (say an arc that explicitly passes through those points). – Qrrbrbirlbel Dec 18 '13 at 2:18