A closed discrete curve is map from a discrete circle , , into some space . In some situations it is more convenient to consider the discrete circle just as ,and a closed discrete curve as a periodic sequence, i.e. such that . In this case we just write and keep in mind that it is meant to be a periodic sequence.
Now, if is a closed discrete curve in , we have a corresponding parallel transport . But in general there exists no parallel frame for the curve. This you certainly have noticed already from the last homework.

We can still apply the algorithm to the curve and obtain a normal vector field which by construction satisfies for all . But there is no reason that this should also be true for . Here we may have a certain angle defect ,
Note that the normal spaces (and thus also the space of normal vector fields) are natural complex vector spaces. The complex numbers act on as follows: Further they inherit a natural inner product from . This turns the normal spaces into hermitian lines. Note that the parallel transports are isometric orientation preserving maps. Thus they define unitary maps between these lines. For the normal field defined as above, Hence In particular we see that is independent of all choices – the choice of the start point and the choice of the first normal vector – and thus can be assigned directly to the curve .

Actually this phenomenon is well-known in the smooth world. The angle defect of a curve is related to the signed area enclosed by the tangent of on the sphere,
Though not each closed discrete curve can be equipped with a parallel normal field we still want a nice smooth looking framing along the curve. One obvious way to resolve this problem is to distribute the defect along the curve: If denotes the discrete arclength, and the length of the curve, then the field is given byHere again denotes the normal field produced by our algorithm. Note thatfor . Similarly, for we getI.e. compared to a parallel field the field rotates by an angle proportional to the edge length.

Note that is only defined up to an integral multiple of . The choice of determines how twisted the field is. Though there is a minimal choice.

Let us translate this to quaternionic frames. A quaternionic frame assigns to each edge a unit quaternion which rotates the standard basis such that is mapped to , In Houdini’s this was called @orient.
Now suppose we have constructed a frame as described in the previous tutorial. To obtain the modified frame as described above we must perform for each edge an additional rotation around by the angle . Note that also the -plane is a complex line and is complex linear. Thus, instead of rotating afterwards around , we can equivalently precompose by a rotation around by the same angle. This yieldsHere . This modified frame is the discrete counterpart of a frame of constant torsion, which always exists.
Exercise: Modify your last homework so that it computes for a given closed discrete curve a frame of constant torsion. Make it possible to change the twisting of the frame.

One possible application of frames is to draw a tubular surface around a given curve: Let is a closed discrete curve and a frame of . Then the -tube can be parametrized by This we can use to create our own improved version of the polywire node.
Homework (due 17/19 May): Create a tubular surface node, i.e. write a network that computes for any given closed discrete curve a parametrized tube around it. To do so use a frame of minimal constant torsion to modify the point positions of a standard torus provided by Houdini’s torus node. In one direction the resolution of the torus has to be chosen to coincide with the number of points of the input curve. Make it possible to change the resolution in the other direction.
Hint: To set the number of columns of the torus one can use the Expression function npoints
in the parameter field Columns of the Torus Node.