Tangents Curve

https://user-images.githubusercontent.com/14288520/205859161-43d923da-2419-44c1-91f1-e8306c5fa0d6.png

Functionality

This node generates a Curve object, defined by series of points, through which the curve must pass, and tangent vectors of the curve at those points.

https://user-images.githubusercontent.com/14288520/205862183-f8eb5c09-2ba5-4315-8a68-1dab9c102fca.png

The node can use one of two algorithms:

  • Hermite spline. The curve is generated as a series of cubic Bezier curves. Control points of Bezier curves are defined as follows:

    • For each segment defined by a pair of input points, one Bezier curve is generated - for example, one curve for first and second point, one curve for second and third point, and so on.

    • For each segment, the first point is the starting point of Bezier curve, and the second point is the end point of Bezier curve.

    • Provided tangent vectors are placed so that the middle point of each vector is at corresponding input point - middle of the first tangent vector at the first input point, and so on. Then end points of these vectors will define additional control points for Bezier curves.

    Generated curves may be optionally concatenated into one Curve object.

  • NURBS curve. The node creates interpolating NURBS curve (of 3rd degree) through the specified points, with additional condition that it should have specified tangents at those points.

Inputs

This node has the following inputs:

  • Points. List of points, through which the generated curve should pass. This input is mandatory, and must contain at least two points.

  • Tangents. List of vectors, which are tangent vectors at corresponding points in the Points input. This input is mandatory.

Parameters

This node has the following parameters:

  • Curve type. This defines the algorithm to be used by the node, and the type of resulting curve. The available options are:

    • Hermite. Use Hermite spline algorithm, and generate either a list of Bezier curves, or concatenated NURBS curve.

    • NURBS. Use NURBS interpolation algorithm.

  • Cyclic. If checked, then the node will generate additional Bezier curve segment to connect the last point with the first one. Unchecked by default.

https://user-images.githubusercontent.com/14288520/205867628-5f3de9ae-ab0a-435b-9ebb-3dc409ff4e51.png
  • Concatenate. This parameter is available only when Curve type parameter is set to Hermite. If checked, then the node will concatenate all generated Bezier curve segments into one Curve object. Otherwise, it will output each segment as a separate Curve object. Checked by default.

https://user-images.githubusercontent.com/14288520/205943520-e9ec6cd6-54de-483f-8af9-753d4720d27e.png

Outputs

This node has the following outputs:

  • Curve. Generated curve (or list of curves).

  • ControlPoints. Control points of all generated Bezier curves. This output contains a separate list of points for each generated curve segment.

https://user-images.githubusercontent.com/14288520/205928727-2fbc4a59-9f2c-40c1-99a5-d9ce70dbff17.png

Examples of usage

Simple example, with points and curves defined manually:

https://user-images.githubusercontent.com/14288520/205932603-2cc1ab0f-0a42-4338-a0d8-bc9582cabe74.png

More complex example: draw a smooth curve so that it would touch three circles in specific points:

https://user-images.githubusercontent.com/14288520/205940676-fa6c2a08-a673-418e-836e-19139ffb9db6.png

Example of NURBS mode usage:

https://user-images.githubusercontent.com/284644/209460542-535e4c0a-9c0f-44e4-a127-46fa104cd335.png